Commit 953a5eab authored by Lisa Seeto's avatar Lisa Seeto

Bug 1827811: Resume Icons

- get attachment comment counts for bh icons
- display plain text for titles in editing mode
- change the way the commentlink is targetted via js
- add blockid's to resume attachments
- for folder block: add comment count, change titles from
	links to plain text when editing
- change notes attachment file titles from links to plain
	text when editing
- get rid of the single artefact block title links for html exports
---------------------------------------------------------
Add fixes:
- blocks that have set types but no artefacts attached don't have modal links
- pdf block is now using block header and comment count is loaded
- block headers are above titles
- tagged journals have icons when in full and matches recent posts styling
- deleting all comments produces correct icon on block header
- html exports should not hang on opening modal
- get rid of warning error re: dock.show() when redirecting from &modal=1 style url
- code review fixes for all previous patches + fix issue with folders block
- added in viewdetailsfilter.json.php file to save details mode to user account prefs table
- make the details btn mode "sticky" so it stays the save value over multiple pages etc...
- Image Gallery blocks: if displaying a folder of images will get the bar block header and
will have a the fancy box image preview displaying on image click

Change-Id: I425cc5a634e176d580aacdb60a20f869f7cb7496
Signed-off-by: default avatarLisa Seeto <lisaseeto@catalyst.net.nz>
parent f8d9ec0a
......@@ -16,6 +16,10 @@ class PluginBlocktypeAnnotation extends MaharaCoreBlocktype {
return false;
}
public static function single_artefact_per_block() {
return false;
}
public static function get_title() {
return get_string('title', 'blocktype.annotation/annotation');
}
......
......@@ -17,6 +17,11 @@ class PluginBlocktypeBlogpost extends MaharaCoreBlocktype {
return get_string('title', 'blocktype.blog/blogpost');
}
//The block only allows one artefact
public static function single_artefact_per_block() {
return true;
}
/**
* Optional method. If exists, allows this class to decide the title for
* all blockinstances of this type
......@@ -47,7 +52,6 @@ class PluginBlocktypeBlogpost extends MaharaCoreBlocktype {
if ($artefactid) {
require_once(get_config('docroot') . 'artefact/lib.php');
$artefact = $instance->get_artefact_instance($artefactid);
$smarty->assign('artefactid', $artefactid);
$configdata['hidetitle'] = true;
$configdata['countcomments'] = true;
$configdata['viewid'] = $instance->get('view');
......@@ -57,14 +61,7 @@ class PluginBlocktypeBlogpost extends MaharaCoreBlocktype {
$result = $result['html'];
require_once(get_config('docroot') . 'artefact/comment/lib.php');
require_once(get_config('docroot') . 'lib/view.php');
$view = new View($configdata['viewid']);
list($commentcount, $comments) = ArtefactTypeComment::get_artefact_comments_for_view($artefact, $view, $instance->get('id'), true, $editing, $versioning);
$smarty->assign('commentcount', $commentcount);
$smarty->assign('allowcomments', $artefact->get('allowcomments'));
}
$smarty->assign('editing', $editing);
$smarty->assign('blockid', $instance->get('id'));
$smarty->assign('html', $result);
return $smarty->fetch('blocktype:blogpost:blogpost.tpl');
}
......
......@@ -135,7 +135,7 @@ class PluginBlocktypeRecentposts extends MaharaCoreBlocktype {
$smarty->assign('blockid', $instance->get('id'));
$smarty->assign('editing', $editing);
$smarty->assign('licensemetadata', get_config('licensemetadata') ? true : false);
$smarty->assign('canviewblog', $data->owner == $USER->get('id'));
$smarty->assign('canviewblog', $data->owner == $USER->can_view_artefact($blog));
if ($editing) {
// Get id and title of configued blogs
......
......@@ -21,6 +21,10 @@ class PluginBlocktypeComment extends MaharaCoreBlocktype {
return true;
}
public static function single_artefact_per_block() {
return false;
}
public static function get_title() {
return get_string('title', 'blocktype.comment/comment');
......
......@@ -1055,7 +1055,7 @@ class ArtefactTypeComment extends ArtefactType {
);
}
public static function delete_comment_form($id, $blockid=null, $artefactid=null, $threaded=null) {
public static function delete_comment_form($id, $blockid=null, $artefactid=null, $threaded=false) {
global $THEME;
$form = array(
......
......@@ -44,6 +44,7 @@ class PluginBlocktypeFolder extends MaharaCoreBlocktype {
$configdata['viewid'] = $instance->get('view');
$configdata['simpledisplay'] = true;
$configdata['blockid'] = $instance->get('id');
$configdata['editing'] = $editing;
// This can be either an image or profileicon. They both implement
// render_self
......
......@@ -19,6 +19,14 @@ class PluginBlocktypeGallery extends MaharaCoreBlocktype {
return get_string('title', 'blocktype.file/gallery');
}
/** When the Image Gallery is displayed from a folder it will have a single
** artefact and warrant a details block header. No header will display if
** individual images (with multiple artefacts) were selected instead.
**/
public static function single_artefact_per_block() {
return true;
}
public static function get_description() {
return get_string('description1', 'blocktype.file/gallery');
}
......@@ -396,6 +404,7 @@ class PluginBlocktypeGallery extends MaharaCoreBlocktype {
}
$images[] = array(
'id' => $image->get('id'),
'link' => $link,
'source' => $src,
'height' => $height,
......@@ -409,15 +418,12 @@ class PluginBlocktypeGallery extends MaharaCoreBlocktype {
}
$smarty = smarty_core();
$smarty->assign('instanceid', $instance->get('id'));
if (isset($configdata['artefactid'])) {
$smarty->assign('artefactid', $configdata['artefactid']);
}
$smarty->assign('count', count($images));
$smarty->assign('images', $images);
$smarty->assign('showdescription', (!empty($configdata['showdescription'])) ? $configdata['showdescription'] : false);
$smarty->assign('width', $width);
$smarty->assign('editing', $editing);
$smarty->assign('blockid', $instance->get('id'));
if (isset($height)) {
$smarty->assign('height', $height);
}
......
......@@ -25,6 +25,10 @@ class PluginBlocktypeHtml extends MaharaCoreBlocktype {
return array('fileimagevideo' => 9000);
}
public static function single_artefact_per_block() {
return true;
}
public static function render_instance(BlockInstance $instance, $editing=false, $versioning=false) {
$configdata = $instance->get('configdata'); // this will make sure to unserialize it for us
$configdata['viewid'] = $instance->get('view');
......
......@@ -32,6 +32,10 @@ class PluginBlocktypeImage extends MaharaCoreBlocktype {
return array('shortcut' => 2000);
}
public static function single_artefact_per_block() {
return true;
}
public static function render_instance(BlockInstance $instance, $editing=false, $versioning=false) {
$configdata = $instance->get('configdata'); // this will make sure to unserialize it for us
......
......@@ -26,6 +26,10 @@ class PluginBlocktypeInternalmedia extends MaharaCoreBlocktype {
return get_string('title', 'blocktype.file/internalmedia');
}
public static function single_artefact_per_block() {
return true;
}
public static function get_description() {
return get_string('description', 'blocktype.file/internalmedia');
}
......@@ -68,9 +72,7 @@ class PluginBlocktypeInternalmedia extends MaharaCoreBlocktype {
list($commentcount, $comments) = ArtefactTypeComment::get_artefact_comments_for_view($artefact, $view, $instance->get('id'), true, $editing, $versioning);
$smarty->assign('commentcount', $commentcount);
$smarty->assign('comments', $comments);
$blockheader = $smarty->fetch('header/block-comments-details-header.tpl');
$result = $blockheader;
$result .= '<div class="mediaplayer-container card-body flush"><div class="mediaplayer">';
$result = '<div class="mediaplayer-container card-body flush"><div class="mediaplayer">';
$result .= call_static_method($playerclass, 'get_html', $artefact, $instance, $width, $height);
$result .= '</div></div>';
......
......@@ -17,6 +17,10 @@ class PluginBlocktypePdf extends MaharaCoreBlocktype {
return false;
}
public static function single_artefact_per_block() {
return true;
}
public static function get_title() {
return get_string('title', 'blocktype.file/pdf');
}
......@@ -81,12 +85,16 @@ class PluginBlocktypePdf extends MaharaCoreBlocktype {
require_once(get_config('docroot') . 'lib/view.php');
$view = new View($configdata['viewid']);
list($commentcount, $comments) = ArtefactTypeComment::get_artefact_comments_for_view($artefact, $view, $instance->get('id'), true, $editing, $versioning);
}
$smarty = smarty_core();
if ($artefactid) {
$smarty->assign('artefactid', $artefactid);
$artefact = $instance->get_artefact_instance($configdata['artefactid']);
$smarty->assign('allowcomments', $artefact->get('allowcomments'));
if ($commentcount) {
$smarty->assign('commentcount', $commentcount);
}
}
$smarty->assign('html', $result);
$smarty->assign('editing', $editing);
......
......@@ -2170,6 +2170,9 @@ class ArtefactTypeFolder extends ArtefactTypeFileBase {
$smarty->assign('simpledisplay', isset($options['simpledisplay']) ? $options['simpledisplay'] : false);
$smarty->assign('folderid', $this->get('id'));
$smarty->assign('downloadfolderzip', get_config_plugin('blocktype', 'folder', 'folderdownloadzip') ? !empty($options['folderdownloadzip']) : false);
if (isset($options['editing'])) {
$smarty->assign('editing', $options['editing']);
}
$childrecords = false;
if (!empty($options['existing_artefacts'])) {
......@@ -2180,6 +2183,7 @@ class ArtefactTypeFolder extends ArtefactTypeFileBase {
}
if ($childrecords) {
safe_require('artefact', 'comment');
$sortorder = (isset($options['sortorder']) && $options['sortorder'] == 'desc') ? 'my_files_cmp_desc' : 'my_files_cmp';
usort($childrecords, array('ArtefactTypeFileBase', $sortorder));
$children = array();
......@@ -2188,6 +2192,13 @@ class ArtefactTypeFolder extends ArtefactTypeFileBase {
$child->title = $child->hovertitle = $c->get('title');
$child->date = format_date(strtotime($child->mtime), 'strftimedaydatetime');
$child->iconsrc = call_static_method(generate_artefact_class_name($child->artefacttype), 'get_icon', array('id' => $child->id, 'viewid' => isset($options['viewid']) ? $options['viewid'] : 0));
$count = ArtefactTypeComment::count_comments(null, array($child->id));
if ($count) {
$child->commentcount = $count[$child->id]->comments;
}
else {
$child->commentcount = 0;
}
}
$smarty->assign('children', $childrecords);
}
......
......@@ -29,6 +29,10 @@ class PluginBlocktypeTextbox extends MaharaCoreBlocktype {
return true;
}
public static function single_artefact_per_block() {
return true;
}
public static function render_instance(BlockInstance $instance, $editing=false, $versioning=false) {
$configdata = $instance->get('configdata');
if (!empty($configdata['artefactid'])) {
......@@ -69,6 +73,7 @@ class PluginBlocktypeTextbox extends MaharaCoreBlocktype {
$smarty->assign('license', (int)get_config('licensemetadata'));
$smarty->assign('blockid', $instance->get('id'));
$smarty->assign('artefactid', $artefact->get('id'));
$smarty->assign('editing', $editing);
return $smarty->fetch('blocktype:textbox:content.tpl');
}
......
......@@ -21,6 +21,10 @@ class PluginBlocktypePeerassessment extends MaharaCoreBlocktype {
return false;
}
public static function single_artefact_per_block() {
return false;
}
public static function get_title() {
return get_string('title', 'blocktype.peerassessment/peerassessment');
......
......@@ -25,6 +25,10 @@ class PluginBlocktypeSignoff extends MaharaCoreBlocktype {
return true;
}
public static function single_artefact_per_block() {
return false;
}
public static function get_title() {
return get_string('title', 'blocktype.peerassessment/signoff');
......
......@@ -32,6 +32,10 @@ class PluginBlocktypeEntireresume extends MaharaCoreBlocktype {
public static function render_instance(BlockInstance $instance, $editing=false, $versioning=false) {
require_once(get_config('docroot') . 'artefact/lib.php');
$smarty = smarty_core();
$configdata = $instance->get('configdata');
$configdata['showcommentcount'] = true;
$configdata['viewid'] = $instance->get('view');
$configdata['editing'] = $editing;
// Get data about the resume fields the user has
if ($artefacts = get_records_sql_array('
SELECT va.artefact, a.artefacttype
......@@ -41,7 +45,7 @@ class PluginBlocktypeEntireresume extends MaharaCoreBlocktype {
AND va.block = ?', array($instance->get('view'), $instance->get('id')))) {
foreach ($artefacts as $artefact) {
$resumefield = $instance->get_artefact_instance($artefact->artefact);
$rendered = $resumefield->render_self(array('viewid' => $instance->get('view')));
$rendered = $resumefield->render_self($configdata);
$result = $rendered['html'];
if (!empty($rendered['javascript'])) {
$result .= '<script>' . $rendered['javascript'] . '</script>';
......
......@@ -47,6 +47,9 @@ class PluginBlocktypeResumefield extends MaharaCoreBlocktype {
$smarty = smarty_core();
$configdata = $instance->get('configdata');
$configdata['viewid'] = $instance->get('view');
$configdata['showcommentcount'] = true;
$configdata['editing'] = $editing;
$configdata['blockid'] = $instance->get('id');
// Get data about the resume field in this blockinstance
if (!empty($configdata['artefactid'])) {
......
......@@ -879,6 +879,14 @@ abstract class ArtefactTypeResumeComposite extends ArtefactTypeResume implements
$smarty->assign('artefactid', $options['artefactid']);
}
if (!empty($options['editing'])) {
$smarty->assign('editing', $options['editing']);
}
if (!empty($options['blockid'])) {
$smarty->assign('blockid', $options['blockid']);
}
if (!$data = get_records_sql_array($sql, array($owner, $type))) {
$data = array();
}
......@@ -901,6 +909,7 @@ abstract class ArtefactTypeResumeComposite extends ArtefactTypeResume implements
ORDER BY a.title';
$attachments = get_records_sql_array($sql, array($record->artefact, $record->id));
if ($attachments) {
safe_require('artefact', 'comment');
foreach ($attachments as &$attachment) {
$f = artefact_instance_from_id($attachment->id);
$attachment->size = $f->describe_size();
......@@ -908,6 +917,16 @@ abstract class ArtefactTypeResumeComposite extends ArtefactTypeResume implements
$attachment->artefacttype = $f->get_artefact_type($attachment->id);
$attachment->downloadpath = get_config('wwwroot') . 'artefact/file/download.php?file=' . $attachment->id;
$attachment->description = $f->description;
$attachment->allowcomments = $f->get('allowcomments');
if (!empty($options['showcommentcount'])) {
$count = ArtefactTypeComment::count_comments(null, array($attachment->id));
if ($count) {
$attachment->commentcount = $count[$attachment->id]->comments;
}
else {
$attachment->commentcount = 0;
}
}
}
}
$record->attachments = $attachments;
......@@ -1988,15 +2007,29 @@ class ArtefactTypeResumeGoalAndSkill extends ArtefactTypeResume {
if (!empty($options['artefactid'])) {
$smarty->assign('artefactid', $options['artefactid']);
}
if (!empty($options['editing'])) {
$smarty->assign('editing', $options['editing']);
}
$attachments = $this->get_attachments();
if ($attachments) {
safe_require('artefact', 'comment');
foreach ($attachments as &$attachment) {
$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->downloadpath = get_config('wwwroot') . 'artefact/file/download.php?file=' . $attachment->id;
$attachment->description = $f->description;
$attachment->allowcomments = $f->get('allowcomments');
if (!empty($options['showcommentcount'])) {
$count = ArtefactTypeComment::count_comments(null, array($attachment->id));
if ($count) {
$attachment->commentcount = $count[$attachment->id]->comments;
}
else {
$attachment->commentcount = 0;
}
}
}
$smarty->assign('attachments', $attachments);
$smarty->assign('count', count($attachments));
......
......@@ -23,6 +23,10 @@ class PluginBlocktypeCreativecommons extends MaharaCoreBlocktype {
return true;
}
public static function single_artefact_per_block() {
return false;
}
public static function get_title() {
return get_string('title', 'blocktype.creativecommons');
}
......
......@@ -31,6 +31,10 @@ class PluginBlocktypeGroupInfo extends MaharaCoreBlocktype {
return true;
}
public static function single_artefact_per_block() {
return false;
}
public static function get_categories() {
return array('general' => 16000);
}
......
......@@ -28,6 +28,10 @@ class PluginBlocktypeGroupMembers extends MaharaCoreBlocktype {
return true;
}
public static function single_artefact_per_block() {
return false;
}
public static function get_categories () {
return array('general' => 17000);
}
......
......@@ -31,6 +31,10 @@ class PluginBlocktypeGroupViews extends MaharaCoreBlocktype {
return true;
}
public static function single_artefact_per_block() {
return false;
}
public static function get_categories() {
return array('general' => 18000);
}
......
......@@ -279,6 +279,16 @@ EOF;
return false;
}
/**
* override this to return true if the blocktype
* can only contain one artefact per block.
* example: Journal block can have multiple artefact so return false.
* example: Image block has one image per block so return true.
*/
public static function single_artefact_per_block() {
return false;
}
/**
* Indicates whether this block can be loaded by Ajax after the page is done. This
* improves page-load times by allowing blocks to be rendered in parallel instead
......@@ -506,6 +516,7 @@ EOF;
'title' => call_static_method($classname, 'get_title'),
'description' => call_static_method($classname, 'get_description'),
'singleonly' => call_static_method($classname, 'single_only'),
'single_artefact_per_block' => call_static_method($classname, 'single_artefact_per_block'),
'artefactplugin' => $bt->artefactplugin,
'thumbnail_path' => get_config('wwwroot') . 'thumb.php?type=blocktype&bt=' . $bt->name . ((!empty($bt->artefactplugin)) ? '&ap=' . $bt->artefactplugin : ''),
'cssicon' => call_static_method($classname, 'get_css_icon', $bt->name),
......@@ -1387,15 +1398,14 @@ 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) {
// Apply comments and details block header to blocks with have one artefact per block
// Blocks with more than one artefact per block get their header via individual templates
$blockheader = call_static_method($classname, 'single_artefact_per_block', $this->blocktype);
// Set up template for the blocks that have the comments and details header
// Check also that an artefact has been attached to ensure empty blocks don't get empty modals
if ($blockheader && !empty($configdata['artefactid'])) {
$smarty->assign('blockheader', $blockheader);
if (!empty($configdata['artefactid'])) {
$smarty->assign('artefactid', $configdata['artefactid']);
$artefact = $this->get_artefact_instance($configdata['artefactid']);
......
......@@ -27,6 +27,10 @@ class PluginBlocktypeMyfriends extends MaharaCoreBlocktype {
return true;
}
public static function single_artefact_per_block() {
return false;
}
public static function get_categories() {
return array('internal' => 31000);
}
......
......@@ -25,6 +25,10 @@ class PluginBlocktypeMyGroups extends MaharaCoreBlocktype {
return true;
}
public static function single_artefact_per_block() {
return false;
}
public static function get_categories() {
return array('internal' => 32000);
}
......
......@@ -25,6 +25,10 @@ class PluginBlocktypeMyviews extends MaharaCoreBlocktype {
return true;
}
public static function single_artefact_per_block() {
return false;
}
public static function get_categories() {
return array('internal' => 33000);
}
......
......@@ -37,6 +37,10 @@ class PluginBlocktypeOpenbadgedisplayer extends SystemBlocktype {
return false;
}
public static function single_artefact_per_block() {
return false;
}
public static function get_title() {
return get_string('title', 'blocktype.openbadgedisplayer');
}
......
......@@ -30,6 +30,10 @@ class PluginBlocktypeWall extends MaharaCoreBlocktype {
return true;
}
public static function single_artefact_per_block() {
return false;
}
public static function get_categories() {
return array('internal' => 28000);
}
......
......@@ -18,6 +18,10 @@ class PluginBlocktypeWatchlist extends MaharaCoreBlocktype {
return true;
}
public static function single_artefact_per_block() {
return false;
}
public static function get_title() {
return get_string('title', 'blocktype.watchlist');
}
......
......@@ -687,8 +687,10 @@ class PluginExportHtml extends PluginExport {
$type == 'video' ||
$type == 'html' ||
$type == 'plans' ||
$type == 'file' ||
$type == 'internal' && $b->blocktype != 'profileinfo'||
$b->blocktype == 'image' ||
$b->blocktype == 'internalmedia' ||
$b->blocktype == 'filedownload'
) {
if (isset($configdata['artefactids']) && !empty($configdata['artefactids'])) {
......
......@@ -81,7 +81,13 @@ function addFeedbackSuccess(form, data) {
}
// Update the comment link so the correct number of comments is displayed
var commentlink = $('.commentlink').filter('[data-artefactid=' + data.data.artefact + ']');
var commentlink = '';
if (data.data.blockid) {
commentlink = $('.commentlink').filter("[data-blockid=" + data.data.blockid + "][data-artefactid=" + data.data.artefact + "]");
}
else {
commentlink = $('.commentlink').filter("[data-artefactid=" + data.data.artefact + "]");
}
var newlink = '<span class="icon icon-comments" role="presentation" aria-hidden="true"></span>';
if (!(commentlink.closest('div[class*=block-header]').hasClass('bh-displayiconsonly'))) {
newlink += ' ' + get_string('commentsanddetails', 'artefact.comment', data.data.count);
......@@ -92,9 +98,6 @@ function addFeedbackSuccess(form, data) {
}
commentlink.html(newlink);
//For brief comments and details previews when there is no block comments and details header
$('.comment-count-preview').filter('[data-artefactid=' + data.data.artefact + ']').html('<span class="icon icon-comments" role="presentation" aria-hidden="true"></span> (' + data.data.count + ')');
resetFeedbackReplyto();
formSuccess(form, data);
......@@ -153,26 +156,37 @@ function set_up_modal_events() {
$('#configureblock .submitcancel[name="submit"]').off('click');
$('#configureblock .submitcancel[name="submit"]').on('click', function(e) {
if (tinymce.activeEditor.getContent()) {
tinymce.EditorManager.execCommand('mceRemoveEditor', true, modal_textarea_id);
if (tinymce.activeEditor.getContent() !== '') {
dock.hide();
}
$("#configureblock input:file").each(function() {
var element = $(this);
if (element.val() != '') {
// Found at least one attachment
if (tinymce.activeEditor.getContent()) {
tinymce.EditorManager.execCommand('mceRemoveEditor', true, modal_textarea_id);
$('#configureblock').find('textarea.wysiwyg').each(function() {
modal_textarea_id = $(this).attr('id');
tinymce.EditorManager.execCommand('mceRemoveEditor', true, modal_textarea_id);
});
}
dock.hide();
dock.hide();
}
});
$('#configureblock').find('textarea.wysiwyg').each(function() {
modal_textarea_id = $(this).attr('id');
tinymce.EditorManager.execCommand('mceRemoveEditor', true, modal_textarea_id);
});
});
$('#configureblock .submitcancel[name="cancel_submit"]').off('click');
$('#configureblock .submitcancel[name="cancel_submit"]').on('click', function(e) {
tinymce.EditorManager.execCommand('mceRemoveEditor', true, modal_textarea_id);
if (tinymce.activeEditor.getContent()) {
$('#configureblock').find('textarea.wysiwyg').each(function() {
modal_textarea_id = $(this).attr('id');
tinymce.EditorManager.execCommand('mceRemoveEditor', true, modal_textarea_id);
});
}
e.stopPropagation();
e.preventDefault();
dock.hide();
......@@ -190,7 +204,6 @@ function open_modal(e) {
$('#modal_messages').html('').removeClass();
var block = $('#configureblock');
dock.show(block, false, false);
var params = {
'viewid': viewid,
......@@ -206,9 +219,11 @@ function open_modal(e) {
$('.blockinstance-content').html(data.html);
set_up_modal_events();
dock.show(block, false, true);
$('.feedbacktable .list-group-lite').addClass('fullwidth');
$('.feedbacktable').on('click', '.js-reply', null, function(e){
// $('.feedbacktable .list-group-lite').addClass('fullwidth');
$(block).find('.feedbacktable .list-group-lite').addClass('fullwidth');
$(block).find('.feedbacktable').on('click', '.js-reply', null, function(e){
var replybutton = $(this);
e.preventDefault();
setupCommentButton(replybutton);
......@@ -220,23 +235,24 @@ function open_modal(e) {
}
function delete_comment_from_modal_submit(form, data) {
if (!data.data.artefact) {
paginator.updateResults(data);
paginator.alertProxy('pagechanged', data);
}
var params = {
'viewid': viewid,
'artefactid': data.data['artefact'],
'blockid': data.data['blockid'],
}
if (!data.data['artefact']) {
params['artefactid'] = form.artefactid.value;
}
tinymce.EditorManager.execCommand('mceRemoveEditor',true, $('#configureblock').find('textarea.wysiwyg').attr('id'));
sendjsonrequest(config['wwwroot'] + 'view/viewblocks.json.php', params, 'POST', function(data) {
$('#configureblock').find('h4').text(data.title);
$('.blockinstance-content').html(data.html);
set_up_modal_events();
if (!data.data.artefact) {
paginator.updateResults(data);
paginator.alertProxy('pagechanged', data);
}
var params = {
'viewid': viewid,
'artefactid': data.data['artefact'],
'blockid': data.data['blockid'],
}