diff --git a/src/applications/phriction/controller/PhrictionDiffController.php b/src/applications/phriction/controller/PhrictionDiffController.php index c81a90a3df..537f743eba 100644 --- a/src/applications/phriction/controller/PhrictionDiffController.php +++ b/src/applications/phriction/controller/PhrictionDiffController.php @@ -95,7 +95,7 @@ final class PhrictionDiffController extends PhrictionController { $navigation_table = null; if ($l + 1 == $r) { $nav_l = ($l > 1); - $nav_r = ($r != $current->getVersion()); + $nav_r = ($r != $document->getMaxVersion()); $uri = $request->getRequestURI(); @@ -191,30 +191,28 @@ final class PhrictionDiffController extends PhrictionController { PhrictionChangeType::CHANGE_MOVE_AWAY => true, // Plain silly PhrictionChangeType::CHANGE_STUB => true, // Utterly silly ); + if (isset($hidden_statuses[$content->getChangeType()])) { // Don't show an edit/revert button for changes which deleted, moved or // stubbed the content since it's silly. return null; } - if ($content->getID() == $current->getID()) { - return phutil_tag( - 'a', - array( - 'href' => '/phriction/edit/'.$document_id.'/', - 'class' => 'button button-grey', - ), - pht('Edit Current Version')); + if ($version == $current->getVersion()) { + $label = pht('Edit Current Version %s...', new PhutilNumber($version)); + } else if ($version < $current->getVersion()) { + $label = pht('Edit Older Version %s...', new PhutilNumber($version)); + } else { + $label = pht('Edit Draft Version %s...', new PhutilNumber($version)); } - return phutil_tag( 'a', array( 'href' => '/phriction/edit/'.$document_id.'/?revert='.$version, 'class' => 'button button-grey', ), - pht('Revert to Version %s...', $version)); + $label); } private function renderComparisonTable(array $content) { diff --git a/src/applications/phriction/controller/PhrictionDocumentController.php b/src/applications/phriction/controller/PhrictionDocumentController.php index 1853dd1ee1..77f6a3529c 100644 --- a/src/applications/phriction/controller/PhrictionDocumentController.php +++ b/src/applications/phriction/controller/PhrictionDocumentController.php @@ -476,7 +476,7 @@ final class PhrictionDocumentController if ($is_draft) { $publish_name = pht('Publish Draft'); } else { - $publish_name = pht('Publish Revert'); + $publish_name = pht('Publish Older Version'); } // If you're looking at the current version; and it's an unpublished diff --git a/src/applications/phriction/controller/PhrictionPublishController.php b/src/applications/phriction/controller/PhrictionPublishController.php index 43c90cb1fa..e24b5f9be0 100644 --- a/src/applications/phriction/controller/PhrictionPublishController.php +++ b/src/applications/phriction/controller/PhrictionPublishController.php @@ -63,7 +63,7 @@ final class PhrictionPublishController } if ($content->getVersion() < $document->getContent()->getVersion()) { - $title = pht('Revert Document?'); + $title = pht('Publish Older Version?'); $body = pht( 'Revert the published version of this document to an older '. 'version?');