Commit cb52bd1d authored by Pat Kira's avatar Pat Kira Committed by Robert Lyon

Folder gallery, journal (BUG 1465107)

Change-Id: Ia270b31fb7761df509ef9cefc843b9d72fc6f729
parent 4083787b
......@@ -160,7 +160,7 @@ $viewtheme = $view->get('theme');
if ($viewtheme && $THEME->basename != $viewtheme) {
$THEME = new Theme($viewtheme);
}
$headers = array('<link rel="stylesheet" type="text/css" href="' . append_version_number(get_config('wwwroot') . 'theme/views.css' ) . '">',);
$headers = array();
// Set up skin, if the page has one
$owner = $view->get('owner');
......
......@@ -342,7 +342,7 @@ class PluginBlocktypeTaggedposts extends SystemBlocktype {
function (item, container) {
if (item.id[0] == "-") {
container.parent().addClass("tagexcluded");
item.text = '<span class="accessible-hidden">{$excludetag}</span>' + item.text;
item.text = '<span class="sr-only">{$excludetag}</span>' + item.text;
}
return item.text;
}
......
......@@ -677,6 +677,7 @@ class PluginBlocktypeGallery extends PluginBlocktype {
$element['config']['upload'] = false;
$element['config']['selectone'] = true;
$element['config']['selectfolders'] = true;
$element['config']['selectmodal'] = true;
$element['filters'] = array(
'artefacttype' => array('folder'),
);
......
......@@ -221,7 +221,9 @@ function formGlobalError(form, data) {
// Message related functions
function makeMessage(message, type) {
if (message === undefined) {
return;
}
switch (type) {
case 'ok':
return DIV({'class': type +' alert alert-success'}, message);
......
......@@ -23,10 +23,6 @@ function addFeedbackError(form, data) {
}
function addFeedbackSuccess(form, data) {
// addElementClass('add_feedback_form', 'hidden');
if ($('overlay')) {
removeElement('overlay');
}
paginator.updateResults(data);
// Clear rating from previous submission
forEach(getElementsByTagAndClassName('input', 'star', 'add_feedback_form_rating_container'), function (r) {
......@@ -34,11 +30,11 @@ function addFeedbackSuccess(form, data) {
});
paginator.alertProxy('pagechanged', data['data']);
// Clear TinyMCE
// Clear add feedback form TinyMCE
if (isTinyMceUsed()) {
tinyMCE.activeEditor.setContent('');
var currentMCE = tinyMCE.get('add_feedback_form_message');
currentMCE.setContent('');
}
// Clear the textarea (in case TinyMCE is disabled)
var messageid = 'message';
if (data.fieldnames && data.fieldnames.message) {
......@@ -50,14 +46,18 @@ function addFeedbackSuccess(form, data) {
if (data.data.updatelink) {
jQuery('#toggle_watchlist_link').text(data.data.updatelink);
}
rewriteCancelButtons();
formSuccess(form, data);
// Check if the form is displayed inside a modal
// then close the modal
if ($j('#feedback-form').length) {
$j('#feedback-form').modal('hide');
}
}
function objectionSuccess(form, data) {
// addElementClass('objection_form', 'hidden');
$('objection_form_message').value = '';
rewriteCancelButtons();
formSuccess(form, data);
// close the form when the form is submited
// Using bootstrap modal
......@@ -66,82 +66,36 @@ function objectionSuccess(form, data) {
}
}
function moveFeedbackForm(tinymceused) {
if (tinymceused) {
tinyMCE.execCommand('mceRemoveEditor', false, 'add_feedback_form_message');
}
form = $('add_feedback_form');
removeElement(form);
appendChildNodes($('add_feedback_link').parentNode, form);
if (tinymceused) {
tinyMCE.execCommand('mceAddEditor', false, 'add_feedback_form_message');
}
}
function rewriteCancelButtons() {
if ($('add_feedback_form')) {
var buttons = getElementsByTagAndClassName('input', 'cancel', 'add_feedback_form');
// hashed field names on anon forms mean we don't know the exact id of this button
var idprefix = 'cancel_add_feedback_form_';
forEach(buttons, function(button) {
if (getNodeAttribute(button, 'id').substring(0, idprefix.length) == idprefix) {
disconnectAll(button);
connect(button, 'onclick', function (e) {
// Reset the form on cancel
// To do reset the form without reloading the page
$j('#comment-form').reset();
e.stop();
// addElementClass('add_feedback_form', 'hidden');
if ($('overlay')) {
removeElement('overlay');
}
return false;
});
}
});
}
if ($('cancel_objection_form_submit')) {
disconnectAll('cancel_objection_form_submit');
connect('cancel_objection_form_submit', 'onclick', function (e) {
// Get objectionable form form id and hide on click
// Using bootstrap modal
$j('#report-form').modal('hide');
e.stop();
//addElementClass('objection_form', 'hidden');
return false;
});
}
}
function isTinyMceUsed() {
return (typeof(tinyMCE) != 'undefined' && typeof(tinyMCE.get('add_feedback_form_message')) != 'undefined');
}
addLoadEvent(function () {
rewriteCancelButtons();
jQuery(function($j) {
if ($('toggle_watchlist_link')) {
connect('toggle_watchlist_link', 'onclick', function (e) {
e.stop();
if ($j('#toggle_watchlist_link').length) {
$j('#toggle_watchlist_link').click(function (e) {
e.preventDefault();
e.stopPropagation();
if (typeof artefactid === 'undefined') {
artefactid = null;
artefactid = 0;
}
sendjsonrequest(config.wwwroot + 'view/togglewatchlist.json.php', {'view': viewid, 'artefact': artefactid}, 'POST', function(data) {
if (data.newtext) {
$j.post(config.wwwroot + 'view/togglewatchlist.json.php', {
'view': viewid,
'artefact': artefactid,
'sesskey': config.sesskey
}).done(function(data) {
if (data.message.newtext) {
var icon = '<span class="icon icon-eye prs"></span>';
if(data.watched){
if (data.message.watched) {
icon = '<span class="icon icon-eye-slash prs"></span>';
}
$('toggle_watchlist_link').innerHTML = icon + data.newtext;
$j('#toggle_watchlist_link').html(icon + data.message.newtext);
displayMessage(data.message.message, 'ok', true);
}
});
});
}
});
jQuery(function($j) {
$j(".copyview").each(function() {
$j(this).click(function(e) {
if (e.target.href.match(/collection=(.*)/)) {
......@@ -175,4 +129,4 @@ jQuery(function($j) {
}
});
});
});
});
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
{if ($editing)}
<div class="shortcut nojs-hidden-block">
<div{if (count($blogs) == 1)} class="hidden"{/if}>
<label class="text">{str tag='shortcutaddpost' section='artefact.blog'}</label>
<select id="blogselect_{$blockid}" class="select">{foreach from=$blogs item=blog}<option value="{$blog->id}"> {$blog->title} </option>{/foreach}</select>
<input class="select" type="hidden" value="{$tagselect}">
<a class="btn btnshortcut">{str tag='shortcutgo' section='artefact.blog'}</a>
<div class="shortcut nojs-hidden-block mtl">
<div class="alert alert-default {if (count($blogs) == 1)}hidden{/if}">
<label class="text">{str tag='shortcutaddpost' section='artefact.blog'}: </label>
<div class="input-group">
<span class="picker">
<select id="blogselect_{$blockid}" class="select form-control">{foreach from=$blogs item=blog}<option value="{$blog->id}"> {$blog->title} </option>{/foreach}</select>
</span>
<input class="select" type="hidden" value="{$tagselect}">
<span class="input-group-btn">
<a class="btn btnshortcut btn-success">{str tag='shortcutgo' section='artefact.blog'}</a>
</span>
</div>
</div>
<a class="btn btnshortcut {if (count($blogs) != 1)} hidden{/if}">{str tag='shortcutnewentry' section='artefact.blog'}</a>
<a class="btn btnshortcut feedback panel-footer mtl {if (count($blogs) != 1)} hidden{/if}">
<span class="icon icon-plus prs"></span>
{str tag='shortcutnewentry' section='artefact.blog'}
</a>
</div>
{/if}
<p>{str tag='blockheading' section='blocktype.blog/taggedposts'}
{if $viewowner}{$tag} {str tag='by' section='artefact.blog'} <a href="{profile_url($viewowner)}">{$viewowner|display_name}</a>
{else}<a href="{$WWWROOT}tags.php?tag={$tag}&sort=name&type=text">{$tag}</a>{/if}</p>
<h4>
{$blockheading|clean_html|safe}
{if $viewowner}
{$tag} {str tag='by' section='artefact.blog'}
<a href="{profile_url($viewowner)}">{$viewowner|display_name}</a>
{else}
<a href="{$WWWROOT}tags.php?tag={$tag}&sort=name&type=text">{$tag}</a>
{/if}
</h4>
{if $configerror}{str tag='configerror' section='blocktype.blog/taggedposts'}
{elseif $badtag}{str tag='notags' section='blocktype.blog/taggedposts' arg1=$badtag}
{if $configerror}
<span class="metadata">{str tag='configerror' section='blocktype.blog/taggedposts'}</span>
{elseif $badtag}
<span class="metadata">{str tag='notags' section='blocktype.blog/taggedposts' arg1=$badtag}</span>
{elseif $full}
<div id="blogdescription">
<div id="postlist_{$blockid}" class="postlist">
{foreach from=$results item=post}
<div class="post">
<h3 class="title"><a href="{$WWWROOT}artefact/artefact.php?artefact={$post->id}&view={$view}">{$post->title}</a></h3>
<div class="postdetails">{$post->postedbyon}</div>
<div class="detail">{$post->description|clean_html|safe}</div>
<div class="tags"><strong>{str tag=tags}:</strong> {list_tags owner=$post->owner tags=$post->taglist}</div>
<h4 class="title">
<a href="{$WWWROOT}artefact/artefact.php?artefact={$post->id}&view={$view}">
{$post->title}
</a>
</h4>
<div class="postdetails metadata">
<span class="icon icon-calendar mrs"></span>
{$post->postedbyon}
</div>
<div class="tag tags metadata">
<strong><span class="icon icon-tags"></span>{str tag=tags}:</strong>
{list_tags owner=$post->owner tags=$post->taglist}
</div>
<div class="detail mtl mbl">{$post->description|clean_html|safe}</div>
{if $post->commentcount != null}
<div class="comments">
<div class="comments clearfix">
{if $post->commentcount > 0}
<a id="block_0{$post->id}{$blockid}" class="commentlink" href="{$WWWROOT}artefact/artefact.php?artefact={$post->id}&view={$view}">{str tag=Comments section=artefact.comment} ({$post->commentcount})</a>
{if $post->allowcomments}
<a class="addcomment bar-before btn-sm btn btn-default pull-right" href="{$WWWROOT}artefact/artefact.php?artefact={$post->id}&view={$view}">
<span class="icon icon-plus prs"></span>
{str tag=addcomment section=artefact.comment}
</a>
{/if}
<a id="block_0{$post->id}{$blockid}" class="lead text-small commentlink as-link link-expand-right collapsed" data-toggle="collapse" href="#feedbacktable_0{$post->id}{$blockid}" aria-expanded="false">
{str tag=Comments section=artefact.comment} ({$post->commentcount})
<span class="icon icon-chevron-down pls"> </span>
</a>
<div id="feedbacktable_0{$post->id}{$blockid}" class="feedbacktable collapse mtl">
{$post->comments->tablerows|safe}
</div>
{else}
{if $post->allowcomments}
<span class="nocomments">{str tag=Comments section=artefact.comment} ({$post->commentcount})</span>
<span class="nocomments lead text-small text-medium prm">
{str tag=Comments section=artefact.comment} ({$post->commentcount})
</span>
<a class="addcomment bar-before btn btn-default btn-sm pull-right" href="{$WWWROOT}artefact/artefact.php?artefact={$post->id}&view={$view}">
<span class="icon icon-plus prs"></span>
{str tag=addcomment section=artefact.comment}
</a>
{/if}
{/if}
{if $post->allowcomments}
<a class="addcomment bar-before" href="{$WWWROOT}artefact/artefact.php?artefact={$post->id}&view={$view}">{str tag=addcomment section=artefact.comment}</a>
{/if}
</div>
<div class="feedbacktablewrapper">
<div id="feedbacktable_0{$post->id}{$blockid}" class="feedbacktable">
{$post->comments->tablerows|safe}
</div>
</div>
{/if}
</div>
{/foreach}
</div>
</div>
{else}
<ul class="taggedposts">
{foreach from=$results item=post}
<li>
<strong>
<a href="{$WWWROOT}artefact/artefact.php?artefact={$post->id}&view={$view}">{$post->title}</a>
</strong>
{str tag='postedin' section='blocktype.blog/taggedposts'}
{else}<ul class="taggedposts">{foreach from=$results item=post}
<li>
<strong><a href="{$WWWROOT}artefact/artefact.php?artefact={$post->id}&view={$view}">{$post->title}</a></strong>
{str tag='postedin' section='blocktype.blog/taggedposts'}
{if $viewowner}{$post->parenttitle}
{else}<a href="{$WWWROOT}artefact/artefact.php?artefact={$post->parent}&view={$view}">{$post->parenttitle}</a>{/if}
<span class="postdetails">{str tag='postedon' section='blocktype.blog/taggedposts'} {$post->displaydate}</span>
</li>
{/foreach}</ul>
{if $viewowner}
{$post->parenttitle}
{else}
<a href="{$WWWROOT}artefact/artefact.php?artefact={$post->parent}&view={$view}">{$post->parenttitle}</a>
{/if}
<span class="postdetails">
{str tag='postedon' section='blocktype.blog/taggedposts'} {$post->displaydate}
</span>
</li>
{/foreach}
</ul>
{/if}
{foreach from=$posts item=post}
<div class="post ptm mbxl">
<div class="post">
<h4 class="title">
<a href="{$WWWROOT}artefact/artefact.php?artefact={$post->id}&view={$options.viewid}">{$post->title}</a>
</h4>
......
......@@ -8,9 +8,11 @@
</div>
{$feedback->pagination|safe}
{if $enablecomments}
<a id="add_feedback_link" class="feedback" href="">{str tag=placefeedback section=artefact.comment}</a>
<script type="application/javascript">
var feedbacklinkinblock = true;
</script>
<div class="text-right">
<a id="add_feedback_link" class="feedback btn btn-default btn-sm" href="#" data-toggle="modal" data-target="#feedback-form">
<span class="icon icon-lg icon-plus prm"></span>
{str tag=addcomment section=artefact.comment}
</a>
</div>
{/if}
{/if}
\ No newline at end of file
{/if}
<div id="thumbnails{$instanceid}" class="panel-body thumbnails ptl js-masonry" data-masonry='{ "itemSelector": ".thumb" }'>
{foreach from=$images item=image}
<div style="width: {$width * 2}px;" class="thumb mts mbs mrs mls ptm">
<div {if $image.squaredimensions}style="width:{$image.squaredimensions}px;height:{$image.squaredimensions}px;"{/if} class="thumb mts mbs mrs mls ptm">
<a rel="{$image.slimbox2}" href="{$image.link}" title="{$image.title}" target="_blank">
<img src="{$image.source}" alt="{$image.title}" title="{$image.title}" width="{$width}" height="{$width}" {if $frame}class="frame center-block pbm"{/if}/>
<img src="{$image.source}" alt="{$image.title}" title="{$image.title}" width="{if $image.width}{$image.width}{else}{$width}{/if}" height="{if $image.height}{$image.height}{else}{$width}{/if}" {if $frame}class="frame center-block pbm"{/if}/>
</a>
{if $showdescription && $image.title}
<p class="text-small prs pls">
......
......@@ -120,7 +120,7 @@ td.btn-group {
.btn {
border-left:0;
display: inline-block;
border-bottom-radius: 0;
@include border-bottom-radius(0);
border-bottom-left-radius: 0;
}
}
......@@ -231,7 +231,7 @@ td.btn-group {
margin-bottom: -3px;
}
&.last {
border-bottom-radius: 3px;
@include border-bottom-radius($border-radius-small);
}
}
}
......
.pagination-wrapper {
@extend .clearfix;
.pagination {
margin: 0 0 10px 0;
padding-left: 0;
......
......@@ -7,7 +7,7 @@
float: left;
width: 65%;
}
.comment-attachment {
padding-left: 15px;
margin-left: 15px;
......@@ -41,5 +41,12 @@
}
}
}
}
}
\ No newline at end of file
}
.collapse & {
&:first-child {
// To override panel listgroup no top border on first-child
border-top: 1px solid #ddd !important;
border-bottom: 0;
}
}
}
......@@ -23,10 +23,10 @@
&.last {
legend,
.panel-heading {
border-bottom-radius: 3px;
@include border-bottom-radius($border-radius-small);
a {
&.collapsed {
border-bottom-radius: 3px;
@include border-bottom-radius($border-radius-small);
}
}
}
......@@ -38,7 +38,7 @@
.fieldset-body {
border-top:0;
border-bottom-radius: 3px;
@include border-bottom-radius($border-radius-small);
}
}
......@@ -117,7 +117,7 @@
border-width: 0;
// For attachment collapsible
&.has-attachment {
border-radius: 3px;
border-radius: $border-radius-small;
border-width: 1px;
.panel-heading a {
border-width: 0;
......@@ -151,7 +151,7 @@
.panel-heading a,
.panel-body:not(.no-footer) {
border-bottom-width:0;
border-bottom-width: 0;
}
// last class will add bottom border to collapsible element(s)
......
......@@ -602,6 +602,15 @@ html[dir="rtl"] .select2-container-multi .select2-choices li {
background-image: linear-gradient(to bottom, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
}
.select2-container-multi .select2-choices .select2-search-choice.tagexcluded {
background-color: #ffd9d9;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f0b7b7', endColorstr='#ffd9d9', GradientType=0);
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #ffd9d9), color-stop(50%, #f7caca), color-stop(52%, #fac0c0), color-stop(100%, #f0b7b7));
background-image: -webkit-linear-gradient(top, #ffd9d9 20%, #f7caca 50%, #fac0c0 52%, #f0b7b7 100%);
background-image: -moz-linear-gradient(top, #ffd9d9 20%, #f7caca 50%, #fac0c0 52%, #f0b7b7 100%);
background-image: linear-gradient(to bottom, #ffd9d9 20%, #f7caca 50%, #fac0c0 52%, #f0b7b7 100%);
}
html[dir="rtl"] .select2-container-multi .select2-choices .select2-search-choice {
margin: 3px 5px 3px 0;
padding: 3px 18px 3px 5px;
......
This diff is collapsed.
This diff is collapsed.
<input type="hidden" id="{{$id}}" name="{{$name}}" {{if $describedby}}aria-describedby="{{$describedby}}"{{/if}} value="{{$value}}"/>
<script type="application/javascript">
addLoadEvent(function () {
{{if !$inblockconfig}}
addLoadEvent(function () {
{{/if}}
jQuery("#{{$id}}").select2({
initSelection : function(element, callback) {
callback({{$initvalue|safe}});
......@@ -30,6 +32,8 @@ addLoadEvent(function () {
},
{{$extraparams|safe}}
});
});
{{if !$inblockconfig}}
});
{{/if}}
jQuery("#{{$id}}").prop('disabled', {{$disabled}});
</script>
......@@ -120,29 +120,46 @@
{$feedback->pagination|safe}
{/if}
{/if}
<div id="viewmenu" class="view-menu ptxl pbl">
{if $feedback->position eq 'blockinstance' && $enablecomments}
<div class="feedback in-block modal fade" id="feedback-form">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">
<span class="icon icon-lg icon-comments prm"></span>
{str tag=addcomment section=artefact.comment}
</h4>
</div>
<div class="modal-body">
{$addfeedbackform|safe}
</div>
</div>
</div>
</div>
{elseif $feedback->position eq 'base' && $enablecomments}
{include file="view/viewmenu.tpl"}
{if $LOGGEDIN}
<div class="modal fade" id="report-form">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">
<span class="icon icon-lg icon-flag text-danger prs"></span>
{str tag=reportobjectionablematerial}
</h4>
</div>
<div class="modal-body">
{$objectionform|safe}
</div>
{/if}
{if $LOGGEDIN}
<div class="modal fade" id="report-form">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">
<span class="icon icon-lg icon-flag text-danger prs"></span>
{str tag=reportobjectionablematerial}
</h4>
</div>
<div class="modal-body">
{$objectionform|safe}
</div>
</div>
</div>
{/if}
</div>
{/if}
</div>
</div>
......
{if $feedback->position eq 'base' && $enablecomments}
<ul class="nav nav-tabs" role="tablist">
<li id="add_feedback_link" class="feedback active" role="presentation">
<a href="#comment-form" aria-controls="comment-form" role="tab" data-toggle="tab">
<span class="icon icon-lg icon-comments prm"></span>
{str tag=addcomment section=artefact.comment}
</a>
</li>
</ul>
<div id="viewmenu" class="view-menu ptxl pbl">
<ul class="nav nav-tabs" role="tablist">
<li id="add_feedback_link" class="feedback active" role="presentation">
<a href="#comment-form" aria-controls="comment-form" role="tab" data-toggle="tab">
<span class="icon icon-lg icon-comments prm"></span>
{str tag=addcomment section=artefact.comment}
</a>
</li>
</ul>
<div class="tab-panel">
<div role="tabpanel" class="tab-pane active" id="comment-form">
{$addfeedbackform|safe}
<div class="tab-panel">
<div role="tabpanel" class="tab-pane active" id="comment-form">
{$addfeedbackform|safe}
</div>
</div>