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

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
This commit is contained in:
Afaque Hussain 2013-03-13 15:15:58 -07:00 committed by epriestley
parent d887a3ff0f
commit 69d087a1d7
5 changed files with 24 additions and 78 deletions

View file

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

View file

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

View file

@ -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(
'<div class="phriction-document-history-diff">'.
'<br><div class="phriction-document-history-diff">'.
'%s<br /><br />%s'.
'<table class="phriction-revert-table">'.
'<tr><td>%s</td><td>%s</td>'.
@ -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(

View file

@ -1,31 +0,0 @@
<?php
final class AphrontCrumbsView extends AphrontView {
private $crumbs = array();
public function setCrumbs(array $crumbs) {
$this->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('<span class="aphront-crumbs-spacer">'."\xC2\xBB".'</span>'),
$out);
return hsprintf(
'<div class="aphront-crumbs-view">'.
'<div class="aphront-crumbs-content">%s</div>'.
'</div>',
$out);
}
}

View file

@ -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%;
}