mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-26 16: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:
parent
0089ef4b60
commit
0abf29765e
3 changed files with 11 additions and 13 deletions
|
@ -95,7 +95,7 @@ final class PhrictionDiffController extends PhrictionController {
|
||||||
$navigation_table = null;
|
$navigation_table = null;
|
||||||
if ($l + 1 == $r) {
|
if ($l + 1 == $r) {
|
||||||
$nav_l = ($l > 1);
|
$nav_l = ($l > 1);
|
||||||
$nav_r = ($r != $current->getVersion());
|
$nav_r = ($r != $document->getMaxVersion());
|
||||||
|
|
||||||
$uri = $request->getRequestURI();
|
$uri = $request->getRequestURI();
|
||||||
|
|
||||||
|
@ -191,30 +191,28 @@ final class PhrictionDiffController extends PhrictionController {
|
||||||
PhrictionChangeType::CHANGE_MOVE_AWAY => true, // Plain silly
|
PhrictionChangeType::CHANGE_MOVE_AWAY => true, // Plain silly
|
||||||
PhrictionChangeType::CHANGE_STUB => true, // Utterly silly
|
PhrictionChangeType::CHANGE_STUB => true, // Utterly silly
|
||||||
);
|
);
|
||||||
|
|
||||||
if (isset($hidden_statuses[$content->getChangeType()])) {
|
if (isset($hidden_statuses[$content->getChangeType()])) {
|
||||||
// Don't show an edit/revert button for changes which deleted, moved or
|
// Don't show an edit/revert button for changes which deleted, moved or
|
||||||
// stubbed the content since it's silly.
|
// stubbed the content since it's silly.
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($content->getID() == $current->getID()) {
|
if ($version == $current->getVersion()) {
|
||||||
return phutil_tag(
|
$label = pht('Edit Current Version %s...', new PhutilNumber($version));
|
||||||
'a',
|
} else if ($version < $current->getVersion()) {
|
||||||
array(
|
$label = pht('Edit Older Version %s...', new PhutilNumber($version));
|
||||||
'href' => '/phriction/edit/'.$document_id.'/',
|
} else {
|
||||||
'class' => 'button button-grey',
|
$label = pht('Edit Draft Version %s...', new PhutilNumber($version));
|
||||||
),
|
|
||||||
pht('Edit Current Version'));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return phutil_tag(
|
return phutil_tag(
|
||||||
'a',
|
'a',
|
||||||
array(
|
array(
|
||||||
'href' => '/phriction/edit/'.$document_id.'/?revert='.$version,
|
'href' => '/phriction/edit/'.$document_id.'/?revert='.$version,
|
||||||
'class' => 'button button-grey',
|
'class' => 'button button-grey',
|
||||||
),
|
),
|
||||||
pht('Revert to Version %s...', $version));
|
$label);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function renderComparisonTable(array $content) {
|
private function renderComparisonTable(array $content) {
|
||||||
|
|
|
@ -476,7 +476,7 @@ final class PhrictionDocumentController
|
||||||
if ($is_draft) {
|
if ($is_draft) {
|
||||||
$publish_name = pht('Publish Draft');
|
$publish_name = pht('Publish Draft');
|
||||||
} else {
|
} 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
|
// If you're looking at the current version; and it's an unpublished
|
||||||
|
|
|
@ -63,7 +63,7 @@ final class PhrictionPublishController
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($content->getVersion() < $document->getContent()->getVersion()) {
|
if ($content->getVersion() < $document->getContent()->getVersion()) {
|
||||||
$title = pht('Revert Document?');
|
$title = pht('Publish Older Version?');
|
||||||
$body = pht(
|
$body = pht(
|
||||||
'Revert the published version of this document to an older '.
|
'Revert the published version of this document to an older '.
|
||||||
'version?');
|
'version?');
|
||||||
|
|
Loading…
Reference in a new issue