1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-22 14:52:41 +01:00

Make Phriction diff-of-changes view draft-aware and clarify some language

Summary:
Ref T13077. Ref T13197. See PHI840.

  - In the "History > Diff/Compare" view, the button language wasn't draft-aware.
  - Revise language to avoid the word "Revert", since this can be ambiguous.
    - "Edit this page, starting with an older version of the text" is now "Edit Older|Current|Draft Version X".
    - "Mark this older version of the page as the current published version" is now "Publish Older Version".
  - Let the user edit the current published version, too, since this is a reasonable operation if there are drafts.

Test Plan: Navigated the history diff view, saw better button and action text.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13197, T13077

Differential Revision: https://secure.phabricator.com/D19668
This commit is contained in:
epriestley 2018-09-13 08:13:41 -07:00
parent 0089ef4b60
commit 0abf29765e
3 changed files with 11 additions and 13 deletions

View file

@ -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) {

View file

@ -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

View file

@ -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?');