1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-03-31 06:28:13 +02:00

Phriction - kill tabs

Summary:
...except that pesky help tab which remains.

Pertinent bits here...
- move "History" into button "View History" that is grey and next to "Edit Page"
- for history page, add breadcrumb similar to the one on "diff" page.  This
unifies the experiencing on history <=> diffs as well as gives the user a link
back to the document, which was a tab on the History page before this diff.

Thoughts for next time...
- I'd like to further unify the breadcrumbs between "View" and "History / Diff".
- The "Document Index" is pretty sweet and feels a bit buried.  I wonder if
unifying breadcrumbs is the key here?

Test Plan: clicked around phriction.   viewed a document, viewed its history.
verified links in breadcrumbs were correct

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, epriestley

Maniphest Tasks: T631

Differential Revision: 1221
This commit is contained in:
Bob Trahan 2011-12-15 12:00:17 -08:00
parent 128b7584da
commit ecb0ab4847
7 changed files with 40 additions and 31 deletions

View file

@ -1605,7 +1605,7 @@ celerity_register_resource_map(array(
), ),
'phriction-document-css' => 'phriction-document-css' =>
array( array(
'uri' => '/res/a0eb9ea1/rsrc/css/application/phriction/phriction-document-css.css', 'uri' => '/res/8d09bd7f/rsrc/css/application/phriction/phriction-document-css.css',
'type' => 'css', 'type' => 'css',
'requires' => 'requires' =>
array( array(

View file

@ -30,25 +30,13 @@ abstract class PhrictionController extends PhabricatorController {
$page->setTitle(idx($data, 'title')); $page->setTitle(idx($data, 'title'));
$page->setGlyph("\xE2\x9A\xA1"); $page->setGlyph("\xE2\x9A\xA1");
$tabs = array(); $tabs = array(
if (!empty($data['document'])) { 'help' => array(
$tabs['document'] = array( 'name' => 'Help',
'name' => 'Document', 'href' =>
'href' => $data['document'], PhabricatorEnv::getDoclink('article/Phriction_User_Guide.html'),
); ),
}
if (!empty($data['history'])) {
$tabs['history'] = array(
'name' => 'History',
'href' => $data['history'],
);
}
$tabs['help'] = array(
'name' => 'Help',
'href' => PhabricatorEnv::getDoclink('article/Phriction_User_Guide.html'),
); );
$page->setTabs($tabs, idx($data, 'tab')); $page->setTabs($tabs, idx($data, 'tab'));
$page->appendChild($view); $page->appendChild($view);

View file

@ -195,10 +195,7 @@ class PhrictionDiffController
), ),
array( array(
'title' => 'Document History', 'title' => 'Document History',
'history' => PhrictionDocument::getSlugURI($slug, 'history'),
'document' => PhrictionDocument::getSlugURI($slug),
)); ));
} }
private function renderRevertButton( private function renderRevertButton(

View file

@ -72,6 +72,7 @@ class PhrictionDocumentController
'class' => 'green button', 'class' => 'green button',
), ),
'Create Page'); 'Create Page');
$buttons = $button;
} else { } else {
$version = $request->getInt('v'); $version = $request->getInt('v');
if ($version) { if ($version) {
@ -127,13 +128,22 @@ class PhrictionDocumentController
'</div>'. '</div>'.
'</div>'; '</div>';
$button = phutil_render_tag( $edit_button = phutil_render_tag(
'a', 'a',
array( array(
'href' => '/phriction/edit/'.$document->getID().'/', 'href' => '/phriction/edit/'.$document->getID().'/',
'class' => 'button', 'class' => 'button',
), ),
'Edit Page'); 'Edit Page');
$history_button = phutil_render_tag(
'a',
array(
'href' => PhrictionDocument::getSlugURI($slug, 'history'),
'class' => 'button grey',
),
'View History');
// these float right so button2 which is right most goes first
$buttons = $history_button.$edit_button;
} }
if ($version_note) { if ($version_note) {
@ -144,7 +154,7 @@ class PhrictionDocumentController
$page = $page =
'<div class="phriction-header">'. '<div class="phriction-header">'.
$button. $buttons.
'<h1>'.phutil_escape_html($page_title).'</h1>'. '<h1>'.phutil_escape_html($page_title).'</h1>'.
$breadcrumbs. $breadcrumbs.
'</div>'. '</div>'.
@ -156,7 +166,6 @@ class PhrictionDocumentController
$page, $page,
array( array(
'title' => 'Phriction - '.$page_title, 'title' => 'Phriction - '.$page_title,
'history' => PhrictionDocument::getSlugURI($slug, 'history'),
)); ));
} }

View file

@ -109,6 +109,21 @@ class PhrictionHistoryController
); );
} }
$crumbs = new AphrontCrumbsView();
$crumbs->setCrumbs(
array(
'Phriction',
phutil_render_tag(
'a',
array(
'href' => PhrictionDocument::getSlugURI($document->getSlug()),
),
phutil_escape_html($current->getTitle())
),
'History',
));
$table = new AphrontTableView($rows); $table = new AphrontTableView($rows);
$table->setHeaders( $table->setHeaders(
array( array(
@ -136,15 +151,13 @@ class PhrictionHistoryController
$panel->appendChild($table); $panel->appendChild($table);
$panel->appendChild($pager); $panel->appendChild($pager);
$slug = $document->getSlug();
return $this->buildStandardPageResponse( return $this->buildStandardPageResponse(
$panel, array(
$crumbs,
$panel,
),
array( array(
'title' => 'Document History', 'title' => 'Document History',
'history' => PhrictionDocument::getSlugURI($slug, 'history'),
'document' => PhrictionDocument::getSlugURI($slug),
'tab' => 'history',
)); ));
} }

View file

@ -13,6 +13,7 @@ phutil_require_module('phabricator', 'applications/phriction/storage/content');
phutil_require_module('phabricator', 'applications/phriction/storage/document'); phutil_require_module('phabricator', 'applications/phriction/storage/document');
phutil_require_module('phabricator', 'view/control/pager'); phutil_require_module('phabricator', 'view/control/pager');
phutil_require_module('phabricator', 'view/control/table'); phutil_require_module('phabricator', 'view/control/table');
phutil_require_module('phabricator', 'view/layout/crumbs');
phutil_require_module('phabricator', 'view/layout/panel'); phutil_require_module('phabricator', 'view/layout/panel');
phutil_require_module('phabricator', 'view/utils'); phutil_require_module('phabricator', 'view/utils');

View file

@ -10,6 +10,7 @@
.phriction-header a.button { .phriction-header a.button {
float: right; float: right;
margin: 0em 0em 0em 1%;
} }
.phriction-header h1 { .phriction-header h1 {