Commit be7af61f authored by Lisa Seeto's avatar Lisa Seeto

Bug 1827811: Move "Add comment" and "Details" into modal with "Comments"

create modal using configureblock id, update various templates to use the modal for blocks:
Image
Note
File(s) to download
Journal/blogs
add JS to open/close modal, add comments, delete comments, reply to comments, paginate comments.
add JS to handle url that redirects to view/view.php with modal open and populated.
Further changes to each block will be completed in child patches.
Add segment headings to the modal. Fix display of comments to cover width of modal.
Show comment removed msg in modal/page appropriately.
Fix behat test to close modal before continuing.
do not show existing comments if comments not allowed on artefact.
add validation to modal for comments/attachments
disable image as link when editing for image block
trigger focus on modal for accessibility
close modal on escape keydown event
fix merge conflict in view/view.php
fix merge conflict with master
make configureblock modal play nicely when comment block is on the page
update display of error messages to always show at top of modal so user doesn't have to scroll
add accesibility to close modal on escape key down
handle dock show/hide events for paginated pages in modal during validation
create block-comments-details-header template file
create details button and custom scss file with js to show and hide header
update comment links to save add comment and details when commentcount == 0
add active-block class to colour the block-header when active
toggle the details-btn active css
add _block-comments-details-header.scss to patch
change class invisble to class d-none
add block-comments-details-header.tpl to blocktypecontainerviewing.tpl
code review changes
add .no-modal class to links on group home page, dashboard and profile page.
add block header to appear above the title
change assessbtn from anchor tag to button to prevent scrolling.
make all clickable links clickable on page load (ignore assess mode)
fix js issues surrounding assessbtn move and show/hide blocks
change cursor on dashboard, my profile page, group homepage to default when over disabled modal links
update assessbtn to details btn
create tooltip for hover over file download block titles
fix containerElm console log error by not reattaching tinymce unneccessarily.
fix null named attributes issues on e.target when span (icons) instead of anchor is clicked.

Change-Id: I2e5218c040f8a9e252f785165ce9c566ecc2f56e
Signed-off-by: default avatarLisa Seeto <lisaseeto@catalyst.net.nz>
parent e3a53e16
......@@ -53,7 +53,6 @@ if (!empty($extradata->artefact) && !artefact_in_view($extradata->artefact, $ext
}
if ($ispagination) {
// This is not really working yet. Need to do more work on artefact/artefact.php
$options = ArtefactTypeAnnotationfeedback::get_annotation_feedback_options();
$options->limit = $limit;
$options->offset = $offset;
......
......@@ -33,7 +33,7 @@ class PluginBlocktypeAnnotation extends MaharaCoreBlocktype {
}
public static function has_title_link() {
return false; // true; // need to do more work on aretfact/artefact.php before this can be switched on.
return false;
}
public static function allowed_in_view(View $view) {
......
......@@ -894,9 +894,8 @@ class ArtefactTypeAnnotationfeedback extends ArtefactType {
);
$data->jsonscript = 'artefact/annotation/annotations.json.php';
$data->baseurl = get_config('wwwroot') . 'artefact/artefact.php?' .
'artefact=' . $data->annotation .
'&view=' . $data->view .
$data->baseurl = get_config('wwwroot') . 'view/view.php?id=' . $data->view .
'&artefact=' . $data->annotation .
(isset($data->block) ? '&block=' . $data->block : '');
$smarty = smarty_core();
......@@ -1139,6 +1138,7 @@ class ArtefactTypeAnnotationfeedback extends ArtefactType {
$block = new BlockInstance($blockid);
$smarty->assign('blockid', $blockid);
$smarty->assign('artefactid', $annotationartefact->get('id'));
$smarty->assign('annotationtitle', $block->get('title'));
$smarty->assign('annotationfeedbackcount', $annotationfeedbackcount);
$smarty->assign('annotationfeedback', $annotationfeedback);
......@@ -1613,7 +1613,7 @@ function delete_annotation_feedback_submit(Pieform $form, $values) {
$viewid = $view->get('id');
if ($artefactid = $annotation->get('artefact')) {
$url = 'artefact/artefact.php?view=' . $viewid . '&artefact=' . $artefactid;
$url = 'view/view.php?id=' . $viewid . '&artefact=' . $artefactid;
}
else {
$url = $view->get_url(false);
......@@ -1959,7 +1959,7 @@ class ActivityTypeArtefactAnnotationAnnotationfeedback extends ActivityTypePlugi
$institutionid = $artefactinstance->get('institution');
}
if (empty($this->url)) {
$this->url = 'artefact/artefact.php?artefact=' . $onartefact . '&view=' . $this->viewid;
$this->url = 'view/view.php?id=' . $this->viewid . '&artefact=' . $onartefact;
}
}
else if ($onview = $annotation->get('view')) {
......
......@@ -54,7 +54,7 @@ if (!empty($ancestors)) {
$pathitem = artefact_instance_from_id($ancestor);
if (artefact_in_view($pathitem, $viewid)) {
$artefactpath[] = array(
'url' => get_config('wwwroot') . 'artefact/artefact.php?artefact=' . $pathitem->get('id') . '&view=' . $viewid,
'url' => get_config('wwwroot') . 'view/view.php?id=' . $viewid,
'title' => $pathitem->display_title(),
);
$artefactok = true;
......
......@@ -41,7 +41,7 @@ class PluginBlocktypeBlog extends MaharaCoreBlocktype {
public static function get_link(BlockInstance $instance) {
$configdata = $instance->get('configdata');
if (!empty($configdata['artefactid'])) {
$data = get_config('wwwroot') . 'artefact/artefact.php?artefact=' . $configdata['artefactid'] . '&view=' . $instance->get('view');
$data = get_config('wwwroot') . 'view/view.php?id=' . $instance->get('view') . '&modal=1&block=' . $instance->get('id') . '&artefact=' . $configdata['artefactid'];
return sanitize_url($data);
}
}
......
......@@ -30,6 +30,7 @@ if ($blockid = param_integer('block', null)) {
$configdata['countcomments'] = true;
$configdata['versioning'] = false;
$configdata['viewid'] = $bi->get('view');
$configdata['blockid'] = $blockid;
$posts = ArtefactTypeBlogpost::get_posts($configdata['artefactid'], $limit, $offset, $configdata);
$template = 'artefact:blog:viewposts.tpl';
$baseurl = $bi->get_view()->get_url();
......
......@@ -44,6 +44,7 @@ class PluginBlocktypeComment extends MaharaCoreBlocktype {
if ($editing) {
$smarty = smarty_core();
$smarty->assign('editing', get_string('ineditordescription1', 'blocktype.comment/comment'));
$smarty->assign('blockid', $instance->get('id'));
$html = $smarty->fetch('blocktype:comment:comment.tpl');
return $html;
}
......
......@@ -30,16 +30,20 @@ $limit = param_integer('limit', 10);
$offset = param_integer('offset');
$artefact = null;
$blockid = null;
if (!empty($extradata->artefact)) {
$artefact = artefact_instance_from_id($extradata->artefact);
}
if (!empty($extradata->blockid)) {
$blockid = $extradata->blockid;
}
$view = new View($extradata->view);
$commentoptions = ArtefactTypeComment::get_comment_options();
$commentoptions->limit = $limit;
$commentoptions->offset = $offset;
$commentoptions->view = $view;
$commentoptions->artefact = $artefact;
$commentoptions->blockid = $blockid;
$data = ArtefactTypeComment::get_comments($commentoptions);
json_reply(false, array('data' => $data));
......@@ -16,7 +16,10 @@ $string['Comment'] = 'Comment';
$string['Comments'] = 'Comments';
$string['comment'] = 'comment';
$string['comments'] = 'comments';
$string['Details'] = 'Details';
$string['anddetails'] = 'and details';
$string['addcomment'] = 'Add comment';
$string['commentsanddetails'] = 'Comments (%d) and details';
$string['Allow'] = 'Allow';
$string['allowcomments'] = 'Allow comments';
$string['approvalrequired'] = 'Comments are moderated. If you choose to make this comment public, it will not be visible to others until it is approved by the owner.';
......
This diff is collapsed.
......@@ -27,6 +27,8 @@ class PluginBlocktypeFiledownload extends MaharaCoreBlocktype {
public static function render_instance(BlockInstance $instance, $editing=false, $versioning=false) {
require_once(get_config('docroot') . 'artefact/lib.php');
require_once(get_config('docroot') . 'artefact/comment/lib.php');
$configdata = $instance->get('configdata');
$viewid = $instance->get('view');
......@@ -41,6 +43,8 @@ class PluginBlocktypeFiledownload extends MaharaCoreBlocktype {
catch (ArtefactNotFoundException $e) {
continue;
}
$view = new View($viewid);
list($commentcount, $comments) = ArtefactTypeComment::get_artefact_comments_for_view($artefact, $view, $instance->get('id'), true, $editing, $versioning);
$file = array(
'id' => $artefactid,
......@@ -55,6 +59,7 @@ class PluginBlocktypeFiledownload extends MaharaCoreBlocktype {
array('id' => $artefactid, 'viewid' => $viewid)
),
'downloadurl' => $wwwroot,
'commentcount' => $commentcount,
);
if ($artefact instanceof ArtefactTypeProfileIcon) {
......@@ -70,7 +75,9 @@ class PluginBlocktypeFiledownload extends MaharaCoreBlocktype {
$smarty = smarty_core();
$smarty->assign('viewid', $instance->get('view'));
$smarty->assign('blockid', $instance->get('id'));
$smarty->assign('files', $files);
$smarty->assign('editing', $editing);
return $smarty->fetch('blocktype:filedownload:filedownload.tpl');
}
......
......@@ -43,6 +43,7 @@ class PluginBlocktypeFolder extends MaharaCoreBlocktype {
$configdata = $instance->get('configdata');
$configdata['viewid'] = $instance->get('view');
$configdata['simpledisplay'] = true;
$configdata['blockid'] = $instance->get('id');
// This can be either an image or profileicon. They both implement
// render_self
......
......@@ -361,7 +361,7 @@ class PluginBlocktypeGallery extends MaharaCoreBlocktype {
$link = $src . '&maxwidth=' . get_config_plugin('blocktype', 'gallery', 'previewwidth');
}
else {
$link = get_config('wwwroot') . 'artefact/artefact.php?artefact=' . $artefactid . '&view=' . $instance->get('view');
$link = get_config('wwwroot') . 'view/view.php?id=' . $instance->get('view') . '&modal=1&block=' . $instance->get('id') .' &artefact=' . $artefactid;
}
// If the Thumbnails are Square or not...
......
......@@ -63,12 +63,14 @@ class PluginBlocktypeImage extends MaharaCoreBlocktype {
$view = new View($viewid);
list($commentcount, $comments) = ArtefactTypeComment::get_artefact_comments_for_view($image, $view, $instance->get('id'), true, $editing, $versioning);
$smarty = smarty_core();
$smarty->assign('editing', $editing);
$smarty->assign('commentcount', $commentcount);
$smarty->assign('comments', $comments);
$smarty->assign('url', $wwwroot . 'artefact/artefact.php?artefact=' . $id . '&view=' . $viewid);
$smarty->assign('src', $src);
$smarty->assign('description', $description);
$smarty->assign('showdescription', !empty($configdata['showdescription']) && !empty($description));
$smarty->assign('blockid', $instance->get('id'));
$smarty->assign('artefactid', $id);
return $smarty->fetch('blocktype:image:image.tpl');
}
......
......@@ -13,6 +13,7 @@ defined('INTERNAL') || die();
$string['pluginname'] = 'Files';
$string['commentsanddetails'] = 'Comments (%d) and details';
$string['sitefilesloaded'] = 'Site files loaded';
$string['addafile'] = 'Add a file';
$string['archive'] = 'Archive';
......
......@@ -2191,6 +2191,7 @@ class ArtefactTypeFolder extends ArtefactTypeFileBase {
}
$smarty->assign('children', $childrecords);
}
$smarty->assign('blockid', $options['blockid']);
return array('html' => $smarty->fetch('artefact:file:folder_render_self.tpl'),
'javascript' => null);
}
......@@ -2476,12 +2477,15 @@ class ArtefactTypeImage extends ArtefactTypeFile {
public function render_self($options) {
$downloadpath = get_config('wwwroot') . 'artefact/file/download.php?file=' . $this->id;
$url = get_config('wwwroot') . 'artefact/artefact.php?artefact=' . $this->id;
if (isset($options['viewid'])) {
$downloadpath .= '&view=' . $options['viewid'];
$url .= '&view=' . $options['viewid'];
}
$metadataurl = $url . '&details=1';
if (isset($options['viewid'])) {
$metadataurl = get_config('wwwroot') . 'view/view.php?id=' . $options['viewid'] . '&modal=1&artefact=' . $this->id;
}
else {
$metadataurl = null;
}
if (empty($options['metadata'])) {
$smarty = smarty_core();
$smarty->assign('id', $this->id);
......
......@@ -53,7 +53,6 @@ class PluginBlocktypeTextbox extends MaharaCoreBlocktype {
$f = artefact_instance_from_id($attachment->id);
$attachment->size = $f->describe_size();
$attachment->iconpath = $f->get_icon(array('id' => $attachment->id, 'viewid' => isset($options['viewid']) ? $options['viewid'] : 0));
$attachment->viewpath = get_config('wwwroot') . 'artefact/artefact.php?artefact=' . $attachment->id . '&view=' . (isset($viewid) ? $viewid : 0);
$attachment->downloadpath = get_config('wwwroot') . 'artefact/file/download.php?file=' . $attachment->id;
if (isset($viewid)) {
$attachment->downloadpath .= '&view=' . $viewid;
......
......@@ -1000,7 +1000,6 @@ class ArtefactTypeHtml extends ArtefactType {
$f = artefact_instance_from_id($attachment->id);
$attachment->size = $f->describe_size();
$attachment->iconpath = $f->get_icon(array('id' => $attachment->id, 'viewid' => isset($options['viewid']) ? $options['viewid'] : 0));
$attachment->viewpath = get_config('wwwroot') . 'artefact/artefact.php?artefact=' . $attachment->id . '&view=' . (isset($options['viewid']) ? $options['viewid'] : 0);
$attachment->downloadpath = get_config('wwwroot') . 'artefact/file/download.php?file=' . $attachment->id;
if (isset($options['viewid'])) {
$attachment->downloadpath .= '&view=' . $options['viewid'];
......@@ -1009,6 +1008,7 @@ class ArtefactTypeHtml extends ArtefactType {
$smarty->assign('attachments', $attachments);
}
$smarty->assign('view', (isset($options['viewid']) ? $options['viewid'] : null));
$smarty->assign('modal', (isset($options['modal']) ? $options['modal'] : false));
return array(
'html' => $smarty->fetch('artefact.tpl'),
'javascript'=>''
......
......@@ -1365,8 +1365,8 @@ class BlockInstance {
$configdata = $this->get('configdata');
if (!empty($configdata['artefactid']) && $displayforrole) {
if (call_static_method($classname, 'has_title_link')) {
$smarty->assign('viewartefacturl', get_config('wwwroot') . 'artefact/artefact.php?artefact='
. $configdata['artefactid'] . '&view=' . $this->get('view') . '&block=' . $this->get('id'));
$smarty->assign('blockid', $this->get('id'));
$smarty->assign('artefactid', $configdata['artefactid']);
}
}
......@@ -1389,6 +1389,36 @@ class BlockInstance {
$cardicontype = !empty($cssicontype) ? preg_replace('/^icon-/', 'card-', $cssicontype) : '';
$smarty->assign('cardicontype', $cardicontype);
$smarty->assign('versioning', $versioning);
/* Apply the comments and details header via template to these types of blocks only
* These blocks have one artefact per block, for blocks with multiple artefacts
* the header will be added elsewhere via their specific templates
*/
$includetheseblocks = array('image', 'textbox');
$blockheader = (in_array($this->get('blocktype'), $includetheseblocks)) ? true : false;
$smarty->assign('blockheader', $blockheader);
//Set up template for the blocks that have the comments and details header
if ($blockheader) {
if (!empty($configdata['artefactid'])) {
$smarty->assign('artefactid', $configdata['artefactid']);
$artefact = $this->get_artefact_instance($configdata['artefactid']);
$smarty->assign('allowcomments', $artefact->get('allowcomments'));
if (!$artefact->get('allowcomments')) {
$smarty->assign('allowdetails', (int)get_config('licensemetadata'));
}
else {
$commentoptions = ArtefactTypeComment::get_comment_options();
$commentoptions->limit = 0;
$commentoptions->view = new View($this->get('view'));
$commentoptions->artefact = $artefact;
$commentoptions->onview = true;
$commentoptions->blockid = $this->get('id');
$comments = ArtefactTypeComment::get_comments($commentoptions);
$commentcount = isset($comments->count) ? $comments->count : 0;
$smarty->assign('commentcount', $commentcount);
}
}
}
return $smarty->fetch('view/blocktypecontainerviewing.tpl');
}
......
......@@ -93,7 +93,16 @@ if ($group->public) {
$javascript = array('paginator');
$blocktype_js = $view->get_all_blocktype_javascript();
$javascript = array_merge($javascript, $blocktype_js['jsfiles']);
$inlinejs = "jQuery( function() {\n" . join("\n", $blocktype_js['initjs']) . "\n});";
$inlinejs = <<<JS
jQuery(function($) {
JS;
$inlinejs .= join("\n", $blocktype_js['initjs']) . "\n";
$inlinejs .= <<<JS
// Disable the modal_links for images etc... when page loads
$('a[class*=modal_link], a[class*=inner-link]').addClass('no-modal');
$('a[class*=modal_link], a[class*=inner-link]').css('cursor', 'default');
});
JS;
$headers = array_merge($headers, $view->get_all_blocktype_css());
......
......@@ -78,6 +78,10 @@ jQuery(function($) {
if ($('#hideinfo').length) {
$('#hideinfo').on('click', nevershow);
}
// Disable the modal_links for images etc... when page loads
$('a[class*=modal_link], a[class*=inner-link]').addClass('no-modal');
$('a[class*=modal_link], a[class*=inner-link]').css('cursor', 'default');
});
JAVASCRIPT;
......
This diff is collapsed.
......@@ -90,7 +90,7 @@ function objection_form_submit(Pieform $form, $values) {
db_commit();
if ($artefact) {
$goto = get_config('wwwroot') . 'artefact/artefact.php?artefact=' . $artefact->get('id') . '&view='.$view->get('id');
$goto = get_config('wwwroot') . 'view/view.php?id=' . $view->get('id') . '&modal=1&artefact=' . $artefact->get('id');
}
else {
$goto = $view->get_url();
......@@ -209,7 +209,7 @@ function notrude_form_submit(Pieform $form, $values) {
$reportername = display_default_name($USER);
if ($artefact) {
$goto = get_config('wwwroot') . 'artefact/artefact.php?artefact=' . $artefact->get('id') . '&view=' . $view->get('id');
$goto = get_config('wwwroot') . 'view/view.php?id=' . $view->get('id') . 'artefact=' . $artefact->get('id');
}
else {
$goto = $view->get_url();
......@@ -331,7 +331,7 @@ function stillrude_form_submit(Pieform $form, $values) {
// Send notification to the owner.
if ($artefact) {
$goto = get_config('wwwroot') . 'artefact/artefact.php?artefact=' . $artefact->get('id') . '&view=' . $view->get('id');
$goto = get_config('wwwroot') . 'view/view.php?id=' . $view->get('id') . 'artefact=' . $artefact->get('id');
}
else {
$goto = $view->get_url();
......@@ -479,7 +479,7 @@ function review_form_submit(Pieform $form, $values) {
db_commit();
if ($artefact) {
$goto = get_config('wwwroot') . 'artefact/artefact.php?artefact=' . $artefact . '&view='.$view->get('id');
$goto = get_config('wwwroot') . 'view/view.php?id=' . $view->get('id') . 'artefact=' . $artefact;
}
else {
$goto = $view->get_url();
......
......@@ -1425,6 +1425,14 @@ function jsstrings() {
'blocksinstructionajaxlive1',
),
),
'viewmenu' => array(
'artefact.comment' => array(
'addcomment',
'Details',
'commentsanddetails',
'commentremoved',
)
)
);
}
......
......@@ -196,8 +196,8 @@ abstract class PluginSearch extends Plugin implements IPluginSearch {
$artefact = artefact_instance_from_id($result['id']);
if ($artefact->in_view_list() && $views = $artefact->get_views_instances()) {
foreach ($views as $view) {
$result['views'][$view->get('title')] = get_config('wwwroot') . 'artefact/artefact.php?artefact='
. $result['id'] . '&view=' . $view->get('id');
$result['views'][$view->get('title')] = get_config('wwwroot') . 'view/view.php?id=' . $view->get('id') . '&modal=1&artefact='
. $result['id'];
}
}
if ($links = $artefact->get_links($result['id'])) {
......
......@@ -28,6 +28,7 @@ jQuery(function($) {
$('body, .navbar-fixed-top').width('auto');
$('body').removeClass('modal-open modal-open-docked');
$('.active-block').removeClass('active-block');
};
/*
......@@ -74,7 +75,9 @@ jQuery(function($) {
var targetID = $(this).attr('data-target'),
target = $(targetID);
dock.show(target, false, true);
if (!$(this).hasClass('no-modal')) {
dock.show(target, false, true);
}
});
scope.find('[data-dismiss="modal-docked"]').on('click', function(e){
......@@ -83,7 +86,9 @@ jQuery(function($) {
});
scope.find('.submitcancel').on('click', function(){
dock.hide();
if (!$('#configureblock').hasClass('active')) {
dock.hide();
}
});
};
......
{if !$editing}
<div id="annotationfeedbackview_{$blockid}" class="annotation-feedback">
{if $annotationfeedbackcount > 0}
<a class="commentlink link-blocktype" id="block_{$blockid}" data-toggle="modal-docked" data-target="#annotation_feedbacktable_{$blockid}" href="#">
<a class="commentlink link-blocktype" id="block_{$blockid}" data-toggle="modal-docked" data-target="#annotation_feedbacktable_{$blockid}" href="#" data-artefactid="{$artefactid}" data-blockid="{$blockid}">
<span class="icon icon-comments" role="presentation" aria-hidden="true"></span>
{str tag=Annotationfeedback section=artefact.annotation} ({$annotationfeedbackcount})
</a>
......
......@@ -26,7 +26,7 @@
<div class="recentblogpost list-group">
{foreach from=$mostrecent item=post}
<div class="list-group-item">
<a href="{$WWWROOT}artefact/artefact.php?artefact={$post->id}&amp;view={$view}" class="outer-link">
<a class="modal_link outer-link" data-toggle="modal-docked" data-target="#configureblock" href="#" data-blockid="{$blockid}" data-artefactid="{$post->id}">
<span class="sr-only">{$post->title}</span>
</a>
<h4 class="list-group-item-heading text-inline">
......
......@@ -40,7 +40,7 @@
{foreach from=$results item=post}
<div class="post list-group-item">
<h4 class="list-group-heading">
<a href="{$WWWROOT}artefact/artefact.php?artefact={$post->id}&view={$view}">
<a class="modal_link list-group-heading" data-toggle="modal-docked" data-target="#configureblock" href="#" data-blockid="{$blockid}" data-artefactid="{$post->id}">
{$post->title}
</a>
</h4>
......@@ -65,50 +65,14 @@
{if !$editing}
{if $post->commentcount != null}
<div class="comments clearfix">
{if $post->commentcount > 0}
<a id="block_0{$post->id}{$blockid}" class="commentlink link-blocktype" data-toggle="modal-docked" data-target="#feedbacktable_0{$post->id}{$blockid}" href="#">
<a id="comment_link_{$post->id}" class="commentlink link-blocktype" data-toggle="modal-docked" data-target="#configureblock" href="#" data-blockid="{$blockid}" data-artefactid="{$post->id}">
<span class="icon icon-comments" role="presentation" aria-hidden="true"></span>
{str tag=Comments section=artefact.comment} ({$post->commentcount})
{str tag=commentsanddetails section=artefact.comment arg1=$post->commentcount}
</a>
{/if}
{if $post->allowcomments}
<a class="addcomment link-blocktype" href="{$WWWROOT}artefact/artefact.php?artefact={$post->id}&view={$view}">
<span class="icon icon-arrow-circle-right" role="presentation" aria-hidden="true"></span>
{str tag=addcomment section=artefact.comment}
</a>
{/if}
</div>
{/if}
{/if}
</div>
{if !$editing}
<div id="feedbacktable_0{$post->id}{$blockid}" class="feedbacktable modal modal-docked">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header clearfix">
<button class="close" data-dismiss="modal-docked">
<span class="times">&times;</span>
<span class="sr-only">{str tag=Close}</span>
</button>
<h4 class="modal-title float-left">
<span class="icon icon-lg icon-comments left" role="presentation" aria-hidden="true"></span>
{str tag=Comments section=artefact.comment} |
{$post->title}
</h4>
{if $post->allowcomments}
<a class="addcomment float-right" href="{$WWWROOT}artefact/artefact.php?artefact={$post->id}&view={$view}">
{str tag=addcomment section=artefact.comment}
<span class="icon icon-arrow-right right" role="presentation" aria-hidden="true"></span>
</a>
{/if}
</div>
<div class="modal-body flush">
{$post->comments->tablerows|safe}
</div>
</div>
</div>
</div>
{/if}
{/foreach}
</div>
</div>
......
......@@ -2,7 +2,9 @@
<div class="post list-group-item clearfix flush">
<div class="post-heading">
<h4 class="title">
<a href="{$WWWROOT}artefact/artefact.php?artefact={$post->id}&view={$options.viewid}">{$post->title}</a>
<a class="modal_link" data-toggle="modal-docked" data-target="#configureblock" href="#" data-blockid="{$options.blockid}" data-artefactid="{$post->id}">
{$post->title}
</a>
</h4>
<div class="postdetails metadata">
<span class="icon icon-regular icon-calendar-alt left" role="presentation" aria-hidden="true"></span>
......@@ -70,45 +72,14 @@
{if $options.viewid && $post->allowcomments}
<div class="comments">
{if $post->commentcount > 0}
<a id="blockpost_{$post->id}" class="commentlink link-blocktype" data-toggle="modal-docked" data-target="#feedbacktable_0{$post->id}{$options.blockid}" href="#">
<span class="icon icon-comments" role="presentation" aria-hidden="true"></span>
{str tag=Comments section=artefact.comment} ({$post->commentcount})
</a>
{/if}
{if $post->allowcomments}
<a class="addcomment link-blocktype" href="{$WWWROOT}artefact/artefact.php?artefact={$post->id}&view={$options.viewid}">
<span class="icon icon-arrow-circle-right" role="presentation" aria-hidden="true"></span>
{str tag=addcomment section=artefact.comment}
</a>
<a id="comment_link_{$post->id}" class="commentlink link-blocktype" data-toggle="modal-docked" data-target="#configureblock" href="#" data-blockid="{$options.blockid}" data-artefactid="{$post->id}">
<span class="icon icon-comments" role="presentation" aria-hidden="true"></span>
<span class="comment_count" role="presentation" aria-hidden="true"></span>
{str tag=commentsanddetails section=artefact.comment arg1=$post->commentcount}
</a>
{/if}
</div>
<div class="feedback modal modal-docked" id="feedbacktable_0{$post->id}{$options.blockid}">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header clearfix">
<button class="close" data-dismiss="modal-docked">
<span class="times">&times;</span>
<span class="sr-only">{str tag=Close}</span>
</button>
<h4 class="modal-title float-left">
<span class="icon icon-lg icon-comments" role="presentation" aria-hidden="true"></span>
{str tag=Comments section=artefact.comment} |
{$post->title}
</h4>
{if $post->allowcomments}
<a class="addcomment float-right" href="{$WWWROOT}artefact/artefact.php?artefact={$post->id}&view={$options.viewid}">
{str tag=addcomment section=artefact.comment}
<span class="icon icon-arrow-right right" role="presentation" aria-hidden="true"></span>
</a>
{/if}
</div>
<div class="modal-body flush">
{$post->comments->tablerows|safe}
</div>
</div>
</div>
</div>
{/if}
</div>
{/foreach}
......@@ -4,10 +4,17 @@
</div>
{elseif $feedback}
{* Do not change the id because it is used by paginator.js *}
<div id="feedbacktable" class="feedbacktable js-feedbackblock fullwidth">
<div id="feedbacktable{if $blockid}_{$blockid}{/if}" class="feedbacktable js-feedbackblock fullwidth">
{$feedback->tablerows|safe}
</div>
{$feedback->pagination|safe}
<p>
{$feedback->pagination|safe}
{if $feedback->pagination_js}
<script>
{$feedback->pagination_js|safe}
</script>
{/if}
</p>
{if $enablecomments}
<a id="add_feedback_link" class="js-add-comment-modal feedback link-blocktype" href="#" data-toggle="modal-docked" data-target="#feedback-form">
<span class="icon icon-plus" role="presentation" aria-hidden="true"></span>
......
......@@ -53,7 +53,7 @@
{$item->deleteform|safe}
{/if}
{if $item->canreply}
<button class="btn btn-secondary float-left commentreplyto btn-group-item js-reply" id="commentreplyto{$item->id}" title="{str tag=reply section=artefact.comment}" data-replyto="{$item->id}" data-canprivatereply="{$item->canprivatereply}" data-canpublicreply="{$item->canpublicreply}">
<button class="btn btn-secondary float-left commentreplyto btn-group-item js-reply" id="commentreplyto{$item->id}" title="{str tag=reply section=artefact.comment}" data-replyto="{$item->id}" data-canprivatereply="{$item->canprivatereply}" data-canpublicreply="{$item->canpublicreply}" {if $blockid}data-blockid="{$blockid}"{/if}>
<span class="icon icon-reply icon-lg" role="presentation" aria-hidden="true"></span>
<span class="sr-only">{str tag=reply section=artefact.comment}</span>
</button>
......