Commit ff2bee5b authored by Robert Lyon's avatar Robert Lyon
Browse files

Bug 1620119: Fix for the brokenness in annotation feedback list



Things fixed here:

1) The floating in space button for first feedback entry
2) The poor alignment for the annotation edit + delete buttons combo
3) Allowing an admin to delete their own feedback on their own
annotation

behatnotneeded

Change-Id: I829280d89ca0020b2895120124ac59507285bf71
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
(cherry picked from commit 5f70a878)
parent 6c09a349
......@@ -818,7 +818,8 @@ class ArtefactTypeAnnotationfeedback extends ArtefactType {
if ($item->deletedby) {
$item->deletedmessage = $deletedmessage[$item->deletedby];
}
else if (($candelete || $item->isauthor) && !$is_export_preview && !$isadminfeedback) {
else if (($candelete || $item->isauthor) && !$is_export_preview &&
(!$isadminfeedback || ($isadminfeedback && ($data->owner === $item->author)))) {
// If the auther was admin/staff and not the owner of the annotation,
// the feedback can't be deleted.
$item->deleteform = pieform(self::delete_annotation_feedback_form($data->annotation, $data->view, $data->artefact, $data->block, $item->id));
......@@ -1377,6 +1378,7 @@ class ArtefactTypeAnnotationfeedback extends ArtefactType {
'renderer' => 'oneline',
'plugintype' => 'artefact',
'pluginname' => 'annotation',
'class' => 'form-as-button pull-left delete-comment btn-group-item',
'jsform' => true,
'successcallback' => 'delete_annotation_feedback_submit',
'jssuccesscallback' => 'modifyAnnotationFeedbackSuccess',
......@@ -1389,7 +1391,7 @@ class ArtefactTypeAnnotationfeedback extends ArtefactType {
'submit' => array(
'type' => 'button',
'usebuttontag' => true,
'class' => 'btn-default',
'class' => 'btn-default btn-sm',
'value' => '<span class="icon icon-trash text-danger" role="presentation" aria-hidden="true"></span><span class="sr-only">' . get_string('delete') . '</span>',
'elementtitle' => get_string('delete'),
'confirm' => get_string('reallydeletethisannotationfeedback', 'artefact.annotation'),
......
......@@ -26,16 +26,16 @@
{/if}
</span>
</h5>
<div class="btn-group btn-group-top">
{if $item->deleteform}
{$item->deleteform|safe}
{/if}
<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 pull-left">
<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">
<span class="icon icon-lg icon-pencil text-default" role="presentation" aria-hidden="true"></span>
<span class="sr-only">{str tag=edit}</span>
</a>
{/if}
{if $item->deleteform}
{$item->deleteform|safe}
{/if}
</div>
</div>
......
......@@ -273,6 +273,10 @@ h4.list-group-item-heading {
}
}
.annotation-feedback .list-group .list-group-item {
border-top: 1px solid #ddd !important;
}
.column-list {
-moz-column-count: 3;
-moz-column-gap: 20px;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment