From 69d087a1d71738baa9630b74242faf9380bb0674 Mon Sep 17 00:00:00 2001 From: Afaque Hussain Date: Wed, 13 Mar 2013 15:15:58 -0700 Subject: [PATCH] Replaced AphrontCrumbsView with PhabricatorCrumbsView in PhrictionDiffController Summary: Same as title Test Plan: By checking in Phriction UI in Phabricator Reviewers: epriestley, AnhNhan Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D5327 --- scripts/celerity_mapper.php | 1 - src/__phutil_library_map__.php | 6 +-- .../controller/PhrictionDiffController.php | 42 ++++++++++--------- src/view/layout/AphrontCrumbsView.php | 31 -------------- webroot/rsrc/css/aphront/crumbs-view.css | 22 ---------- 5 files changed, 24 insertions(+), 78 deletions(-) delete mode 100644 src/view/layout/AphrontCrumbsView.php delete mode 100644 webroot/rsrc/css/aphront/crumbs-view.css diff --git a/scripts/celerity_mapper.php b/scripts/celerity_mapper.php index c80aa69e46..a120f03a92 100755 --- a/scripts/celerity_mapper.php +++ b/scripts/celerity_mapper.php @@ -70,7 +70,6 @@ $package_spec = array( 'aphront-form-view-css', 'aphront-panel-view-css', 'aphront-table-view-css', - 'aphront-crumbs-view-css', 'aphront-tokenizer-control-css', 'aphront-typeahead-control-css', 'aphront-list-filter-view-css', diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 6f784b2a3e..a13b97b6ec 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -23,7 +23,6 @@ phutil_register_library_map(array( 'AphrontCalendarMonthView' => 'applications/calendar/view/AphrontCalendarMonthView.php', 'AphrontContextBarView' => 'view/layout/AphrontContextBarView.php', 'AphrontController' => 'aphront/AphrontController.php', - 'AphrontCrumbsView' => 'view/layout/AphrontCrumbsView.php', 'AphrontCursorPagerView' => 'view/control/AphrontCursorPagerView.php', 'AphrontDefaultApplicationConfiguration' => 'aphront/configuration/AphrontDefaultApplicationConfiguration.php', 'AphrontDialogResponse' => 'aphront/response/AphrontDialogResponse.php', @@ -1603,7 +1602,6 @@ phutil_register_library_map(array( 'AphrontCalendarMonthView' => 'AphrontView', 'AphrontContextBarView' => 'AphrontView', 'AphrontController' => 'Phobject', - 'AphrontCrumbsView' => 'AphrontView', 'AphrontCursorPagerView' => 'AphrontView', 'AphrontDefaultApplicationConfiguration' => 'AphrontApplicationConfiguration', 'AphrontDialogResponse' => 'AphrontResponse', @@ -1752,8 +1750,8 @@ phutil_register_library_map(array( 'ConduitAPI_phid_lookup_Method' => 'ConduitAPI_phid_Method', 'ConduitAPI_phid_query_Method' => 'ConduitAPI_phid_Method', 'ConduitAPI_phpast_Method' => 'ConduitAPIMethod', - 'ConduitAPI_phpast_getast_Method' => 'ConduitAPIMethod', - 'ConduitAPI_phpast_version_Method' => 'ConduitAPIMethod', + 'ConduitAPI_phpast_getast_Method' => 'ConduitAPI_phpast_Method', + 'ConduitAPI_phpast_version_Method' => 'ConduitAPI_phpast_Method', 'ConduitAPI_phriction_Method' => 'ConduitAPIMethod', 'ConduitAPI_phriction_edit_Method' => 'ConduitAPI_phriction_Method', 'ConduitAPI_phriction_history_Method' => 'ConduitAPI_phriction_Method', diff --git a/src/applications/phriction/controller/PhrictionDiffController.php b/src/applications/phriction/controller/PhrictionDiffController.php index a1daeb9d95..186dd96ca0 100644 --- a/src/applications/phriction/controller/PhrictionDiffController.php +++ b/src/applications/phriction/controller/PhrictionDiffController.php @@ -101,24 +101,22 @@ final class PhrictionDiffController $revert_l = $this->renderRevertButton($content_l, $current); $revert_r = $this->renderRevertButton($content_r, $current); - $crumbs = new AphrontCrumbsView(); - $crumbs->setCrumbs( - array( - 'Phriction', - phutil_tag( - 'a', - array( - 'href' => PhrictionDocument::getSlugURI($slug), - ), - $current->getTitle()), - phutil_tag( - 'a', - array( - 'href' => '/phriction/history/'.$document->getSlug().'/', - ), - 'History'), - "Changes Between Version {$l} and Version {$r}", - )); + $crumbs = $this->buildApplicationCrumbs(); + $crumb_views = $this->renderBreadcrumbs($slug); + foreach ($crumb_views as $view) { + $crumbs->addCrumb($view); + } + + + $title = "Version $l vs $r"; + + $header = id(new PhabricatorHeaderView()) + ->setHeader($title); + + $crumbs->addCrumb( + id(new PhabricatorCrumbView()) + ->setName($title)); + $comparison_table = $this->renderComparisonTable( array( @@ -170,7 +168,7 @@ final class PhrictionDiffController $output = hsprintf( - '
'. + '
'. '%s

%s'. ''. ''. @@ -183,14 +181,18 @@ final class PhrictionDiffController $revert_r, $output); - return $this->buildStandardPageResponse( + + return $this->buildApplicationPage( array( $crumbs, + $header, $output, ), array( 'title' => pht('Document History'), + 'device' => true, )); + } private function renderRevertButton( diff --git a/src/view/layout/AphrontCrumbsView.php b/src/view/layout/AphrontCrumbsView.php deleted file mode 100644 index e9cee36a22..0000000000 --- a/src/view/layout/AphrontCrumbsView.php +++ /dev/null @@ -1,31 +0,0 @@ -crumbs = $crumbs; - return $this; - } - - public function render() { - - require_celerity_resource('aphront-crumbs-view-css'); - - $out = array(); - foreach ($this->crumbs as $crumb) { - $out[] = $crumb; - } - $out = phutil_implode_html( - hsprintf(''."\xC2\xBB".''), - $out); - - return hsprintf( - '
'. - '
%s
'. - '
', - $out); - } - -} diff --git a/webroot/rsrc/css/aphront/crumbs-view.css b/webroot/rsrc/css/aphront/crumbs-view.css deleted file mode 100644 index af6076e5b5..0000000000 --- a/webroot/rsrc/css/aphront/crumbs-view.css +++ /dev/null @@ -1,22 +0,0 @@ -/** - * @provides aphront-crumbs-view-css - */ - -.aphront-crumbs-view { - margin: 1em 2em; -} - -.aphront-crumbs-content { - font-size: 16px; - font-weight: bold; - color: #333; -} - -.aphront-crumbs-spacer { - padding: 0 .35em; - color: #888888; -} - -.device-desktop .aphront-crumbs-view { - width: 66%; -}
%s%s