Commit 8ceb68d3 authored by Robert Lyon's avatar Robert Lyon
Browse files

Bug 1632865: Changing how we display annotation feedback



Changing it to how we show artefact feedback

behatnotneeded

Change-Id: I31090e7dd3c616687f7b00cd281e523e993e0479
Signed-off-by: default avatarRobert Lyon <robertl@catalyst.net.nz>
parent eb8fcedf
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -71,7 +71,10 @@ function modifyAnnotationFeedbackSuccess(form, data) {
                initTinyMCE(formname);
            })(jQuery);
    });

    // if we are in a modal close it
    if (jQuery('#annotation_feedbacktable_' + $(formname + '_blockid').value).hasClass('modal-docked')) {
        dock.hide();
    }
    formSuccess(form, data);
}

+1 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@ $string['Annotations'] = 'Annotations';
$string['annotation'] = 'annotation';
$string['annotations'] = 'annotations';
$string['Annotationfeedback'] = 'Feedback';
$string['annotationfeedback'] = 'feedback';
$string['typeannotationfeedback'] = 'Feedback on annotations';
$string['allowannotationfeedback'] = 'Allow feedback';
$string['approvalrequired'] = 'Feedback is moderated. If you choose to make this feedback public, it will not be visible to others until it is approved by the owner.';
+10 −3
Original line number Diff line number Diff line
@@ -590,7 +590,7 @@ class ArtefactTypeAnnotationfeedback extends ArtefactType {
     */
    public static function get_annotation_feedback_options() {
        $options = new stdClass();
        $options->limit = 10;
        $options->limit = 0;
        $options->offset = 0;
        $options->showcomment = null;

@@ -796,6 +796,9 @@ class ArtefactTypeAnnotationfeedback extends ArtefactType {
                    if (!$is_export_preview) {
                        $item->makepublicform = pieform(self::make_annotation_feedback_public_form($data->annotation, $data->view, $data->artefact, $data->block, $item->id));
                    }
                    else {
                        $item->highlight = 1;
                    }
                }
                else if ($item->isauthor && $item->requestpublic == 'author'
                         || $data->isowner && $item->requestpublic == 'owner') {
@@ -874,8 +877,8 @@ class ArtefactTypeAnnotationfeedback extends ArtefactType {
            'limit' => $data->limit,
            'offset' => $data->offset,
            'forceoffset' => isset($data->forceoffset) ? $data->forceoffset : null,
            'resultcounttextsingular' => get_string('annotation', 'artefact.annotation'),
            'resultcounttextplural' => get_string('annotations', 'artefact.annotation'),
            'resultcounttextsingular' => get_string('annotationfeedback', 'artefact.annotation'),
            'resultcounttextplural' => get_string('annotationfeedback', 'artefact.annotation'),
            'extradata' => $extradata,
        ));
        $data->pagination = $pagination['html'];
@@ -1091,7 +1094,11 @@ class ArtefactTypeAnnotationfeedback extends ArtefactType {
                // The user has switched off annotation feedback. Don't create the add annotation feedback form.
                $smarty->assign('addannotationfeedbackform', null);
            }
            safe_require('blocktype', 'annotation');
            $block = new BlockInstance($blockid);

            $smarty->assign('blockid', $blockid);
            $smarty->assign('annotationtitle', $block->get('title'));
            $smarty->assign('annotationfeedbackcount', $annotationfeedbackcount);
            $smarty->assign('annotationfeedback', $annotationfeedback);
            $smarty->assign('editing', $editing);
+48 −28
Original line number Diff line number Diff line
{if !$editing}
    <div id="annotationfeedbackview_{$blockid}" class="annotation-feedback">
        {if $annotationfeedback != 0}
            <ul id="annotationfeedbacktable_{$blockid}"class="annotationfeedbacktable flush list-group list-group-lite list-unstyled">
                {$annotationfeedback->tablerows|safe}
            </ul>
            {$annotationfeedback->pagination|safe}
        {if $annotationfeedbackcount > 0}
            <a class="commentlink link-blocktype" id="block_{$blockid}" data-toggle="modal-docked" data-target="#annotation_feedbacktable_{$blockid}" href="#">
                <span class="icon icon-comments" role="presentation" aria-hidden="true"></span>
                {str tag=Annotationfeedback section=artefact.annotation} ({$annotationfeedbackcount})
            </a>
        {/if}
        {if $allowfeedback}
        <div class="annotationfeedback">
            <a id="feedback_{$blockid}" class="placeannotationfeedback link-blocktype last" data-toggle="modal-docked" data-target="#annotation_feedback_{$blockid}" href="#">
                <span class="icon icon-plus" role="presentation" aria-hidden="true"></span>
            <a id="feedback_{$blockid}" class="placeannotationfeedback link-blocktype last" data-toggle="modal-docked" data-target="#annotation_feedbackform_{$blockid}" href="#">
                <span class="icon icon-arrow-circle-right" role="presentation" aria-hidden="true"></span>
                {str tag=placeannotationfeedback section=artefact.annotation}
            </a>
        </div>
        {/if}
        <div id="annotation_feedback_{$blockid}" class="feedbacktable modal modal-docked">
    </div>
    <!-- modal for the feedback -->
    <div class="feedback modal modal-docked" id="annotation_feedbacktable_{$blockid}">
        <div class="modal-dialog modal-lg">
            <div class="modal-content">
                <div class="modal-header clearfix">
                    <button class="deletebutton close" data-dismiss="modal-docked">
                        <span class="times">&times;</span>
                        <span class="sr-only">{str tag=Close}</span>
                    </button>
                    <h4 class="modal-title pull-left">
                        <span class="icon icon-lg icon-comments left" role="presentation" aria-hidden="true"></span>
                        {str tag=Annotationfeedback section=artefact.annotation} - {$annotationtitle}
                    </h4>
                </div>
                <div class="modal-body flush">
                    {$annotationfeedback->tablerows|safe}
                </div>
            </div>
        </div>
    </div>
    <!-- modal for the feedback form -->
    <div id="annotation_feedbackform_{$blockid}" class="feedbacktable modal modal-docked">
        <div class="modal-dialog modal-lg">
            <div class="modal-content">
                <div class="modal-header">
@@ -37,5 +57,5 @@
            </div>
        </div>
    </div>
    </div>

{/if}
+1 −1
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@
        </h5>
        <div class="btn-group btn-group-top comment-item-buttons">
            {if $item->canedit}
            <a href="{$WWWROOT}artefact/annotation/edit.php?id={$item->id}&amp;viewid={$viewid}" class="btn btn-default btn-group-item form-as-button pull-left">
            <a href="{$WWWROOT}artefact/annotation/edit.php?id={$item->id}&amp;viewid={$viewid}" class="btn btn-default btn-sm">
                <span class="icon icon-lg icon-pencil text-default" role="presentation" aria-hidden="true"></span>
                <span class="sr-only">{str tag=edit}</span>
            </a>
Loading