diff --git a/include/class.thread_actions.php b/include/class.thread_actions.php index 30ddc810c056e7edfee8949820f4f2665d9501a3..15758498fdabb968929300fded2c0402f3af7610 100644 --- a/include/class.thread_actions.php +++ b/include/class.thread_actions.php @@ -155,6 +155,8 @@ JS ) { // Replace previous edit -------------------------- $original = $old->getParent(); + // Link the new entry to the old id + $entry->pid = $old->pid; // Drop the previous edit, and base this edit off the original $old->delete(); $old = $original; @@ -221,9 +223,11 @@ class TEA_OrigThreadEntry extends ThreadEntryAction { } private function trigger__get() { - $entry = $this->entry->getParent(); - if (!$entry) + global $thisstaff; + + if (!$this->entry->getParent()) Http::response(404, 'No history for this entry'); + $entry = $this->entry; include STAFFINC_DIR . 'templates/thread-entry-view.tmpl.php'; } } diff --git a/include/staff/templates/thread-entries.tmpl.php b/include/staff/templates/thread-entries.tmpl.php index be49ed35f6296a097e5cba20968737d5f81b6aef..2e7da2c389cf2b276b139a5573e040fb0e6590a9 100644 --- a/include/staff/templates/thread-entries.tmpl.php +++ b/include/staff/templates/thread-entries.tmpl.php @@ -35,7 +35,13 @@ if ($entries) { </div> <?php } ?> <span style="vertical-align:middle"> - <span style="vertical-align:middle;" class="textra"></span> + <span style="vertical-align:middle;" class="textra"> + <?php if ($entry->flags & ThreadEntry::FLAG_EDITED) { ?> + <span class="label label-bare" title="<?php + echo sprintf(__('Edited on %s by %s'), Format::datetime($entry->updated), 'You'); + ?>"><?php echo __('Edited'); ?></span> + <?php } ?> + </span> <span style="vertical-align:middle;" class="tmeta faded title"><?php echo Format::htmlchars($entry->getName()); ?></span> diff --git a/include/staff/templates/thread-entry-view.tmpl.php b/include/staff/templates/thread-entry-view.tmpl.php index 2b76d851f3611a89e452492117593ebf17203b37..29f098ca1bf24e95618d070e39572c872b801f78 100644 --- a/include/staff/templates/thread-entry-view.tmpl.php +++ b/include/staff/templates/thread-entry-view.tmpl.php @@ -6,7 +6,21 @@ <?php $E = $entry; -do { ?> +$i = 0; +$omniscient = $thisstaff->getRole()->hasPerm(ThreadEntry::PERM_EDIT); +do { + $i++; + if (!$omniscient + // The current version is always visible + && $i > 1 + // If you originally posted it, you can see all the edits + && $E->staff_id != $thisstaff->getId() + // You can see your own edits + // && $E->editor != $thisstaff->getId() + ) { + // Skip edits made by other agents + continue; + } ?> <dt> <a href="#"><i class="icon-copy"></i> <strong><?php if ($E->title) @@ -48,11 +62,13 @@ $(function() { var allPanels = $('dd', A).hide().removeClass('hidden'); $('dt > a', A).click(function() { - $('dt', A).removeClass('active'); - allPanels.slideUp(); - $(this).parent().addClass('active').next().slideDown(); + if (!$(this).parent().is('.active')) { + $('dt', A).removeClass('active'); + allPanels.slideUp(); + $(this).parent().addClass('active').next().slideDown(); + } return false; }); - allPanels.last().show(); + allPanels.last().show().prev().addClass('active'); }, 100); }); diff --git a/scp/css/scp.css b/scp/css/scp.css index 59312e8b80e8c25dc2b9c3d960c6afd4e75cb834..855dd8a03507f40107faebe69e157f1708b0e126 100644 --- a/scp/css/scp.css +++ b/scp/css/scp.css @@ -2165,6 +2165,7 @@ td.indented { } .accordian dt.active a { color: #184E81; + text-decoration: none; } .accordian dt:not(.active) a i { display: none;