1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-13 02:12:41 +01:00

Update Diffusion UI

Summary: This updates (all?) of Diffusion/Audit to new UI, included edit and other extra form pages. It's fairly complete but I don't know all the nooks and crannies so to speak to fully verify I didn't mess anything up.

Test Plan: Tested creating new repositories, browsing, searching, auditing. Need more eyes.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D15487
This commit is contained in:
Chad Little 2016-03-17 12:01:22 -07:00
parent 08b1a33dc3
commit 8f94aa8a06
40 changed files with 1049 additions and 659 deletions

View file

@ -7,12 +7,12 @@
*/ */
return array( return array(
'names' => array( 'names' => array(
'core.pkg.css' => '225e8ac7', 'core.pkg.css' => 'a93de192',
'core.pkg.js' => '7d8faf57', 'core.pkg.js' => '7d8faf57',
'darkconsole.pkg.js' => 'e7393ebb', 'darkconsole.pkg.js' => 'e7393ebb',
'differential.pkg.css' => '7ba78475', 'differential.pkg.css' => '7ba78475',
'differential.pkg.js' => 'd0cd0df6', 'differential.pkg.js' => 'd0cd0df6',
'diffusion.pkg.css' => 'f45955ed', 'diffusion.pkg.css' => 'dc8e0cc2',
'diffusion.pkg.js' => '3a9a8bfa', 'diffusion.pkg.js' => '3a9a8bfa',
'maniphest.pkg.css' => '4845691a', 'maniphest.pkg.css' => '4845691a',
'maniphest.pkg.js' => '949a7498', 'maniphest.pkg.js' => '949a7498',
@ -64,9 +64,9 @@ return array(
'rsrc/css/application/differential/revision-history.css' => '0e8eb855', 'rsrc/css/application/differential/revision-history.css' => '0e8eb855',
'rsrc/css/application/differential/revision-list.css' => 'f3c47d33', 'rsrc/css/application/differential/revision-list.css' => 'f3c47d33',
'rsrc/css/application/differential/table-of-contents.css' => 'ae4b7a55', 'rsrc/css/application/differential/table-of-contents.css' => 'ae4b7a55',
'rsrc/css/application/diffusion/diffusion-icons.css' => '2941baf1', 'rsrc/css/application/diffusion/diffusion-icons.css' => '3311444d',
'rsrc/css/application/diffusion/diffusion-readme.css' => '356a4f3c', 'rsrc/css/application/diffusion/diffusion-readme.css' => '356a4f3c',
'rsrc/css/application/diffusion/diffusion-source.css' => '075ba788', 'rsrc/css/application/diffusion/diffusion-source.css' => '68b30fd3',
'rsrc/css/application/feed/feed.css' => 'ecd4ec57', 'rsrc/css/application/feed/feed.css' => 'ecd4ec57',
'rsrc/css/application/files/global-drag-and-drop.css' => '5c1b47c2', 'rsrc/css/application/files/global-drag-and-drop.css' => '5c1b47c2',
'rsrc/css/application/flag/flag.css' => '5337623f', 'rsrc/css/application/flag/flag.css' => '5337623f',
@ -123,7 +123,7 @@ return array(
'rsrc/css/phui/phui-action-panel.css' => '91c7b835', 'rsrc/css/phui/phui-action-panel.css' => '91c7b835',
'rsrc/css/phui/phui-badge.css' => 'f25c3476', 'rsrc/css/phui/phui-badge.css' => 'f25c3476',
'rsrc/css/phui/phui-big-info-view.css' => 'bd903741', 'rsrc/css/phui/phui-big-info-view.css' => 'bd903741',
'rsrc/css/phui/phui-box.css' => '96a10c5d', 'rsrc/css/phui/phui-box.css' => 'b2d49bae',
'rsrc/css/phui/phui-button.css' => 'a64a8de6', 'rsrc/css/phui/phui-button.css' => 'a64a8de6',
'rsrc/css/phui/phui-chart.css' => '6bf6f78e', 'rsrc/css/phui/phui-chart.css' => '6bf6f78e',
'rsrc/css/phui/phui-crumbs-view.css' => '79d536e5', 'rsrc/css/phui/phui-crumbs-view.css' => '79d536e5',
@ -135,28 +135,28 @@ return array(
'rsrc/css/phui/phui-fontkit.css' => '9cda225e', 'rsrc/css/phui/phui-fontkit.css' => '9cda225e',
'rsrc/css/phui/phui-form-view.css' => '4a1a0f5e', 'rsrc/css/phui/phui-form-view.css' => '4a1a0f5e',
'rsrc/css/phui/phui-form.css' => 'aac1d51d', 'rsrc/css/phui/phui-form.css' => 'aac1d51d',
'rsrc/css/phui/phui-head-thing.css' => '31638812', 'rsrc/css/phui/phui-head-thing.css' => 'fd311e5f',
'rsrc/css/phui/phui-header-view.css' => '26cffd3d', 'rsrc/css/phui/phui-header-view.css' => '230254d3',
'rsrc/css/phui/phui-hovercard.css' => 'de1a2119', 'rsrc/css/phui/phui-hovercard.css' => 'de1a2119',
'rsrc/css/phui/phui-icon-set-selector.css' => '1ab67aad', 'rsrc/css/phui/phui-icon-set-selector.css' => '1ab67aad',
'rsrc/css/phui/phui-icon.css' => '3f33ab57', 'rsrc/css/phui/phui-icon.css' => '3f33ab57',
'rsrc/css/phui/phui-image-mask.css' => 'a8498f9c', 'rsrc/css/phui/phui-image-mask.css' => 'a8498f9c',
'rsrc/css/phui/phui-info-panel.css' => '27ea50a1', 'rsrc/css/phui/phui-info-panel.css' => '27ea50a1',
'rsrc/css/phui/phui-info-view.css' => '6d7c3509', 'rsrc/css/phui/phui-info-view.css' => '28efab79',
'rsrc/css/phui/phui-list.css' => '9da2aa00', 'rsrc/css/phui/phui-list.css' => '9da2aa00',
'rsrc/css/phui/phui-object-box.css' => '6b487c57', 'rsrc/css/phui/phui-object-box.css' => '6b487c57',
'rsrc/css/phui/phui-object-item-list-view.css' => '18b2ce8e', 'rsrc/css/phui/phui-object-item-list-view.css' => '18b2ce8e',
'rsrc/css/phui/phui-pager.css' => 'bea33d23', 'rsrc/css/phui/phui-pager.css' => 'bea33d23',
'rsrc/css/phui/phui-pinboard-view.css' => '2495140e', 'rsrc/css/phui/phui-pinboard-view.css' => '2495140e',
'rsrc/css/phui/phui-profile-menu.css' => '7e92a89a', 'rsrc/css/phui/phui-profile-menu.css' => '7e92a89a',
'rsrc/css/phui/phui-property-list-view.css' => 'b12e801c', 'rsrc/css/phui/phui-property-list-view.css' => '1d42ee7c',
'rsrc/css/phui/phui-remarkup-preview.css' => '1a8f2591', 'rsrc/css/phui/phui-remarkup-preview.css' => '1a8f2591',
'rsrc/css/phui/phui-segment-bar-view.css' => '46342871', 'rsrc/css/phui/phui-segment-bar-view.css' => '46342871',
'rsrc/css/phui/phui-spacing.css' => '042804d6', 'rsrc/css/phui/phui-spacing.css' => '042804d6',
'rsrc/css/phui/phui-status.css' => '37309046', 'rsrc/css/phui/phui-status.css' => '37309046',
'rsrc/css/phui/phui-tag-view.css' => '6bbd83e2', 'rsrc/css/phui/phui-tag-view.css' => '6bbd83e2',
'rsrc/css/phui/phui-timeline-view.css' => 'a0173eba', 'rsrc/css/phui/phui-timeline-view.css' => 'a0173eba',
'rsrc/css/phui/phui-two-column-view.css' => '61dd6d38', 'rsrc/css/phui/phui-two-column-view.css' => 'c110d0c3',
'rsrc/css/phui/workboards/phui-workboard-color.css' => 'ac6fe6a7', 'rsrc/css/phui/workboards/phui-workboard-color.css' => 'ac6fe6a7',
'rsrc/css/phui/workboards/phui-workboard.css' => 'e6d89647', 'rsrc/css/phui/workboards/phui-workboard.css' => 'e6d89647',
'rsrc/css/phui/workboards/phui-workcard.css' => '3646fb96', 'rsrc/css/phui/workboards/phui-workcard.css' => '3646fb96',
@ -553,9 +553,9 @@ return array(
'differential-revision-history-css' => '0e8eb855', 'differential-revision-history-css' => '0e8eb855',
'differential-revision-list-css' => 'f3c47d33', 'differential-revision-list-css' => 'f3c47d33',
'differential-table-of-contents-css' => 'ae4b7a55', 'differential-table-of-contents-css' => 'ae4b7a55',
'diffusion-icons-css' => '2941baf1', 'diffusion-icons-css' => '3311444d',
'diffusion-readme-css' => '356a4f3c', 'diffusion-readme-css' => '356a4f3c',
'diffusion-source-css' => '075ba788', 'diffusion-source-css' => '68b30fd3',
'diviner-shared-css' => 'aa3656aa', 'diviner-shared-css' => 'aa3656aa',
'font-aleo' => '8bdb2835', 'font-aleo' => '8bdb2835',
'font-fontawesome' => 'c43323c5', 'font-fontawesome' => 'c43323c5',
@ -805,7 +805,7 @@ return array(
'phui-action-panel-css' => '91c7b835', 'phui-action-panel-css' => '91c7b835',
'phui-badge-view-css' => 'f25c3476', 'phui-badge-view-css' => 'f25c3476',
'phui-big-info-view-css' => 'bd903741', 'phui-big-info-view-css' => 'bd903741',
'phui-box-css' => '96a10c5d', 'phui-box-css' => 'b2d49bae',
'phui-button-css' => 'a64a8de6', 'phui-button-css' => 'a64a8de6',
'phui-calendar-css' => 'ccabe893', 'phui-calendar-css' => 'ccabe893',
'phui-calendar-day-css' => 'd1cf6f93', 'phui-calendar-day-css' => 'd1cf6f93',
@ -822,15 +822,15 @@ return array(
'phui-fontkit-css' => '9cda225e', 'phui-fontkit-css' => '9cda225e',
'phui-form-css' => 'aac1d51d', 'phui-form-css' => 'aac1d51d',
'phui-form-view-css' => '4a1a0f5e', 'phui-form-view-css' => '4a1a0f5e',
'phui-head-thing-view-css' => '31638812', 'phui-head-thing-view-css' => 'fd311e5f',
'phui-header-view-css' => '26cffd3d', 'phui-header-view-css' => '230254d3',
'phui-hovercard' => '1bd28176', 'phui-hovercard' => '1bd28176',
'phui-hovercard-view-css' => 'de1a2119', 'phui-hovercard-view-css' => 'de1a2119',
'phui-icon-set-selector-css' => '1ab67aad', 'phui-icon-set-selector-css' => '1ab67aad',
'phui-icon-view-css' => '3f33ab57', 'phui-icon-view-css' => '3f33ab57',
'phui-image-mask-css' => 'a8498f9c', 'phui-image-mask-css' => 'a8498f9c',
'phui-info-panel-css' => '27ea50a1', 'phui-info-panel-css' => '27ea50a1',
'phui-info-view-css' => '6d7c3509', 'phui-info-view-css' => '28efab79',
'phui-inline-comment-view-css' => '5953c28e', 'phui-inline-comment-view-css' => '5953c28e',
'phui-list-view-css' => '9da2aa00', 'phui-list-view-css' => '9da2aa00',
'phui-object-box-css' => '6b487c57', 'phui-object-box-css' => '6b487c57',
@ -838,7 +838,7 @@ return array(
'phui-pager-css' => 'bea33d23', 'phui-pager-css' => 'bea33d23',
'phui-pinboard-view-css' => '2495140e', 'phui-pinboard-view-css' => '2495140e',
'phui-profile-menu-css' => '7e92a89a', 'phui-profile-menu-css' => '7e92a89a',
'phui-property-list-view-css' => 'b12e801c', 'phui-property-list-view-css' => '1d42ee7c',
'phui-remarkup-preview-css' => '1a8f2591', 'phui-remarkup-preview-css' => '1a8f2591',
'phui-segment-bar-view-css' => '46342871', 'phui-segment-bar-view-css' => '46342871',
'phui-spacing-css' => '042804d6', 'phui-spacing-css' => '042804d6',
@ -846,7 +846,7 @@ return array(
'phui-tag-view-css' => '6bbd83e2', 'phui-tag-view-css' => '6bbd83e2',
'phui-theme-css' => '027ba77e', 'phui-theme-css' => '027ba77e',
'phui-timeline-view-css' => 'a0173eba', 'phui-timeline-view-css' => 'a0173eba',
'phui-two-column-view-css' => '61dd6d38', 'phui-two-column-view-css' => 'c110d0c3',
'phui-workboard-color-css' => 'ac6fe6a7', 'phui-workboard-color-css' => 'ac6fe6a7',
'phui-workboard-view-css' => 'e6d89647', 'phui-workboard-view-css' => 'e6d89647',
'phui-workcard-view-css' => '3646fb96', 'phui-workcard-view-css' => '3646fb96',

View file

@ -37,9 +37,11 @@ final class PhabricatorAuditCommitStatusConstants extends Phobject {
$color = 'red'; $color = 'red';
break; break;
case self::NEEDS_AUDIT: case self::NEEDS_AUDIT:
case self::PARTIALLY_AUDITED:
$color = 'orange'; $color = 'orange';
break; break;
case self::PARTIALLY_AUDITED:
$color = 'yellow';
break;
case self::FULLY_AUDITED: case self::FULLY_AUDITED:
$color = 'green'; $color = 'green';
break; break;
@ -53,11 +55,11 @@ final class PhabricatorAuditCommitStatusConstants extends Phobject {
public static function getStatusIcon($code) { public static function getStatusIcon($code) {
switch ($code) { switch ($code) {
case self::CONCERN_RAISED: case self::CONCERN_RAISED:
$icon = 'fa-exclamation-triangle'; $icon = 'fa-exclamation-circle';
break; break;
case self::NEEDS_AUDIT: case self::NEEDS_AUDIT:
case self::PARTIALLY_AUDITED: case self::PARTIALLY_AUDITED:
$icon = 'fa-exclamation-triangle'; $icon = 'fa-exclamation-circle';
break; break;
case self::FULLY_AUDITED: case self::FULLY_AUDITED:
$icon = 'fa-check'; $icon = 'fa-check';

View file

@ -81,6 +81,21 @@ final class DifferentialChangeType extends Phobject {
return idx($icons, $type, 'fa-file'); return idx($icons, $type, 'fa-file');
} }
public static function getIconColorForFileType($type) {
static $icons = array(
self::FILE_TEXT => 'black',
self::FILE_IMAGE => 'black',
self::FILE_BINARY => 'green',
self::FILE_DIRECTORY => 'blue',
self::FILE_SYMLINK => 'blue',
self::FILE_DELETED => 'red',
self::FILE_NORMAL => 'black',
self::FILE_SUBMODULE => 'blue',
);
return idx($icons, $type, 'black');
}
public static function isOldLocationChangeType($type) { public static function isOldLocationChangeType($type) {
static $types = array( static $types = array(
self::TYPE_MOVE_AWAY => true, self::TYPE_MOVE_AWAY => true,

View file

@ -9,6 +9,7 @@ final class DifferentialChangesetListView extends AphrontView {
private $renderURI = '/differential/changeset/'; private $renderURI = '/differential/changeset/';
private $whitespace; private $whitespace;
private $background; private $background;
private $header;
private $standaloneURI; private $standaloneURI;
private $leftRawFileURI; private $leftRawFileURI;
@ -118,6 +119,11 @@ final class DifferentialChangesetListView extends AphrontView {
return $this; return $this;
} }
public function setHeader($header) {
$this->header = $header;
return $this;
}
public function render() { public function render() {
$viewer = $this->getViewer(); $viewer = $this->getViewer();
@ -246,8 +252,12 @@ final class DifferentialChangesetListView extends AphrontView {
)); ));
} }
$header = id(new PHUIHeaderView()) if ($this->header) {
->setHeader($this->getTitle()); $header = $this->header;
} else {
$header = id(new PHUIHeaderView())
->setHeader($this->getTitle());
}
$content = phutil_tag( $content = phutil_tag(
'div', 'div',
@ -259,8 +269,8 @@ final class DifferentialChangesetListView extends AphrontView {
$object_box = id(new PHUIObjectBoxView()) $object_box = id(new PHUIObjectBoxView())
->setHeader($header) ->setHeader($header)
->setCollapsed(true)
->setBackground($this->background) ->setBackground($this->background)
->setCollapsed(true)
->appendChild($content); ->appendChild($content);
return $object_box; return $object_box;

View file

@ -48,26 +48,37 @@ final class DiffusionBranchTableController extends DiffusionController {
->withRepository($repository) ->withRepository($repository)
->execute(); ->execute();
$view = id(new DiffusionBranchTableView()) $table = id(new DiffusionBranchTableView())
->setUser($viewer) ->setUser($viewer)
->setBranches($branches) ->setBranches($branches)
->setCommits($commits) ->setCommits($commits)
->setDiffusionRequest($drequest); ->setDiffusionRequest($drequest);
$panel = id(new PHUIObjectBoxView()) $content = id(new PHUIObjectBoxView())
->setHeaderText(pht('Branches')) ->setHeaderText($repository->getName())
->setTable($view); ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setTable($table);
$content = $panel;
} }
$crumbs = $this->buildCrumbs( $crumbs = $this->buildCrumbs(
array( array(
'branches' => true, 'branches' => true,
)); ));
$crumbs->setBorder(true);
$pager_box = $this->renderTablePagerBox($pager); $pager_box = $this->renderTablePagerBox($pager);
$header = id(new PHUIHeaderView())
->setHeader(pht('Branches'))
->setHeaderIcon('fa-code-fork');
$view = id(new PHUITwoColumnView())
->setHeader($header)
->setFooter(array(
$content,
$pager_box,
));
return $this->newPage() return $this->newPage()
->setTitle( ->setTitle(
array( array(
@ -77,8 +88,7 @@ final class DiffusionBranchTableController extends DiffusionController {
->setCrumbs($crumbs) ->setCrumbs($crumbs)
->appendChild( ->appendChild(
array( array(
$content, $view,
$pager_box,
)); ));
} }

View file

@ -55,20 +55,17 @@ final class DiffusionBrowseController extends DiffusionController {
} }
private function browseSearch() { private function browseSearch() {
$drequest = $this->getDiffusionRequest(); $drequest = $this->getDiffusionRequest();
$header = $this->buildHeaderView($drequest);
$actions = $this->buildActionView($drequest); $search_form = $this->renderSearchForm();
$properties = $this->buildPropertyView($drequest, $actions); $search_results = $this->renderSearchResults();
$object_box = id(new PHUIObjectBoxView()) $search_form = id(new PHUIObjectBoxView())
->setHeader($this->buildHeaderView($drequest)) ->setHeaderText(pht('Search'))
->addPropertyList($properties); ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->appendChild($search_form);
$content = array();
$content[] = $object_box;
$content[] = $this->renderSearchForm($collapsed = false);
$content[] = $this->renderSearchResults();
$crumbs = $this->buildCrumbs( $crumbs = $this->buildCrumbs(
array( array(
@ -76,6 +73,14 @@ final class DiffusionBrowseController extends DiffusionController {
'path' => true, 'path' => true,
'view' => 'browse', 'view' => 'browse',
)); ));
$crumbs->setBorder(true);
$view = id(new PHUITwoColumnView())
->setHeader($header)
->setFooter(array(
$search_form,
$search_results,
));
return $this->newPage() return $this->newPage()
->setTitle( ->setTitle(
@ -84,7 +89,7 @@ final class DiffusionBrowseController extends DiffusionController {
$drequest->getRepository()->getDisplayName(), $drequest->getRepository()->getDisplayName(),
)) ))
->setCrumbs($crumbs) ->setCrumbs($crumbs)
->appendChild($content); ->appendChild($view);
} }
private function browseFile() { private function browseFile() {
@ -218,20 +223,18 @@ final class DiffusionBrowseController extends DiffusionController {
require_celerity_resource('diffusion-source-css'); require_celerity_resource('diffusion-source-css');
// Render the page. // Render the page.
$view = $this->buildActionView($drequest); $view = $this->buildCurtain($drequest);
$action_list = $this->enrichActionView( $curtain = $this->enrichCurtain(
$view, $view,
$drequest, $drequest,
$show_blame, $show_blame,
$show_color); $show_color);
$properties = $this->buildPropertyView($drequest, $action_list); $properties = $this->buildPropertyView($drequest);
$object_box = id(new PHUIObjectBoxView()) $header = $this->buildHeaderView($drequest);
->setHeader($this->buildHeaderView($drequest)) $header->setHeaderIcon('fa-file-code-o');
->addPropertyList($properties);
$content = array(); $content = array();
$content[] = $object_box;
$follow = $request->getStr('follow'); $follow = $request->getStr('follow');
if ($follow) { if ($follow) {
@ -277,17 +280,31 @@ final class DiffusionBrowseController extends DiffusionController {
'path' => true, 'path' => true,
'view' => 'browse', 'view' => 'browse',
)); ));
$crumbs->setBorder(true);
$basename = basename($this->getDiffusionRequest()->getPath()); $basename = basename($this->getDiffusionRequest()->getPath());
$view = id(new PHUITwoColumnView())
->setHeader($header)
->setCurtain($curtain)
->setMainColumn(array(
$content,
));
if ($properties) {
$view->addPropertySection(pht('DETAILS'), $properties);
}
$title = array($basename, $repository->getDisplayName());
return $this->newPage() return $this->newPage()
->setTitle( ->setTitle($title)
array(
$basename,
$repository->getDisplayName(),
))
->setCrumbs($crumbs) ->setCrumbs($crumbs)
->appendChild($content); ->appendChild(
array(
$view,
));
} }
public function browseDirectory( public function browseDirectory(
@ -300,23 +317,21 @@ final class DiffusionBrowseController extends DiffusionController {
$reason = $results->getReasonForEmptyResultSet(); $reason = $results->getReasonForEmptyResultSet();
$content = array(); $curtain = $this->buildCurtain($drequest);
$actions = $this->buildActionView($drequest); $details = $this->buildPropertyView($drequest);
$properties = $this->buildPropertyView($drequest, $actions);
$object_box = id(new PHUIObjectBoxView()) $header = $this->buildHeaderView($drequest);
->setHeader($this->buildHeaderView($drequest)) $header->setHeaderIcon('fa-folder-open');
->addPropertyList($properties);
$content[] = $object_box; $search_form = $this->renderSearchForm();
$content[] = $this->renderSearchForm($collapsed = true);
$empty_result = null;
$browse_panel = null;
if (!$results->isValidResults()) { if (!$results->isValidResults()) {
$empty_result = new DiffusionEmptyResultView(); $empty_result = new DiffusionEmptyResultView();
$empty_result->setDiffusionRequest($drequest); $empty_result->setDiffusionRequest($drequest);
$empty_result->setDiffusionBrowseResultSet($results); $empty_result->setDiffusionBrowseResultSet($results);
$empty_result->setView($request->getStr('view')); $empty_result->setView($request->getStr('view'));
$content[] = $empty_result;
} else { } else {
$phids = array(); $phids = array();
foreach ($results->getPaths() as $result) { foreach ($results->getPaths() as $result) {
@ -331,21 +346,30 @@ final class DiffusionBrowseController extends DiffusionController {
$phids = array_keys($phids); $phids = array_keys($phids);
$handles = $this->loadViewerHandles($phids); $handles = $this->loadViewerHandles($phids);
$browse_table = new DiffusionBrowseTableView(); $browse_table = id(new DiffusionBrowseTableView())
$browse_table->setDiffusionRequest($drequest); ->setDiffusionRequest($drequest)
$browse_table->setHandles($handles); ->setHandles($handles)
$browse_table->setPaths($results->getPaths()); ->setPaths($results->getPaths())
$browse_table->setUser($request->getUser()); ->setUser($request->getUser());
$browse_panel = new PHUIObjectBoxView(); $browse_header = id(new PHUIHeaderView())
$browse_panel->setHeaderText($drequest->getPath(), '/'); ->setHeader(nonempty(basename($drequest->getPath()), '/'))
$browse_panel->setTable($browse_table); ->setHeaderIcon('fa-folder-open');
$content[] = $browse_panel; $browse_panel = id(new PHUIObjectBoxView())
->setHeader($browse_header)
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setTable($browse_table);
$browse_panel->setShowHide(
array(pht('Show Search')),
pht('Hide Search'),
$search_form,
'#');
} }
$content[] = $this->buildOpenRevisions(); $open_revisions = $this->buildOpenRevisions();
$content[] = $this->renderDirectoryReadme($results); $readme = $this->renderDirectoryReadme($results);
$crumbs = $this->buildCrumbs( $crumbs = $this->buildCrumbs(
array( array(
@ -355,18 +379,34 @@ final class DiffusionBrowseController extends DiffusionController {
)); ));
$pager_box = $this->renderTablePagerBox($pager); $pager_box = $this->renderTablePagerBox($pager);
$crumbs->setBorder(true);
$view = id(new PHUITwoColumnView())
->setHeader($header)
->setCurtain($curtain)
->setMainColumn(array(
$empty_result,
$browse_panel,
))
->setFooter(array(
$open_revisions,
$readme,
$pager_box,
));
if ($details) {
$view->addPropertySection(pht('DETAILS'), $details);
}
return $this->newPage() return $this->newPage()
->setTitle( ->setTitle(array(
array(
nonempty(basename($drequest->getPath()), '/'), nonempty(basename($drequest->getPath()), '/'),
$repository->getDisplayName(), $repository->getDisplayName(),
)) ))
->setCrumbs($crumbs) ->setCrumbs($crumbs)
->appendChild( ->appendChild(
array( array(
$content, $view,
$pager_box,
)); ));
} }
@ -431,6 +471,7 @@ final class DiffusionBrowseController extends DiffusionController {
$box = id(new PHUIObjectBoxView()) $box = id(new PHUIObjectBoxView())
->setHeaderText($header) ->setHeaderText($header)
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setTable($table); ->setTable($table);
$pager_box = $this->renderTablePagerBox($pager); $pager_box = $this->renderTablePagerBox($pager);
@ -697,12 +738,14 @@ final class DiffusionBrowseController extends DiffusionController {
$edit = $this->renderEditButton(); $edit = $this->renderEditButton();
$file = $this->renderFileButton(); $file = $this->renderFileButton();
$header = id(new PHUIHeaderView()) $header = id(new PHUIHeaderView())
->setHeader(pht('File Contents')) ->setHeader(basename($this->getDiffusionRequest()->getPath()))
->setHeaderIcon('fa-file-code-o')
->addActionLink($edit) ->addActionLink($edit)
->addActionLink($file); ->addActionLink($file);
$corpus = id(new PHUIObjectBoxView()) $corpus = id(new PHUIObjectBoxView())
->setHeader($header) ->setHeader($header)
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->appendChild($corpus) ->appendChild($corpus)
->setCollapsed(true); ->setCollapsed(true);
@ -737,16 +780,16 @@ final class DiffusionBrowseController extends DiffusionController {
return $corpus; return $corpus;
} }
private function enrichActionView( private function enrichCurtain(
PhabricatorActionListView $view, PHUICurtainView $curtain,
DiffusionRequest $drequest, DiffusionRequest $drequest,
$show_blame, $show_blame,
$show_color) { $show_color) {
$viewer = $this->getRequest()->getUser(); $viewer = $this->getViewer();
$base_uri = $this->getRequest()->getRequestURI(); $base_uri = $this->getRequest()->getRequestURI();
$view->addAction( $curtain->addAction(
id(new PhabricatorActionView()) id(new PhabricatorActionView())
->setName(pht('Show Last Change')) ->setName(pht('Show Last Change'))
->setHref( ->setHref(
@ -766,7 +809,7 @@ final class DiffusionBrowseController extends DiffusionController {
$blame_value = 1; $blame_value = 1;
} }
$view->addAction( $curtain->addAction(
id(new PhabricatorActionView()) id(new PhabricatorActionView())
->setName($blame_text) ->setName($blame_text)
->setHref($base_uri->alter('blame', $blame_value)) ->setHref($base_uri->alter('blame', $blame_value))
@ -784,7 +827,7 @@ final class DiffusionBrowseController extends DiffusionController {
$highlight_value = 1; $highlight_value = 1;
} }
$view->addAction( $curtain->addAction(
id(new PhabricatorActionView()) id(new PhabricatorActionView())
->setName($highlight_text) ->setName($highlight_text)
->setHref($base_uri->alter('color', $highlight_value)) ->setHref($base_uri->alter('color', $highlight_value))
@ -809,14 +852,57 @@ final class DiffusionBrowseController extends DiffusionController {
))->alter('lint', ''); ))->alter('lint', '');
} }
$view->addAction( $curtain->addAction(
id(new PhabricatorActionView()) id(new PhabricatorActionView())
->setName($lint_text) ->setName($lint_text)
->setHref($href) ->setHref($href)
->setIcon('fa-exclamation-triangle') ->setIcon('fa-exclamation-triangle')
->setDisabled(!$href)); ->setDisabled(!$href));
return $view;
$repository = $drequest->getRepository();
$owners = 'PhabricatorOwnersApplication';
if (PhabricatorApplication::isClassInstalled($owners)) {
$package_query = id(new PhabricatorOwnersPackageQuery())
->setViewer($viewer)
->withStatuses(array(PhabricatorOwnersPackage::STATUS_ACTIVE))
->withControl(
$repository->getPHID(),
array(
$drequest->getPath(),
));
$package_query->execute();
$packages = $package_query->getControllingPackagesForPath(
$repository->getPHID(),
$drequest->getPath());
if ($packages) {
$ownership = id(new PHUIStatusListView())
->setUser($viewer);
foreach ($packages as $package) {
$icon = 'fa-list-alt';
$color = 'grey';
$item = id(new PHUIStatusItemView())
->setIcon($icon, $color)
->setTarget($viewer->renderHandle($package->getPHID()));
$ownership->addItem($item);
}
} else {
$ownership = phutil_tag('em', array(), pht('None'));
}
$curtain->newPanel()
->setHeaderText(pht('Owners'))
->appendChild($ownership);
}
return $curtain;
} }
private function renderEditButton() { private function renderEditButton() {
@ -1265,11 +1351,13 @@ final class DiffusionBrowseController extends DiffusionController {
$file = $this->renderFileButton($file_uri); $file = $this->renderFileButton($file_uri);
$header = id(new PHUIHeaderView()) $header = id(new PHUIHeaderView())
->setHeader(pht('Image')) ->setHeader(basename($this->getDiffusionRequest()->getPath()))
->addActionLink($file); ->addActionLink($file)
->setHeaderIcon('fa-file-image-o');
return id(new PHUIObjectBoxView()) return id(new PHUIObjectBoxView())
->setHeader($header) ->setHeader($header)
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->addPropertyList($properties); ->addPropertyList($properties);
} }
@ -1282,11 +1370,12 @@ final class DiffusionBrowseController extends DiffusionController {
$file = $this->renderFileButton($file_uri); $file = $this->renderFileButton($file_uri);
$header = id(new PHUIHeaderView()) $header = id(new PHUIHeaderView())
->setHeader(pht('Details')) ->setHeader(pht('DETAILS'))
->addActionLink($file); ->addActionLink($file);
$box = id(new PHUIObjectBoxView()) $box = id(new PHUIObjectBoxView())
->setHeader($header) ->setHeader($header)
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->appendChild($text); ->appendChild($text);
return $box; return $box;
@ -1298,7 +1387,7 @@ final class DiffusionBrowseController extends DiffusionController {
->appendChild($message); ->appendChild($message);
$header = id(new PHUIHeaderView()) $header = id(new PHUIHeaderView())
->setHeader(pht('Details')); ->setHeader(pht('DETAILS'));
$box = id(new PHUIObjectBoxView()) $box = id(new PHUIObjectBoxView())
->setHeader($header) ->setHeader($header)
@ -1461,12 +1550,12 @@ final class DiffusionBrowseController extends DiffusionController {
return "{$summary}\n{$date} \xC2\xB7 {$author}"; return "{$summary}\n{$date} \xC2\xB7 {$author}";
} }
protected function renderSearchForm($collapsed) { protected function renderSearchForm() {
$drequest = $this->getDiffusionRequest(); $drequest = $this->getDiffusionRequest();
$forms = array(); $forms = array();
$form = id(new AphrontFormView()) $form = id(new AphrontFormView())
->setUser($this->getRequest()->getUser()) ->setUser($this->getViewer())
->setMethod('GET'); ->setMethod('GET');
switch ($drequest->getRepository()->getVersionControlSystem()) { switch ($drequest->getRepository()->getVersionControlSystem()) {
@ -1492,22 +1581,10 @@ final class DiffusionBrowseController extends DiffusionController {
break; break;
} }
$filter = new AphrontListFilterView(); require_celerity_resource('diffusion-icons-css');
$filter->appendChild($forms); $form_box = phutil_tag_div('diffusion-search-boxen', $forms);
if ($collapsed) { return $form_box;
$filter->setCollapsed(
pht('Show Search'),
pht('Hide Search'),
pht('Search for file names or content in this directory.'),
'#');
}
$filter = id(new PHUIBoxView())
->addClass('mlt mlb')
->appendChild($filter);
return $filter;
} }
protected function markupText($text) { protected function markupText($text) {
@ -1526,28 +1603,29 @@ final class DiffusionBrowseController extends DiffusionController {
} }
protected function buildHeaderView(DiffusionRequest $drequest) { protected function buildHeaderView(DiffusionRequest $drequest) {
$viewer = $this->getRequest()->getUser(); $viewer = $this->getViewer();
$tag = $this->renderCommitHashTag($drequest);
$header = id(new PHUIHeaderView()) $header = id(new PHUIHeaderView())
->setUser($viewer) ->setUser($viewer)
->setHeader($this->renderPathLinks($drequest, $mode = 'browse')) ->setHeader($this->renderPathLinks($drequest, $mode = 'browse'))
->setPolicyObject($drequest->getRepository()); ->addTag($tag);
return $header; return $header;
} }
protected function buildActionView(DiffusionRequest $drequest) { protected function buildCurtain(DiffusionRequest $drequest) {
$viewer = $this->getRequest()->getUser(); $viewer = $this->getViewer();
$view = id(new PhabricatorActionListView()) $curtain = $this->newCurtainView($drequest);
->setUser($viewer);
$history_uri = $drequest->generateURI( $history_uri = $drequest->generateURI(
array( array(
'action' => 'history', 'action' => 'history',
)); ));
$view->addAction( $curtain->addAction(
id(new PhabricatorActionView()) id(new PhabricatorActionView())
->setName(pht('View History')) ->setName(pht('View History'))
->setHref($history_uri) ->setHref($history_uri)
@ -1559,40 +1637,22 @@ final class DiffusionBrowseController extends DiffusionController {
'commit' => '', 'commit' => '',
'action' => 'browse', 'action' => 'browse',
)); ));
$view->addAction( $curtain->addAction(
id(new PhabricatorActionView()) id(new PhabricatorActionView())
->setName(pht('Jump to HEAD')) ->setName(pht('Jump to HEAD'))
->setHref($head_uri) ->setHref($head_uri)
->setIcon('fa-home') ->setIcon('fa-home')
->setDisabled(!$behind_head)); ->setDisabled(!$behind_head));
return $view; return $curtain;
} }
protected function buildPropertyView( protected function buildPropertyView(
DiffusionRequest $drequest, DiffusionRequest $drequest) {
PhabricatorActionListView $actions) {
$viewer = $this->getViewer(); $viewer = $this->getViewer();
$view = id(new PHUIPropertyListView()) $view = id(new PHUIPropertyListView())
->setUser($viewer) ->setUser($viewer);
->setActionList($actions);
$stable_commit = $drequest->getStableCommit();
$view->addProperty(
pht('Commit'),
phutil_tag(
'a',
array(
'href' => $drequest->generateURI(
array(
'action' => 'commit',
'commit' => $stable_commit,
)),
),
$drequest->getRepository()->formatCommitName($stable_commit)));
if ($drequest->getSymbolicType() == 'tag') { if ($drequest->getSymbolicType() == 'tag') {
$symbolic = $drequest->getSymbolicCommit(); $symbolic = $drequest->getSymbolicCommit();
@ -1616,47 +1676,11 @@ final class DiffusionBrowseController extends DiffusionController {
} }
} }
$repository = $drequest->getRepository(); if ($view->hasAnyProperties()) {
return $view;
$owners = 'PhabricatorOwnersApplication';
if (PhabricatorApplication::isClassInstalled($owners)) {
$package_query = id(new PhabricatorOwnersPackageQuery())
->setViewer($viewer)
->withStatuses(array(PhabricatorOwnersPackage::STATUS_ACTIVE))
->withControl(
$repository->getPHID(),
array(
$drequest->getPath(),
));
$package_query->execute();
$packages = $package_query->getControllingPackagesForPath(
$repository->getPHID(),
$drequest->getPath());
if ($packages) {
$ownership = id(new PHUIStatusListView())
->setUser($viewer);
foreach ($packages as $package) {
$icon = 'fa-list-alt';
$color = 'grey';
$item = id(new PHUIStatusItemView())
->setIcon($icon, $color)
->setTarget($viewer->renderHandle($package->getPHID()));
$ownership->addItem($item);
}
} else {
$ownership = phutil_tag('em', array(), pht('None'));
}
$view->addProperty(pht('Packages'), $ownership);
} }
return $view; return null;
} }
private function buildOpenRevisions() { private function buildOpenRevisions() {

View file

@ -15,8 +15,6 @@ final class DiffusionChangeController extends DiffusionController {
$viewer = $this->getViewer(); $viewer = $this->getViewer();
$drequest = $this->getDiffusionRequest(); $drequest = $this->getDiffusionRequest();
$content = array();
$data = $this->callConduitWithDiffusionRequest( $data = $this->callConduitWithDiffusionRequest(
'diffusion.diffquery', 'diffusion.diffquery',
array( array(
@ -42,9 +40,11 @@ final class DiffusionChangeController extends DiffusionController {
0 => $changeset, 0 => $changeset,
); );
$changeset_header = $this->buildChangesetHeader($drequest);
$changeset_view = new DifferentialChangesetListView(); $changeset_view = new DifferentialChangesetListView();
$changeset_view->setTitle(pht('Change'));
$changeset_view->setChangesets($changesets); $changeset_view->setChangesets($changesets);
$changeset_view->setBackground(PHUIObjectBoxView::BLUE_PROPERTY);
$changeset_view->setVisibleChangesets($changesets); $changeset_view->setVisibleChangesets($changesets);
$changeset_view->setRenderingReferences( $changeset_view->setRenderingReferences(
array( array(
@ -68,11 +68,11 @@ final class DiffusionChangeController extends DiffusionController {
$changeset_view->setWhitespace( $changeset_view->setWhitespace(
DifferentialChangesetParser::WHITESPACE_SHOW_ALL); DifferentialChangesetParser::WHITESPACE_SHOW_ALL);
$changeset_view->setUser($viewer); $changeset_view->setUser($viewer);
$changeset_view->setHeader($changeset_header);
// TODO: This is pretty awkward, unify the CSS between Diffusion and // TODO: This is pretty awkward, unify the CSS between Diffusion and
// Differential better. // Differential better.
require_celerity_resource('differential-core-view-css'); require_celerity_resource('differential-core-view-css');
$content[] = $changeset_view->render();
$crumbs = $this->buildCrumbs( $crumbs = $this->buildCrumbs(
array( array(
@ -80,19 +80,18 @@ final class DiffusionChangeController extends DiffusionController {
'path' => true, 'path' => true,
'view' => 'change', 'view' => 'change',
)); ));
$crumbs->setBorder(true);
$links = $this->renderPathLinks($drequest, $mode = 'browse'); $links = $this->renderPathLinks($drequest, $mode = 'browse');
$header = $this->buildHeader($drequest, $links);
$header = id(new PHUIHeaderView()) $view = id(new PHUITwoColumnView())
->setHeader($links)
->setUser($viewer)
->setPolicyObject($drequest->getRepository());
$actions = $this->buildActionView($drequest);
$properties = $this->buildPropertyView($drequest, $actions);
$object_box = id(new PHUIObjectBoxView())
->setHeader($header) ->setHeader($header)
->addPropertyList($properties); ->setMainColumn(array(
))
->setFooter(array(
$changeset_view,
));
return $this->newPage() return $this->newPage()
->setTitle( ->setTitle(
@ -103,25 +102,41 @@ final class DiffusionChangeController extends DiffusionController {
->setCrumbs($crumbs) ->setCrumbs($crumbs)
->appendChild( ->appendChild(
array( array(
$object_box, $view,
$content,
)); ));
} }
private function buildActionView(DiffusionRequest $drequest) { private function buildHeader(
$viewer = $this->getRequest()->getUser(); DiffusionRequest $drequest,
$links) {
$viewer = $this->getViewer();
$view = id(new PhabricatorActionListView()) $tag = $this->renderCommitHashTag($drequest);
->setUser($viewer);
$header = id(new PHUIHeaderView())
->setHeader($links)
->setUser($viewer)
->setPolicyObject($drequest->getRepository())
->addTag($tag);
return $header;
}
private function buildChangesetHeader(DiffusionRequest $drequest) {
$viewer = $this->getViewer();
$header = id(new PHUIHeaderView())
->setHeader(pht('Changes'));
$history_uri = $drequest->generateURI( $history_uri = $drequest->generateURI(
array( array(
'action' => 'history', 'action' => 'history',
)); ));
$view->addAction( $header->addActionLink(
id(new PhabricatorActionView()) id(new PHUIButtonView())
->setName(pht('View History')) ->setTag('a')
->setText(pht('View History'))
->setHref($history_uri) ->setHref($history_uri)
->setIcon('fa-clock-o')); ->setIcon('fa-clock-o'));
@ -130,13 +145,14 @@ final class DiffusionChangeController extends DiffusionController {
'action' => 'browse', 'action' => 'browse',
)); ));
$view->addAction( $header->addActionLink(
id(new PhabricatorActionView()) id(new PHUIButtonView())
->setName(pht('Browse Content')) ->setTag('a')
->setText(pht('Browse Content'))
->setHref($browse_uri) ->setHref($browse_uri)
->setIcon('fa-files-o')); ->setIcon('fa-files-o'));
return $view; return $header;
} }
protected function buildPropertyView( protected function buildPropertyView(

View file

@ -24,8 +24,7 @@ final class DiffusionCommitController extends DiffusionController {
} }
$drequest = $this->getDiffusionRequest(); $drequest = $this->getDiffusionRequest();
$viewer = $request->getUser();
$user = $request->getUser();
if ($request->getStr('diff')) { if ($request->getStr('diff')) {
return $this->buildRawDiffResponse($drequest); return $this->buildRawDiffResponse($drequest);
@ -33,9 +32,8 @@ final class DiffusionCommitController extends DiffusionController {
$repository = $drequest->getRepository(); $repository = $drequest->getRepository();
$content = array();
$commit = id(new DiffusionCommitQuery()) $commit = id(new DiffusionCommitQuery())
->setViewer($request->getUser()) ->setViewer($viewer)
->withRepository($repository) ->withRepository($repository)
->withIdentifiers(array($drequest->getCommit())) ->withIdentifiers(array($drequest->getCommit()))
->needCommitData(true) ->needCommitData(true)
@ -45,6 +43,7 @@ final class DiffusionCommitController extends DiffusionController {
$crumbs = $this->buildCrumbs(array( $crumbs = $this->buildCrumbs(array(
'commit' => true, 'commit' => true,
)); ));
$crumbs->setBorder(true);
if (!$commit) { if (!$commit) {
if (!$this->getCommitExists()) { if (!$this->getCommitExists()) {
@ -70,10 +69,11 @@ final class DiffusionCommitController extends DiffusionController {
$audit_requests = $commit->getAudits(); $audit_requests = $commit->getAudits();
$this->auditAuthorityPHIDs = $this->auditAuthorityPHIDs =
PhabricatorAuditCommentEditor::loadAuditPHIDsForUser($user); PhabricatorAuditCommentEditor::loadAuditPHIDsForUser($viewer);
$commit_data = $commit->getCommitData(); $commit_data = $commit->getCommitData();
$is_foreign = $commit_data->getCommitDetail('foreign-svn-stub'); $is_foreign = $commit_data->getCommitDetail('foreign-svn-stub');
$error_panel = null;
if ($is_foreign) { if ($is_foreign) {
$subpath = $commit_data->getCommitDetail('svn-subpath'); $subpath = $commit_data->getCommitDetail('svn-subpath');
@ -87,43 +87,41 @@ final class DiffusionCommitController extends DiffusionController {
"didn't affect the tracked subdirectory ('%s'), so no ". "didn't affect the tracked subdirectory ('%s'), so no ".
"information is available.", "information is available.",
$subpath)); $subpath));
$content[] = $error_panel;
} else { } else {
$engine = PhabricatorMarkupEngine::newDifferentialMarkupEngine(); $engine = PhabricatorMarkupEngine::newDifferentialMarkupEngine();
$engine->setConfig('viewer', $user); $engine->setConfig('viewer', $viewer);
$headsup_view = id(new PHUIHeaderView()) $commit_tag = $this->renderCommitHashTag($drequest);
$header = id(new PHUIHeaderView())
->setHeader(nonempty($commit->getSummary(), pht('Commit Detail'))) ->setHeader(nonempty($commit->getSummary(), pht('Commit Detail')))
->setSubheader(pht('Commit: %s', $commit->getCommitIdentifier())); ->setHeaderIcon('fa-code-fork')
->addTag($commit_tag);
$headsup_actions = $this->renderHeadsupActionList($commit, $repository); if ($commit->getAuditStatus()) {
$icon = PhabricatorAuditCommitStatusConstants::getStatusIcon(
$commit->getAuditStatus());
$color = PhabricatorAuditCommitStatusConstants::getStatusColor(
$commit->getAuditStatus());
$status = PhabricatorAuditCommitStatusConstants::getStatusName(
$commit->getAuditStatus());
$commit_properties = $this->loadCommitProperties( $header->setStatus($icon, $color, $status);
}
$curtain = $this->buildCurtain($commit, $repository);
$subheader = $this->buildSubheaderView($commit, $commit_data);
$details = $this->buildPropertyListView(
$commit, $commit,
$commit_data, $commit_data,
$audit_requests); $audit_requests);
$property_list = id(new PHUIPropertyListView())
->setHasKeyboardShortcuts(true)
->setUser($user)
->setObject($commit);
foreach ($commit_properties as $key => $value) {
$property_list->addProperty($key, $value);
}
$message = $commit_data->getCommitMessage(); $message = $commit_data->getCommitMessage();
$revision = $commit->getCommitIdentifier(); $revision = $commit->getCommitIdentifier();
$message = $this->linkBugtraq($message); $message = $this->linkBugtraq($message);
$message = $engine->markupText($message); $message = $engine->markupText($message);
$property_list->invokeWillRenderEvent();
$property_list->setActionList($headsup_actions);
$detail_list = new PHUIPropertyListView(); $detail_list = new PHUIPropertyListView();
$detail_list->addSectionHeader(
pht('Description'),
PHUIPropertyListView::ICON_SUMMARY);
$detail_list->addTextContent( $detail_list->addTextContent(
phutil_tag( phutil_tag(
'div', 'div',
@ -132,19 +130,14 @@ final class DiffusionCommitController extends DiffusionController {
), ),
$message)); $message));
$headsup_view->setTall(true); if ($this->getCommitErrors()) {
$error_panel = id(new PHUIInfoView())
$object_box = id(new PHUIObjectBoxView()) ->appendChild($this->getCommitErrors())
->setHeader($headsup_view) ->setSeverity(PHUIInfoView::SEVERITY_WARNING);
->setFormErrors($this->getCommitErrors()) }
->addPropertyList($property_list)
->addPropertyList($detail_list);
$content[] = $object_box;
} }
$content[] = $this->buildComments($commit); $timeline = $this->buildComments($commit);
$hard_limit = 1000; $hard_limit = 1000;
if ($commit->isImported()) { if ($commit->isImported()) {
@ -161,10 +154,10 @@ final class DiffusionCommitController extends DiffusionController {
$changes = array_slice($changes, 0, $hard_limit); $changes = array_slice($changes, 0, $hard_limit);
} }
$content[] = $this->buildMergesTable($commit); $merge_table = $this->buildMergesTable($commit);
$highlighted_audits = $commit->getAuthorityAudits( $highlighted_audits = $commit->getAuthorityAudits(
$user, $viewer,
$this->auditAuthorityPHIDs); $this->auditAuthorityPHIDs);
$count = count($changes); $count = count($changes);
@ -179,32 +172,35 @@ final class DiffusionCommitController extends DiffusionController {
} }
$show_changesets = false; $show_changesets = false;
$info_panel = null;
$change_list = null;
$change_table = null;
if ($bad_commit) { if ($bad_commit) {
$content[] = $this->renderStatusMessage( $info_panel = $this->renderStatusMessage(
pht('Bad Commit'), pht('Bad Commit'),
$bad_commit['description']); $bad_commit['description']);
} else if ($is_foreign) { } else if ($is_foreign) {
// Don't render anything else. // Don't render anything else.
} else if (!$commit->isImported()) { } else if (!$commit->isImported()) {
$content[] = $this->renderStatusMessage( $info_panel = $this->renderStatusMessage(
pht('Still Importing...'), pht('Still Importing...'),
pht( pht(
'This commit is still importing. Changes will be visible once '. 'This commit is still importing. Changes will be visible once '.
'the import finishes.')); 'the import finishes.'));
} else if (!count($changes)) { } else if (!count($changes)) {
$content[] = $this->renderStatusMessage( $info_panel = $this->renderStatusMessage(
pht('Empty Commit'), pht('Empty Commit'),
pht( pht(
'This commit is empty and does not affect any paths.')); 'This commit is empty and does not affect any paths.'));
} else if ($was_limited) { } else if ($was_limited) {
$content[] = $this->renderStatusMessage( $info_panel = $this->renderStatusMessage(
pht('Enormous Commit'), pht('Enormous Commit'),
pht( pht(
'This commit is enormous, and affects more than %d files. '. 'This commit is enormous, and affects more than %d files. '.
'Changes are not shown.', 'Changes are not shown.',
$hard_limit)); $hard_limit));
} else if (!$this->getCommitExists()) { } else if (!$this->getCommitExists()) {
$content[] = $this->renderStatusMessage( $info_panel = $this->renderStatusMessage(
pht('Commit No Longer Exists'), pht('Commit No Longer Exists'),
pht('This commit no longer exists in the repository.')); pht('This commit no longer exists in the repository.'));
} else { } else {
@ -214,7 +210,7 @@ final class DiffusionCommitController extends DiffusionController {
// changes inline even if there are more than the soft limit. // changes inline even if there are more than the soft limit.
$show_all_details = $request->getBool('show_all'); $show_all_details = $request->getBool('show_all');
$header = id(new PHUIHeaderView()) $change_header = id(new PHUIHeaderView())
->setHeader(pht('Changes (%s)', new PhutilNumber($count))); ->setHeader(pht('Changes (%s)', new PhutilNumber($count)));
$warning_view = null; $warning_view = null;
@ -228,24 +224,23 @@ final class DiffusionCommitController extends DiffusionController {
$warning_view = id(new PHUIInfoView()) $warning_view = id(new PHUIInfoView())
->setSeverity(PHUIInfoView::SEVERITY_WARNING) ->setSeverity(PHUIInfoView::SEVERITY_WARNING)
->setTitle(pht('Very Large Commit')) ->setTitle(pht('Very Large Commit'))
->addButton($button)
->appendChild( ->appendChild(
pht('This commit is very large. Load each file individually.')); pht('This commit is very large. Load each file individually.'));
$change_header->addActionLink($button);
} }
$changesets = DiffusionPathChange::convertToDifferentialChangesets( $changesets = DiffusionPathChange::convertToDifferentialChangesets(
$user, $viewer,
$changes); $changes);
// TODO: This table and panel shouldn't really be separate, but we need // TODO: This table and panel shouldn't really be separate, but we need
// to clean up the "Load All Files" interaction first. // to clean up the "Load All Files" interaction first.
$change_table = $this->buildTableOfContents( $change_table = $this->buildTableOfContents(
$changesets, $changesets,
$header, $change_header,
$warning_view); $warning_view);
$content[] = $change_table;
$vcs = $repository->getVersionControlSystem(); $vcs = $repository->getVersionControlSystem();
switch ($vcs) { switch ($vcs) {
case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN: case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN:
@ -291,7 +286,7 @@ final class DiffusionCommitController extends DiffusionController {
} else { } else {
$visible_changesets = array(); $visible_changesets = array();
$inlines = PhabricatorAuditInlineComment::loadDraftAndPublishedComments( $inlines = PhabricatorAuditInlineComment::loadDraftAndPublishedComments(
$user, $viewer,
$commit->getPHID()); $commit->getPHID());
$path_ids = mpull($inlines, null, 'getPathID'); $path_ids = mpull($inlines, null, 'getPathID');
foreach ($changesets as $key => $changeset) { foreach ($changesets as $key => $changeset) {
@ -308,10 +303,10 @@ final class DiffusionCommitController extends DiffusionController {
$change_list->setChangesets($changesets); $change_list->setChangesets($changesets);
$change_list->setVisibleChangesets($visible_changesets); $change_list->setVisibleChangesets($visible_changesets);
$change_list->setRenderingReferences($references); $change_list->setRenderingReferences($references);
$change_list->setRenderURI( $change_list->setRenderURI($repository->getPathURI('diff/'));
$repository->getPathURI('diff/'));
$change_list->setRepository($repository); $change_list->setRepository($repository);
$change_list->setUser($user); $change_list->setUser($viewer);
$change_list->setBackground(PHUIObjectBoxView::BLUE_PROPERTY);
// TODO: Try to setBranch() to something reasonable here? // TODO: Try to setBranch() to something reasonable here?
@ -327,48 +322,74 @@ final class DiffusionCommitController extends DiffusionController {
$change_list->setInlineCommentControllerURI( $change_list->setInlineCommentControllerURI(
'/diffusion/inline/edit/'.phutil_escape_uri($commit->getPHID()).'/'); '/diffusion/inline/edit/'.phutil_escape_uri($commit->getPHID()).'/');
$content[] = $change_list->render();
} }
$content[] = $this->renderAddCommentPanel($commit, $audit_requests); $add_comment = $this->renderAddCommentPanel($commit, $audit_requests);
$prefs = $user->loadPreferences(); $prefs = $viewer->loadPreferences();
$pref_filetree = PhabricatorUserPreferences::PREFERENCE_DIFF_FILETREE; $pref_filetree = PhabricatorUserPreferences::PREFERENCE_DIFF_FILETREE;
$pref_collapse = PhabricatorUserPreferences::PREFERENCE_NAV_COLLAPSED; $pref_collapse = PhabricatorUserPreferences::PREFERENCE_NAV_COLLAPSED;
$show_filetree = $prefs->getPreference($pref_filetree); $show_filetree = $prefs->getPreference($pref_filetree);
$collapsed = $prefs->getPreference($pref_collapse); $collapsed = $prefs->getPreference($pref_collapse);
$nav = null;
if ($show_changesets && $show_filetree) { if ($show_changesets && $show_filetree) {
$nav = id(new DifferentialChangesetFileTreeSideNavBuilder()) $nav = id(new DifferentialChangesetFileTreeSideNavBuilder())
->setTitle($commit->getDisplayName()) ->setTitle($commit->getDisplayName())
->setBaseURI(new PhutilURI($commit->getURI())) ->setBaseURI(new PhutilURI($commit->getURI()))
->build($changesets) ->build($changesets)
->setCrumbs($crumbs) ->setCrumbs($crumbs)
->setCollapsed((bool)$collapsed) ->setCollapsed((bool)$collapsed);
->appendChild($content);
$content = $nav;
} else {
$content = array($crumbs, $content);
} }
return $this->buildApplicationPage( $view = id(new PHUITwoColumnView())
$content, ->setHeader($header)
array( ->setSubheader($subheader)
'title' => $commit->getDisplayName(), ->setMainColumn(array(
'pageObjects' => array($commit->getPHID()), $error_panel,
$timeline,
$merge_table,
$info_panel,
))
->setFooter(array(
$change_table,
$change_list,
$add_comment,
))
->addPropertySection(pht('DESCRIPTION'), $detail_list)
->addPropertySection(pht('DETAILS'), $details)
->setCurtain($curtain);
$page = $this->newPage()
->setTitle($commit->getDisplayName())
->setCrumbs($crumbs)
->setPageObjectPHIDS(array($commit->getPHID()))
->appendChild(
array(
$view,
)); ));
if ($nav) {
$page->setNavigation($nav);
}
return $page;
} }
private function loadCommitProperties( private function buildPropertyListView(
PhabricatorRepositoryCommit $commit, PhabricatorRepositoryCommit $commit,
PhabricatorRepositoryCommitData $data, PhabricatorRepositoryCommitData $data,
array $audit_requests) { array $audit_requests) {
$viewer = $this->getRequest()->getUser(); $viewer = $this->getViewer();
$commit_phid = $commit->getPHID(); $commit_phid = $commit->getPHID();
$drequest = $this->getDiffusionRequest(); $drequest = $this->getDiffusionRequest();
$repository = $drequest->getRepository(); $repository = $drequest->getRepository();
$view = id(new PHUIPropertyListView())
->setUser($this->getRequest()->getUser());
$edge_query = id(new PhabricatorEdgeQuery()) $edge_query = id(new PhabricatorEdgeQuery())
->withSourcePHIDs(array($commit_phid)) ->withSourcePHIDs(array($commit_phid))
->withEdgeTypes(array( ->withEdgeTypes(array(
@ -432,31 +453,6 @@ final class DiffusionCommitController extends DiffusionController {
$props = array(); $props = array();
if ($commit->getAuditStatus()) {
$status = PhabricatorAuditCommitStatusConstants::getStatusName(
$commit->getAuditStatus());
$tag = id(new PHUITagView())
->setType(PHUITagView::TYPE_STATE)
->setName($status);
switch ($commit->getAuditStatus()) {
case PhabricatorAuditCommitStatusConstants::NEEDS_AUDIT:
$tag->setBackgroundColor(PHUITagView::COLOR_ORANGE);
break;
case PhabricatorAuditCommitStatusConstants::CONCERN_RAISED:
$tag->setBackgroundColor(PHUITagView::COLOR_RED);
break;
case PhabricatorAuditCommitStatusConstants::PARTIALLY_AUDITED:
$tag->setBackgroundColor(PHUITagView::COLOR_BLUE);
break;
case PhabricatorAuditCommitStatusConstants::FULLY_AUDITED:
$tag->setBackgroundColor(PHUITagView::COLOR_GREEN);
break;
}
$props['Status'] = $tag;
}
if ($audit_requests) { if ($audit_requests) {
$user_requests = array(); $user_requests = array();
$other_requests = array(); $other_requests = array();
@ -469,37 +465,21 @@ final class DiffusionCommitController extends DiffusionController {
} }
if ($user_requests) { if ($user_requests) {
$props['Auditors'] = $this->renderAuditStatusView( $view->addProperty(
$user_requests); pht('Auditors'),
$this->renderAuditStatusView($user_requests));
} }
if ($other_requests) { if ($other_requests) {
$props['Project/Package Auditors'] = $this->renderAuditStatusView( $view->addProperty(
$other_requests); pht('Project/Package Auditors'),
$this->renderAuditStatusView($other_requests));
} }
} }
$author_phid = $data->getCommitDetail('authorPHID'); $author_phid = $data->getCommitDetail('authorPHID');
$author_name = $data->getAuthorName(); $author_name = $data->getAuthorName();
$author_epoch = $data->getCommitDetail('authorEpoch');
if (!$repository->isSVN()) {
$authored_info = id(new PHUIStatusItemView());
$author_epoch = $data->getCommitDetail('authorEpoch');
if ($author_epoch !== null) {
$authored_info->setNote(
phabricator_datetime($author_epoch, $viewer));
}
if ($author_phid) {
$authored_info->setTarget($handles[$author_phid]->renderLink());
} else if (strlen($author_name)) {
$authored_info->setTarget($author_name);
}
$props['Authored'] = id(new PHUIStatusListView())
->addItem($authored_info);
}
$committed_info = id(new PHUIStatusItemView()) $committed_info = id(new PHUIStatusItemView())
->setNote(phabricator_datetime($commit->getEpoch(), $viewer)); ->setNote(phabricator_datetime($commit->getEpoch(), $viewer));
@ -516,8 +496,9 @@ final class DiffusionCommitController extends DiffusionController {
$committed_info->setTarget($author_name); $committed_info->setTarget($author_name);
} }
$props['Committed'] = id(new PHUIStatusListView()) $view->addProperty(
->addItem($committed_info); pht('Committed'),
$committed_info);
if ($push_logs) { if ($push_logs) {
$pushed_list = new PHUIStatusListView(); $pushed_list = new PHUIStatusListView();
@ -529,36 +510,49 @@ final class DiffusionCommitController extends DiffusionController {
$pushed_list->addItem($pushed_item); $pushed_list->addItem($pushed_item);
} }
$props['Pushed'] = $pushed_list; $view->addProperty(
pht('Pushed'),
$pushed_list);
} }
$reviewer_phid = $data->getCommitDetail('reviewerPHID'); $reviewer_phid = $data->getCommitDetail('reviewerPHID');
if ($reviewer_phid) { if ($reviewer_phid) {
$props['Reviewer'] = $handles[$reviewer_phid]->renderLink(); $view->addProperty(
pht('Reviewer'),
$handles[$reviewer_phid]->renderLink());
} }
if ($revision_phid) { if ($revision_phid) {
$props['Differential Revision'] = $handles[$revision_phid]->renderLink(); $view->addProperty(
pht('Differential Revision'),
$handles[$revision_phid]->renderLink());
} }
$parents = $this->getCommitParents(); $parents = $this->getCommitParents();
if ($parents) { if ($parents) {
$props['Parents'] = $viewer->renderHandleList(mpull($parents, 'getPHID')); $view->addProperty(
pht('Parents'),
$viewer->renderHandleList(mpull($parents, 'getPHID')));
} }
if ($this->getCommitExists()) { if ($this->getCommitExists()) {
$props['Branches'] = phutil_tag( $view->addProperty(
pht('Branches'),
phutil_tag(
'span', 'span',
array( array(
'id' => 'commit-branches', 'id' => 'commit-branches',
), ),
pht('Unknown')); pht('Unknown')));
$props['Tags'] = phutil_tag(
$view->addProperty(
pht('Tags'),
phutil_tag(
'span', 'span',
array( array(
'id' => 'commit-tags', 'id' => 'commit-tags',
), ),
pht('Unknown')); pht('Unknown')));
$identifier = $commit->getCommitIdentifier(); $identifier = $commit->getCommitIdentifier();
$root = $repository->getPathURI("commit/{$identifier}"); $root = $repository->getPathURI("commit/{$identifier}");
@ -581,16 +575,21 @@ final class DiffusionCommitController extends DiffusionController {
), ),
$ref_data['ref']); $ref_data['ref']);
} }
$props['References'] = phutil_implode_html(', ', $ref_links); $view->addProperty(
pht('References'),
phutil_implode_html(', ', $ref_links));
} }
if ($reverts_phids) { if ($reverts_phids) {
$props[pht('Reverts')] = $viewer->renderHandleList($reverts_phids); $view->addProperty(
pht('Reverts'),
$viewer->renderHandleList($reverts_phids));
} }
if ($reverted_by_phids) { if ($reverted_by_phids) {
$props[pht('Reverted By')] = $viewer->renderHandleList( $view->addProperty(
$reverted_by_phids); pht('Reverted By'),
$viewer->renderHandleList($reverted_by_phids));
} }
if ($task_phids) { if ($task_phids) {
@ -599,12 +598,60 @@ final class DiffusionCommitController extends DiffusionController {
$task_list[] = $handles[$phid]->renderLink(); $task_list[] = $handles[$phid]->renderLink();
} }
$task_list = phutil_implode_html(phutil_tag('br'), $task_list); $task_list = phutil_implode_html(phutil_tag('br'), $task_list);
$props['Tasks'] = $task_list; $view->addProperty(
pht('Tasks'),
$task_list);
} }
return $props; return $view;
} }
private function buildSubheaderView(
PhabricatorRepositoryCommit $commit,
PhabricatorRepositoryCommitData $data) {
$viewer = $this->getViewer();
$drequest = $this->getDiffusionRequest();
$repository = $drequest->getRepository();
if ($repository->isSVN()) {
return null;
}
$author_phid = $data->getCommitDetail('authorPHID');
$author_name = $data->getAuthorName();
$author_epoch = $data->getCommitDetail('authorEpoch');
$date = null;
if ($author_epoch !== null) {
$date = phabricator_datetime($author_epoch, $viewer);
}
if ($author_phid) {
$handles = $viewer->loadHandles(array($author_phid));
$image_uri = $handles[$author_phid]->getImageURI();
$image_href = $handles[$author_phid]->getURI();
$author = $handles[$author_phid]->renderLink();
} else if (strlen($author_name)) {
$author = $author_name;
$image_uri = null;
$image_href = null;
}
$author = phutil_tag('strong', array(), $author);
if ($date) {
$content = pht('Authored by %s on %s.', $author, $date);
} else {
$content = pht('Authored by %s.', $author);
}
return id(new PHUIHeadThingView())
->setImage($image_uri)
->setImageHref($image_href)
->setContent($content);
}
private function buildComments(PhabricatorRepositoryCommit $commit) { private function buildComments(PhabricatorRepositoryCommit $commit) {
$timeline = $this->buildTransactionTimeline( $timeline = $this->buildTransactionTimeline(
$commit, $commit,
@ -619,11 +666,11 @@ final class DiffusionCommitController extends DiffusionController {
assert_instances_of($audit_requests, 'PhabricatorRepositoryAuditRequest'); assert_instances_of($audit_requests, 'PhabricatorRepositoryAuditRequest');
$request = $this->getRequest(); $request = $this->getRequest();
$user = $request->getUser(); $viewer = $request->getUser();
if (!$user->isLoggedIn()) { if (!$viewer->isLoggedIn()) {
return id(new PhabricatorApplicationTransactionCommentView()) return id(new PhabricatorApplicationTransactionCommentView())
->setUser($user) ->setUser($viewer)
->setRequestURI($request->getRequestURI()); ->setRequestURI($request->getRequestURI());
} }
@ -638,7 +685,7 @@ final class DiffusionCommitController extends DiffusionController {
$draft = id(new PhabricatorDraft())->loadOneWhere( $draft = id(new PhabricatorDraft())->loadOneWhere(
'authorPHID = %s AND draftKey = %s', 'authorPHID = %s AND draftKey = %s',
$user->getPHID(), $viewer->getPHID(),
'diffusion-audit-'.$commit->getID()); 'diffusion-audit-'.$commit->getID());
if ($draft) { if ($draft) {
$draft = $draft->getDraft(); $draft = $draft->getDraft();
@ -652,7 +699,7 @@ final class DiffusionCommitController extends DiffusionController {
$auditor_source = new DiffusionAuditorDatasource(); $auditor_source = new DiffusionAuditorDatasource();
$form = id(new AphrontFormView()) $form = id(new AphrontFormView())
->setUser($user) ->setUser($viewer)
->setAction('/audit/addcomment/') ->setAction('/audit/addcomment/')
->addHiddenInput('commit', $commit->getPHID()) ->addHiddenInput('commit', $commit->getPHID())
->appendChild( ->appendChild(
@ -685,7 +732,7 @@ final class DiffusionCommitController extends DiffusionController {
->setName('content') ->setName('content')
->setValue($draft) ->setValue($draft)
->setID('audit-content') ->setID('audit-content')
->setUser($user)) ->setUser($viewer))
->appendChild( ->appendChild(
id(new AphrontFormSubmitControl()) id(new AphrontFormSubmitControl())
->setValue(pht('Submit'))); ->setValue(pht('Submit')));
@ -771,13 +818,13 @@ final class DiffusionCommitController extends DiffusionController {
PhabricatorRepositoryCommit $commit, PhabricatorRepositoryCommit $commit,
array $audit_requests) { array $audit_requests) {
assert_instances_of($audit_requests, 'PhabricatorRepositoryAuditRequest'); assert_instances_of($audit_requests, 'PhabricatorRepositoryAuditRequest');
$user = $this->getRequest()->getUser(); $viewer = $this->getViewer();
$user_is_author = ($commit->getAuthorPHID() == $user->getPHID()); $user_is_author = ($commit->getAuthorPHID() == $viewer->getPHID());
$user_request = null; $user_request = null;
foreach ($audit_requests as $audit_request) { foreach ($audit_requests as $audit_request) {
if ($audit_request->getAuditorPHID() == $user->getPHID()) { if ($audit_request->getAuditorPHID() == $viewer->getPHID()) {
$user_request = $audit_request; $user_request = $audit_request;
break; break;
} }
@ -871,9 +918,10 @@ final class DiffusionCommitController extends DiffusionController {
$history_table->loadRevisions(); $history_table->loadRevisions();
$panel = new PHUIObjectBoxView(); $panel = id(new PHUIObjectBoxView())
$panel->setHeaderText(pht('Merged Changes')); ->setHeaderText(pht('Merged Changes'))
$panel->setTable($history_table); ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setTable($history_table);
if ($caption) { if ($caption) {
$panel->setInfoView($caption); $panel->setInfoView($caption);
} }
@ -881,19 +929,16 @@ final class DiffusionCommitController extends DiffusionController {
return $panel; return $panel;
} }
private function renderHeadsupActionList( private function buildCurtain(
PhabricatorRepositoryCommit $commit, PhabricatorRepositoryCommit $commit,
PhabricatorRepository $repository) { PhabricatorRepository $repository) {
$request = $this->getRequest(); $request = $this->getRequest();
$user = $request->getUser(); $viewer = $this->getViewer();
$curtain = $this->newCurtainView($commit);
$actions = id(new PhabricatorActionListView())
->setUser($user)
->setObject($commit);
$can_edit = PhabricatorPolicyFilter::hasCapability( $can_edit = PhabricatorPolicyFilter::hasCapability(
$user, $viewer,
$commit, $commit,
PhabricatorPolicyCapability::CAN_EDIT); PhabricatorPolicyCapability::CAN_EDIT);
@ -906,7 +951,7 @@ final class DiffusionCommitController extends DiffusionController {
->setIcon('fa-pencil') ->setIcon('fa-pencil')
->setDisabled(!$can_edit) ->setDisabled(!$can_edit)
->setWorkflow(!$can_edit); ->setWorkflow(!$can_edit);
$actions->addAction($action); $curtain->addAction($action);
require_celerity_resource('phabricator-object-selector-css'); require_celerity_resource('phabricator-object-selector-css');
require_celerity_resource('javelin-behavior-phabricator-object-selector'); require_celerity_resource('javelin-behavior-phabricator-object-selector');
@ -919,16 +964,16 @@ final class DiffusionCommitController extends DiffusionController {
->setHref('/search/attach/'.$commit->getPHID().'/TASK/edge/') ->setHref('/search/attach/'.$commit->getPHID().'/TASK/edge/')
->setWorkflow(true) ->setWorkflow(true)
->setDisabled(!$can_edit); ->setDisabled(!$can_edit);
$actions->addAction($action); $curtain->addAction($action);
} }
$action = id(new PhabricatorActionView()) $action = id(new PhabricatorActionView())
->setName(pht('Download Raw Diff')) ->setName(pht('Download Raw Diff'))
->setHref($request->getRequestURI()->alter('diff', true)) ->setHref($request->getRequestURI()->alter('diff', true))
->setIcon('fa-download'); ->setIcon('fa-download');
$actions->addAction($action); $curtain->addAction($action);
return $actions; return $curtain;
} }
private function buildRawDiffResponse(DiffusionRequest $drequest) { private function buildRawDiffResponse(DiffusionRequest $drequest) {
@ -1022,7 +1067,8 @@ final class DiffusionCommitController extends DiffusionController {
$toc_view = id(new PHUIDiffTableOfContentsListView()) $toc_view = id(new PHUIDiffTableOfContentsListView())
->setUser($viewer) ->setUser($viewer)
->setHeader($header); ->setHeader($header)
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY);
if ($info_view) { if ($info_view) {
$toc_view->setInfoView($info_view); $toc_view->setInfoView($info_view);

View file

@ -291,6 +291,7 @@ abstract class DiffusionController extends PhabricatorController {
return id(new PHUIInfoView()) return id(new PHUIInfoView())
->setSeverity(PHUIInfoView::SEVERITY_WARNING) ->setSeverity(PHUIInfoView::SEVERITY_WARNING)
->setTitle($title) ->setTitle($title)
->setFlush(true)
->appendChild($body); ->appendChild($body);
} }
@ -300,6 +301,27 @@ abstract class DiffusionController extends PhabricatorController {
->appendChild($pager); ->appendChild($pager);
} }
protected function renderCommitHashTag(DiffusionRequest $drequest) {
$stable_commit = $drequest->getStableCommit();
$commit = phutil_tag(
'a',
array(
'href' => $drequest->generateURI(
array(
'action' => 'commit',
'commit' => $stable_commit,
)),
),
$drequest->getRepository()->formatCommitName($stable_commit, true));
$tag = id(new PHUITagView())
->setName($commit)
->setShade('indigo')
->setType(PHUITagView::TYPE_SHADE);
return $tag;
}
protected function renderDirectoryReadme(DiffusionBrowseResultSet $browse) { protected function renderDirectoryReadme(DiffusionBrowseResultSet $browse) {
$readme_path = $browse->getReadmePath(); $readme_path = $browse->getReadmePath();
if ($readme_path === null) { if ($readme_path === null) {

View file

@ -40,8 +40,6 @@ final class DiffusionHistoryController extends DiffusionController {
$history = $pager->sliceResults($history); $history = $pager->sliceResults($history);
$show_graph = !strlen($drequest->getPath()); $show_graph = !strlen($drequest->getPath());
$content = array();
$history_table = id(new DiffusionHistoryTableView()) $history_table = id(new DiffusionHistoryTableView())
->setUser($request->getUser()) ->setUser($request->getUser())
->setDiffusionRequest($drequest) ->setDiffusionRequest($drequest)
@ -55,23 +53,13 @@ final class DiffusionHistoryController extends DiffusionController {
$history_table->setIsTail(!$pager->getHasMorePages()); $history_table->setIsTail(!$pager->getHasMorePages());
} }
$history_panel = new PHUIObjectBoxView(); $history_header = $this->buildHistoryHeader($drequest);
$history_panel->setHeaderText(pht('History')); $history_panel = id(new PHUIObjectBoxView())
$history_panel->setTable($history_table); ->setHeader($history_header)
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setTable($history_table);
$content[] = $history_panel; $header = $this->buildHeader($drequest, $repository);
$header = id(new PHUIHeaderView())
->setUser($viewer)
->setPolicyObject($repository)
->setHeader($this->renderPathLinks($drequest, $mode = 'history'));
$actions = $this->buildActionView($drequest);
$properties = $this->buildPropertyView($drequest, $actions);
$object_box = id(new PHUIObjectBoxView())
->setHeader($header)
->addPropertyList($properties);
$crumbs = $this->buildCrumbs( $crumbs = $this->buildCrumbs(
array( array(
@ -79,9 +67,17 @@ final class DiffusionHistoryController extends DiffusionController {
'path' => true, 'path' => true,
'view' => 'history', 'view' => 'history',
)); ));
$crumbs->setBorder(true);
$pager_box = $this->renderTablePagerBox($pager); $pager_box = $this->renderTablePagerBox($pager);
$view = id(new PHUITwoColumnView())
->setHeader($header)
->setFooter(array(
$history_panel,
$pager_box,
));
return $this->newPage() return $this->newPage()
->setTitle( ->setTitle(
array( array(
@ -91,28 +87,39 @@ final class DiffusionHistoryController extends DiffusionController {
->setCrumbs($crumbs) ->setCrumbs($crumbs)
->appendChild( ->appendChild(
array( array(
$object_box, $view,
$content,
$pager_box,
)); ));
} }
private function buildActionView(DiffusionRequest $drequest) { private function buildHeader(DiffusionRequest $drequest) {
$viewer = $this->getRequest()->getUser(); $viewer = $this->getViewer();
$view = id(new PhabricatorActionListView()) $tag = $this->renderCommitHashTag($drequest);
->setUser($viewer);
$header = id(new PHUIHeaderView())
->setUser($viewer)
->setPolicyObject($drequest->getRepository())
->addTag($tag)
->setHeader($this->renderPathLinks($drequest, $mode = 'history'))
->setHeaderIcon('fa-clock-o');
return $header;
}
private function buildHistoryHeader(DiffusionRequest $drequest) {
$viewer = $this->getViewer();
$browse_uri = $drequest->generateURI( $browse_uri = $drequest->generateURI(
array( array(
'action' => 'browse', 'action' => 'browse',
)); ));
$view->addAction( $browse_button = id(new PHUIButtonView())
id(new PhabricatorActionView()) ->setTag('a')
->setName(pht('Browse Content')) ->setText(pht('Browse'))
->setHref($browse_uri) ->setHref($browse_uri)
->setIcon('fa-files-o')); ->setIcon('fa-files-o');
// TODO: Sometimes we do have a change view, we need to look at the most // TODO: Sometimes we do have a change view, we need to look at the most
// recent history entry to figure it out. // recent history entry to figure it out.
@ -130,41 +137,18 @@ final class DiffusionHistoryController extends DiffusionController {
->alter('copies', true); ->alter('copies', true);
} }
$view->addAction( $branch_button = id(new PHUIButtonView())
id(new PhabricatorActionView()) ->setTag('a')
->setName($branch_name) ->setText($branch_name)
->setIcon('fa-code-fork') ->setIcon('fa-code-fork')
->setHref($branch_uri)); ->setHref($branch_uri);
return $view; $header = id(new PHUIHeaderView())
} ->setHeader(pht('History'))
->addActionLink($browse_button)
->addActionLink($branch_button);
protected function buildPropertyView( return $header;
DiffusionRequest $drequest,
PhabricatorActionListView $actions) {
$viewer = $this->getRequest()->getUser();
$view = id(new PHUIPropertyListView())
->setUser($viewer)
->setActionList($actions);
$stable_commit = $drequest->getStableCommit();
$view->addProperty(
pht('Commit'),
phutil_tag(
'a',
array(
'href' => $drequest->generateURI(
array(
'action' => 'commit',
'commit' => $stable_commit,
)),
),
$drequest->getRepository()->formatCommitName($stable_commit)));
return $view;
} }
} }

View file

@ -157,6 +157,7 @@ final class DiffusionLintController extends DiffusionController {
$content[] = id(new PHUIObjectBoxView()) $content[] = id(new PHUIObjectBoxView())
->setHeaderText(pht('Lint')) ->setHeaderText(pht('Lint'))
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setTable($table); ->setTable($table);
$title = array('Lint'); $title = array('Lint');
@ -179,7 +180,7 @@ final class DiffusionLintController extends DiffusionController {
$header = id(new PHUIHeaderView()) $header = id(new PHUIHeaderView())
->setHeader($this->renderPathLinks($drequest, 'lint')) ->setHeader($this->renderPathLinks($drequest, 'lint'))
->setUser($viewer) ->setUser($viewer)
->setPolicyObject($drequest->getRepository()); ->setHeaderIcon('fa-code');
$actions = $this->buildActionView($drequest); $actions = $this->buildActionView($drequest);
$properties = $this->buildPropertyView( $properties = $this->buildPropertyView(
$drequest, $drequest,
@ -189,18 +190,28 @@ final class DiffusionLintController extends DiffusionController {
$object_box = id(new PHUIObjectBoxView()) $object_box = id(new PHUIObjectBoxView())
->setHeader($header) ->setHeader($header)
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->addPropertyList($properties); ->addPropertyList($properties);
} else { } else {
$object_box = null; $object_box = null;
$header = id(new PHUIHeaderView())
->setHeader(pht('All Lint'))
->setHeaderIcon('fa-code');
} }
$view = id(new PHUITwoColumnView())
->setHeader($header)
->setFooter(array(
$object_box,
$content,
));
return $this->newPage() return $this->newPage()
->setTitle($title) ->setTitle($title)
->setCrumbs($crumbs) ->setCrumbs($crumbs)
->appendChild( ->appendChild(
array( array(
$object_box, $view,
$content,
)); ));
} }
@ -444,6 +455,7 @@ final class DiffusionLintController extends DiffusionController {
$content[] = id(new PHUIObjectBoxView()) $content[] = id(new PHUIObjectBoxView())
->setHeaderText(pht('Lint Details')) ->setHeaderText(pht('Lint Details'))
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setTable($table); ->setTable($table);
$crumbs = $this->buildCrumbs( $crumbs = $this->buildCrumbs(
@ -454,6 +466,16 @@ final class DiffusionLintController extends DiffusionController {
)); ));
$pager_box = $this->renderTablePagerBox($pager); $pager_box = $this->renderTablePagerBox($pager);
$header = id(new PHUIHeaderView())
->setHeader(pht('Lint: %s', $drequest->getRepository()->getDisplayName()))
->setHeaderIcon('fa-code');
$view = id(new PHUITwoColumnView())
->setHeader($header)
->setFooter(array(
$content,
$pager_box,
));
return $this->newPage() return $this->newPage()
->setTitle( ->setTitle(
@ -464,8 +486,7 @@ final class DiffusionLintController extends DiffusionController {
->setCrumbs($crumbs) ->setCrumbs($crumbs)
->appendChild( ->appendChild(
array( array(
$content, $view,
$pager_box,
)); ));
} }

View file

@ -16,11 +16,14 @@ final class DiffusionRepositoryController extends DiffusionController {
$drequest = $this->getDiffusionRequest(); $drequest = $this->getDiffusionRequest();
$repository = $drequest->getRepository(); $repository = $drequest->getRepository();
$content = array();
$crumbs = $this->buildCrumbs(); $crumbs = $this->buildCrumbs();
$crumbs->setBorder(true);
$content[] = $this->buildPropertiesTable($drequest->getRepository()); $header = $this->buildHeaderView($repository);
$curtain = $this->buildCurtain($repository);
$property_table = $this->buildPropertiesTable($repository);
$description = $this->buildDescriptionView($repository);
$locate_file = $this->buildLocateFile();
// Before we do any work, make sure we're looking at a some content: we're // Before we do any work, make sure we're looking at a some content: we're
// on a valid branch, and the repository is not empty. // on a valid branch, and the repository is not empty.
@ -68,14 +71,24 @@ final class DiffusionRepositoryController extends DiffusionController {
} }
if ($page_has_content) { if ($page_has_content) {
$content[] = $this->buildNormalContent($drequest); $content = $this->buildNormalContent($drequest);
} else { } else {
$content[] = id(new PHUIInfoView()) $content = id(new PHUIInfoView())
->setTitle($empty_title) ->setTitle($empty_title)
->setSeverity(PHUIInfoView::SEVERITY_WARNING) ->setSeverity(PHUIInfoView::SEVERITY_WARNING)
->setErrors(array($empty_message)); ->setErrors(array($empty_message));
} }
$view = id(new PHUITwoColumnView())
->setHeader($header)
->setCurtain($curtain)
->setMainColumn(array(
$property_table,
$description,
$locate_file,
))
->setFooter($content);
return $this->newPage() return $this->newPage()
->setTitle( ->setTitle(
array( array(
@ -83,7 +96,9 @@ final class DiffusionRepositoryController extends DiffusionController {
$repository->getDisplayName(), $repository->getDisplayName(),
)) ))
->setCrumbs($crumbs) ->setCrumbs($crumbs)
->appendChild($content); ->appendChild(array(
$view,
));
} }
@ -206,13 +221,13 @@ final class DiffusionRepositoryController extends DiffusionController {
return $content; return $content;
} }
private function buildPropertiesTable(PhabricatorRepository $repository) { private function buildHeaderView(PhabricatorRepository $repository) {
$user = $this->getRequest()->getUser(); $viewer = $this->getViewer();
$header = id(new PHUIHeaderView()) $header = id(new PHUIHeaderView())
->setHeader($repository->getName()) ->setHeader($repository->getName())
->setUser($user) ->setUser($viewer)
->setPolicyObject($repository); ->setPolicyObject($repository)
->setHeaderIcon('fa-code');
if (!$repository->isTracked()) { if (!$repository->isTracked()) {
$header->setStatus('fa-ban', 'dark', pht('Inactive')); $header->setStatus('fa-ban', 'dark', pht('Inactive'));
@ -227,12 +242,64 @@ final class DiffusionRepositoryController extends DiffusionController {
$header->setStatus('fa-check', 'bluegrey', pht('Active')); $header->setStatus('fa-check', 'bluegrey', pht('Active'));
} }
return $header;
}
$actions = $this->buildActionList($repository); private function buildCurtain(PhabricatorRepository $repository) {
$viewer = $this->getViewer();
$edit_uri = $repository->getPathURI('edit/');
$curtain = $this->newCurtainView($repository);
$can_edit = PhabricatorPolicyFilter::hasCapability(
$viewer,
$repository,
PhabricatorPolicyCapability::CAN_EDIT);
$curtain->addAction(
id(new PhabricatorActionView())
->setName(pht('Edit Repository'))
->setIcon('fa-pencil')
->setHref($edit_uri)
->setWorkflow(!$can_edit)
->setDisabled(!$can_edit));
if ($repository->isHosted()) {
$push_uri = $this->getApplicationURI(
'pushlog/?repositories='.$repository->getMonogram());
$curtain->addAction(
id(new PhabricatorActionView())
->setName(pht('View Push Logs'))
->setIcon('fa-list-alt')
->setHref($push_uri));
}
return $curtain;
}
private function buildDescriptionView(PhabricatorRepository $repository) {
$viewer = $this->getViewer();
$view = id(new PHUIPropertyListView())
->setUser($viewer);
$description = $repository->getDetail('description');
if (strlen($description)) {
$description = new PHUIRemarkupView($viewer, $description);
$view->addTextContent($description);
return id(new PHUIObjectBoxView())
->setHeaderText(pht('DESCRIPTION'))
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->appendChild($view);
}
return null;
}
private function buildPropertiesTable(PhabricatorRepository $repository) {
$viewer = $this->getViewer();
$view = id(new PHUIPropertyListView()) $view = id(new PHUIPropertyListView())
->setObject($repository) ->setUser($viewer);
->setUser($user);
if ($repository->isHosted()) { if ($repository->isHosted()) {
$ssh_uri = $repository->getSSHCloneURIObject(); $ssh_uri = $repository->getSSHCloneURIObject();
@ -286,21 +353,10 @@ final class DiffusionRepositoryController extends DiffusionController {
} }
} }
$view->invokeWillRenderEvent();
$description = $repository->getDetail('description');
if (strlen($description)) {
$description = new PHUIRemarkupView($user, $description);
$view->addSectionHeader(
pht('Description'), PHUIPropertyListView::ICON_SUMMARY);
$view->addTextContent($description);
}
$view->setActionList($actions);
$box = id(new PHUIObjectBoxView()) $box = id(new PHUIObjectBoxView())
->setHeader($header) ->setHeaderText(pht('DETAILS'))
->addPropertyList($view); ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->appendChild($view);
$info = null; $info = null;
$drequest = $this->getDiffusionRequest(); $drequest = $this->getDiffusionRequest();
@ -344,7 +400,7 @@ final class DiffusionRepositoryController extends DiffusionController {
} }
private function buildBranchListTable(DiffusionRequest $drequest) { private function buildBranchListTable(DiffusionRequest $drequest) {
$viewer = $this->getRequest()->getUser(); $viewer = $this->getViewer();
if ($drequest->getBranch() === null) { if ($drequest->getBranch() === null) {
return null; return null;
@ -379,7 +435,8 @@ final class DiffusionRepositoryController extends DiffusionController {
->setBranches($branches) ->setBranches($branches)
->setCommits($commits); ->setCommits($commits);
$panel = new PHUIObjectBoxView(); $panel = id(new PHUIObjectBoxView())
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY);
$header = new PHUIHeaderView(); $header = new PHUIHeaderView();
$header->setHeader(pht('Branches')); $header->setHeader(pht('Branches'));
@ -388,7 +445,7 @@ final class DiffusionRepositoryController extends DiffusionController {
} }
$button = new PHUIButtonView(); $button = new PHUIButtonView();
$button->setText(pht('Show All Branches')); $button->setText(pht('Show All'));
$button->setTag('a'); $button->setTag('a');
$button->setIcon('fa-code-fork'); $button->setIcon('fa-code-fork');
$button->setHref($drequest->generateURI( $button->setHref($drequest->generateURI(
@ -404,7 +461,7 @@ final class DiffusionRepositoryController extends DiffusionController {
} }
private function buildTagListTable(DiffusionRequest $drequest) { private function buildTagListTable(DiffusionRequest $drequest) {
$viewer = $this->getRequest()->getUser(); $viewer = $this->getViewer();
$repository = $drequest->getRepository(); $repository = $drequest->getRepository();
switch ($repository->getVersionControlSystem()) { switch ($repository->getVersionControlSystem()) {
@ -469,46 +526,11 @@ final class DiffusionRepositoryController extends DiffusionController {
$panel->setHeader($header); $panel->setHeader($header);
$panel->setTable($view); $panel->setTable($view);
$panel->setBackground(PHUIObjectBoxView::BLUE_PROPERTY);
return $panel; return $panel;
} }
private function buildActionList(PhabricatorRepository $repository) {
$viewer = $this->getRequest()->getUser();
$edit_uri = $repository->getPathURI('edit/');
$view = id(new PhabricatorActionListView())
->setUser($viewer)
->setObject($repository);
$can_edit = PhabricatorPolicyFilter::hasCapability(
$viewer,
$repository,
PhabricatorPolicyCapability::CAN_EDIT);
$view->addAction(
id(new PhabricatorActionView())
->setName(pht('Edit Repository'))
->setIcon('fa-pencil')
->setHref($edit_uri)
->setWorkflow(!$can_edit)
->setDisabled(!$can_edit));
if ($repository->isHosted()) {
$push_uri = $this->getApplicationURI(
'pushlog/?repositories='.$repository->getMonogram());
$view->addAction(
id(new PhabricatorActionView())
->setName(pht('View Push Logs'))
->setIcon('fa-list-alt')
->setHref($push_uri));
}
return $view;
}
private function buildHistoryTable( private function buildHistoryTable(
$history_results, $history_results,
$history, $history,
@ -551,7 +573,7 @@ final class DiffusionRepositoryController extends DiffusionController {
->setIcon('fa-list-alt'); ->setIcon('fa-list-alt');
$button = id(new PHUIButtonView()) $button = id(new PHUIButtonView())
->setText(pht('View Full History')) ->setText(pht('View History'))
->setHref($drequest->generateURI( ->setHref($drequest->generateURI(
array( array(
'action' => 'history', 'action' => 'history',
@ -559,7 +581,8 @@ final class DiffusionRepositoryController extends DiffusionController {
->setTag('a') ->setTag('a')
->setIcon($icon); ->setIcon($icon);
$panel = new PHUIObjectBoxView(); $panel = id(new PHUIObjectBoxView())
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY);
$header = id(new PHUIHeaderView()) $header = id(new PHUIHeaderView())
->setHeader(pht('Recent Commits')) ->setHeader(pht('Recent Commits'))
->addActionLink($button); ->addActionLink($button);
@ -569,6 +592,46 @@ final class DiffusionRepositoryController extends DiffusionController {
return $panel; return $panel;
} }
private function buildLocateFile() {
$request = $this->getRequest();
$viewer = $request->getUser();
$drequest = $this->getDiffusionRequest();
$repository = $drequest->getRepository();
$locate_panel = null;
if ($repository->canUsePathTree()) {
Javelin::initBehavior(
'diffusion-locate-file',
array(
'controlID' => 'locate-control',
'inputID' => 'locate-input',
'browseBaseURI' => (string)$drequest->generateURI(
array(
'action' => 'browse',
)),
'uri' => (string)$drequest->generateURI(
array(
'action' => 'pathtree',
)),
));
$form = id(new AphrontFormView())
->setUser($viewer)
->appendChild(
id(new AphrontFormTypeaheadControl())
->setHardpointID('locate-control')
->setID('locate-input')
->setLabel(pht('Locate File')));
$form_box = id(new PHUIBoxView())
->appendChild($form->buildLayoutView());
$locate_panel = id(new PHUIObjectBoxView())
->setHeaderText(pht('Locate File'))
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->appendChild($form_box);
}
return $locate_panel;
}
private function buildBrowseTable( private function buildBrowseTable(
$browse_results, $browse_results,
$browse_paths, $browse_paths,
@ -606,9 +669,10 @@ final class DiffusionRepositoryController extends DiffusionController {
$browse_uri = $drequest->generateURI(array('action' => 'browse')); $browse_uri = $drequest->generateURI(array('action' => 'browse'));
$browse_panel = new PHUIObjectBoxView(); $browse_panel = id(new PHUIObjectBoxView())
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY);
$header = id(new PHUIHeaderView()) $header = id(new PHUIHeaderView())
->setHeader(pht('Repository')); ->setHeader($repository->getName());
$icon = id(new PHUIIconView()) $icon = id(new PHUIIconView())
->setIcon('fa-folder-open'); ->setIcon('fa-folder-open');
@ -621,38 +685,6 @@ final class DiffusionRepositoryController extends DiffusionController {
$header->addActionLink($button); $header->addActionLink($button);
$browse_panel->setHeader($header); $browse_panel->setHeader($header);
$locate_panel = null;
if ($repository->canUsePathTree()) {
Javelin::initBehavior(
'diffusion-locate-file',
array(
'controlID' => 'locate-control',
'inputID' => 'locate-input',
'browseBaseURI' => (string)$drequest->generateURI(
array(
'action' => 'browse',
)),
'uri' => (string)$drequest->generateURI(
array(
'action' => 'pathtree',
)),
));
$form = id(new AphrontFormView())
->setUser($viewer)
->appendChild(
id(new AphrontFormTypeaheadControl())
->setHardpointID('locate-control')
->setID('locate-input')
->setLabel(pht('Locate File')));
$form_box = id(new PHUIBoxView())
->appendChild($form->buildLayoutView());
$locate_panel = id(new PHUIObjectBoxView())
->setHeaderText('Locate File')
->appendChild($form_box);
}
$browse_panel->setTable($browse_table); $browse_panel->setTable($browse_table);
$pager->setURI($browse_uri, 'offset'); $pager->setURI($browse_uri, 'offset');
@ -664,7 +696,6 @@ final class DiffusionRepositoryController extends DiffusionController {
} }
return array( return array(
$locate_panel,
$browse_panel, $browse_panel,
$pager_box, $pager_box,
); );

View file

@ -262,10 +262,26 @@ final class DiffusionRepositoryCreateController
$crumbs = $this->buildApplicationCrumbs(); $crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb($title); $crumbs->addTextCrumb($title);
$header = id(new PHUIHeaderView())
->setHeader($title)
->setHeaderIcon('fa-pencil');
$form_box = id(new PHUIObjectBoxView())
->setHeaderText($title)
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setForm($form);
$view = id(new PHUITwoColumnView())
->setHeader($header)
->setFooter(array(
$form,
));
return $this->newPage() return $this->newPage()
->setTitle($title) ->setTitle($title)
->setCrumbs($crumbs) ->setCrumbs($crumbs)
->appendChild($form); ->appendChild($view);
} }

View file

@ -53,6 +53,10 @@ final class DiffusionRepositoryEditActionsController
$title = pht('Edit Actions (%s)', $repository->getName()); $title = pht('Edit Actions (%s)', $repository->getName());
$header = id(new PHUIHeaderView())
->setHeader($title)
->setHeaderIcon('fa-pencil');
$policies = id(new PhabricatorPolicyQuery()) $policies = id(new PhabricatorPolicyQuery())
->setViewer($viewer) ->setViewer($viewer)
->setObject($repository) ->setObject($repository)
@ -97,13 +101,21 @@ final class DiffusionRepositoryEditActionsController
->addCancelButton($edit_uri)); ->addCancelButton($edit_uri));
$form_box = id(new PHUIObjectBoxView()) $form_box = id(new PHUIObjectBoxView())
->setHeaderText($title) ->setHeaderText(pht('Actions'))
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setForm($form); ->setForm($form);
$view = id(new PHUITwoColumnView())
->setHeader($header)
->setFooter(array(
$form_box,
));
return $this->newPage() return $this->newPage()
->setTitle($title) ->setTitle($title)
->setCrumbs($crumbs) ->setCrumbs($crumbs)
->appendChild($form_box); ->appendChild($view);
} }
} }

View file

@ -49,6 +49,10 @@ final class DiffusionRepositoryEditAutomationController
$title = pht('Edit %s', $repository->getName()); $title = pht('Edit %s', $repository->getName());
$header = id(new PHUIHeaderView())
->setHeader($title)
->setHeaderIcon('fa-pencil');
$form = id(new AphrontFormView()) $form = id(new AphrontFormView())
->setUser($viewer) ->setUser($viewer)
->appendRemarkupInstructions( ->appendRemarkupInstructions(
@ -69,14 +73,21 @@ final class DiffusionRepositoryEditAutomationController
->setValue(pht('Save')) ->setValue(pht('Save'))
->addCancelButton($edit_uri)); ->addCancelButton($edit_uri));
$object_box = id(new PHUIObjectBoxView()) $form_box = id(new PHUIObjectBoxView())
->setHeaderText($title) ->setHeaderText(pht('Automation'))
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setForm($form); ->setForm($form);
$view = id(new PHUITwoColumnView())
->setHeader($header)
->setFooter(array(
$form_box,
));
return $this->newPage() return $this->newPage()
->setTitle($title) ->setTitle($title)
->setCrumbs($crumbs) ->setCrumbs($crumbs)
->appendChild($object_box); ->appendChild($view);
} }
} }

View file

@ -105,6 +105,10 @@ final class DiffusionRepositoryEditBasicController
$title = pht('Edit %s', $repository->getName()); $title = pht('Edit %s', $repository->getName());
$header = id(new PHUIHeaderView())
->setHeader($title)
->setHeaderIcon('fa-pencil');
$form = id(new AphrontFormView()) $form = id(new AphrontFormView())
->setUser($viewer) ->setUser($viewer)
->appendChild( ->appendChild(
@ -144,16 +148,23 @@ final class DiffusionRepositoryEditBasicController
->appendChild(id(new PHUIFormDividerControl())) ->appendChild(id(new PHUIFormDividerControl()))
->appendRemarkupInstructions($this->getReadmeInstructions()); ->appendRemarkupInstructions($this->getReadmeInstructions());
$object_box = id(new PHUIObjectBoxView()) $form_box = id(new PHUIObjectBoxView())
->setHeaderText($title) ->setHeaderText(pht('Basic Information'))
->setValidationException($validation_exception) ->setValidationException($validation_exception)
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setForm($form) ->setForm($form)
->setFormErrors($errors); ->setFormErrors($errors);
$view = id(new PHUITwoColumnView())
->setHeader($header)
->setFooter(array(
$form_box,
));
return $this->newPage() return $this->newPage()
->setTitle($title) ->setTitle($title)
->setCrumbs($crumbs) ->setCrumbs($crumbs)
->appendChild($object_box); ->appendChild($view);
} }
private function getReadmeInstructions() { private function getReadmeInstructions() {

View file

@ -98,6 +98,9 @@ final class DiffusionRepositoryEditBranchesController
$crumbs->addTextCrumb(pht('Edit Branches')); $crumbs->addTextCrumb(pht('Edit Branches'));
$title = pht('Edit Branches (%s)', $repository->getName()); $title = pht('Edit Branches (%s)', $repository->getName());
$header = id(new PHUIHeaderView())
->setHeader($title)
->setHeaderIcon('fa-pencil');
$policies = id(new PhabricatorPolicyQuery()) $policies = id(new PhabricatorPolicyQuery())
->setViewer($viewer) ->setViewer($viewer)
@ -213,14 +216,21 @@ final class DiffusionRepositoryEditBranchesController
->addCancelButton($edit_uri)); ->addCancelButton($edit_uri));
$form_box = id(new PHUIObjectBoxView()) $form_box = id(new PHUIObjectBoxView())
->setHeaderText(pht('Branches'))
->setValidationException($validation_exception) ->setValidationException($validation_exception)
->setHeaderText($title) ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setForm($form); ->setForm($form);
$view = id(new PHUITwoColumnView())
->setHeader($header)
->setFooter(array(
$form_box,
));
return $this->newPage() return $this->newPage()
->setTitle($title) ->setTitle($title)
->setCrumbs($crumbs) ->setCrumbs($crumbs)
->appendChild($form_box); ->appendChild($view);
} }
private function processBranches($string) { private function processBranches($string) {

View file

@ -20,6 +20,7 @@ abstract class DiffusionRepositoryEditController
$crumbs->addTextCrumb(pht('Edit'), $edit_uri); $crumbs->addTextCrumb(pht('Edit'), $edit_uri);
} }
} }
$crumbs->setBorder(true);
return $crumbs; return $crumbs;
} }

View file

@ -50,6 +50,9 @@ final class DiffusionRepositoryEditEncodingController
$crumbs->addTextCrumb(pht('Edit Encoding')); $crumbs->addTextCrumb(pht('Edit Encoding'));
$title = pht('Edit %s', $repository->getName()); $title = pht('Edit %s', $repository->getName());
$header = id(new PHUIHeaderView())
->setHeader($title)
->setHeaderIcon('fa-pencil');
$form = id(new AphrontFormView()) $form = id(new AphrontFormView())
->setUser($user) ->setUser($user)
@ -65,15 +68,22 @@ final class DiffusionRepositoryEditEncodingController
->setValue(pht('Save Encoding')) ->setValue(pht('Save Encoding'))
->addCancelButton($edit_uri)); ->addCancelButton($edit_uri));
$object_box = id(new PHUIObjectBoxView()) $form_box = id(new PHUIObjectBoxView())
->setHeaderText($title) ->setHeaderText(pht('Encoding'))
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setForm($form) ->setForm($form)
->setFormErrors($errors); ->setFormErrors($errors);
$view = id(new PHUITwoColumnView())
->setHeader($header)
->setFooter(array(
$form_box,
));
return $this->newPage() return $this->newPage()
->setTitle($title) ->setTitle($title)
->setCrumbs($crumbs) ->setCrumbs($crumbs)
->appendChild($object_box); ->appendChild($view);
} }
private function getEncodingInstructions() { private function getEncodingInstructions() {

View file

@ -57,6 +57,9 @@ final class DiffusionRepositoryEditHostingController
$crumbs->addTextCrumb(pht('Edit Hosting')); $crumbs->addTextCrumb(pht('Edit Hosting'));
$title = pht('Edit Hosting (%s)', $repository->getName()); $title = pht('Edit Hosting (%s)', $repository->getName());
$header = id(new PHUIHeaderView())
->setHeader($title)
->setHeaderIcon('fa-pencil');
$hosted_control = id(new AphrontFormRadioButtonControl()) $hosted_control = id(new AphrontFormRadioButtonControl())
->setName('hosting') ->setName('hosting')
@ -95,14 +98,21 @@ final class DiffusionRepositoryEditHostingController
->setValue(pht('Save and Continue')) ->setValue(pht('Save and Continue'))
->addCancelButton($edit_uri)); ->addCancelButton($edit_uri));
$object_box = id(new PHUIObjectBoxView()) $form_box = id(new PHUIObjectBoxView())
->setHeaderText($title) ->setHeaderText(pht('Hosting'))
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setForm($form); ->setForm($form);
$view = id(new PHUITwoColumnView())
->setHeader($header)
->setFooter(array(
$form_box,
));
return $this->newPage() return $this->newPage()
->setTitle($title) ->setTitle($title)
->setCrumbs($crumbs) ->setCrumbs($crumbs)
->appendChild($object_box); ->appendChild($view);
} }
public function handleProtocols(PhabricatorRepository $repository) { public function handleProtocols(PhabricatorRepository $repository) {
@ -155,7 +165,9 @@ final class DiffusionRepositoryEditHostingController
$crumbs->addTextCrumb(pht('Edit Protocols')); $crumbs->addTextCrumb(pht('Edit Protocols'));
$title = pht('Edit Protocols (%s)', $repository->getName()); $title = pht('Edit Protocols (%s)', $repository->getName());
$header = id(new PHUIHeaderView())
->setHeader($title)
->setHeaderIcon('fa-pencil');
$rw_message = pht( $rw_message = pht(
'Phabricator will serve a read-write copy of this repository.'); 'Phabricator will serve a read-write copy of this repository.');
@ -256,14 +268,21 @@ final class DiffusionRepositoryEditHostingController
->setValue(pht('Save Changes')) ->setValue(pht('Save Changes'))
->addCancelButton($prev_uri, pht('Back'))); ->addCancelButton($prev_uri, pht('Back')));
$object_box = id(new PHUIObjectBoxView()) $form_box = id(new PHUIObjectBoxView())
->setHeaderText($title) ->setHeaderText(pht('Protocols'))
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setForm($form); ->setForm($form);
$view = id(new PHUITwoColumnView())
->setHeader($header)
->setFooter(array(
$form_box,
));
return $this->newPage() return $this->newPage()
->setTitle($title) ->setTitle($title)
->setCrumbs($crumbs) ->setCrumbs($crumbs)
->appendChild($object_box); ->appendChild($view);
} }
} }

View file

@ -38,16 +38,16 @@ final class DiffusionRepositoryEditMainController
$title = pht('Edit %s', $repository->getName()); $title = pht('Edit %s', $repository->getName());
$header = id(new PHUIHeaderView()) $header = id(new PHUIHeaderView())
->setHeader($title); ->setHeader($title)
->setHeaderIcon('fa-pencil');
if ($repository->isTracked()) { if ($repository->isTracked()) {
$header->setStatus('fa-check', 'bluegrey', pht('Active')); $header->setStatus('fa-check', 'bluegrey', pht('Active'));
} else { } else {
$header->setStatus('fa-ban', 'dark', pht('Inactive')); $header->setStatus('fa-ban', 'dark', pht('Inactive'));
} }
$basic_actions = $this->buildBasicActions($repository); $curtain = $this->buildCurtain($repository);
$basic_properties = $basic_properties = $this->buildBasicProperties($repository);
$this->buildBasicProperties($repository, $basic_actions);
$policy_actions = $this->buildPolicyActions($repository); $policy_actions = $this->buildPolicyActions($repository);
$policy_properties = $policy_properties =
@ -119,16 +119,14 @@ final class DiffusionRepositoryEditMainController
$boxes = array(); $boxes = array();
$boxes[] = id(new PHUIObjectBoxView())
->setHeader($header)
->addPropertyList($basic_properties);
$boxes[] = id(new PHUIObjectBoxView()) $boxes[] = id(new PHUIObjectBoxView())
->setHeaderText(pht('Policies')) ->setHeaderText(pht('Policies'))
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->addPropertyList($policy_properties); ->addPropertyList($policy_properties);
$boxes[] = id(new PHUIObjectBoxView()) $boxes[] = id(new PHUIObjectBoxView())
->setHeaderText(pht('Hosting')) ->setHeaderText(pht('Hosting'))
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->addPropertyList($hosting_properties); ->addPropertyList($hosting_properties);
if ($repository->canMirror()) { if ($repository->canMirror()) {
@ -156,6 +154,7 @@ final class DiffusionRepositoryEditMainController
$boxes[] = id(new PHUIObjectBoxView()) $boxes[] = id(new PHUIObjectBoxView())
->setFormErrors($mirror_info) ->setFormErrors($mirror_info)
->setHeaderText(pht('Mirrors')) ->setHeaderText(pht('Mirrors'))
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->addPropertyList($mirror_properties); ->addPropertyList($mirror_properties);
$boxes[] = $mirror_list; $boxes[] = $mirror_list;
@ -164,73 +163,88 @@ final class DiffusionRepositoryEditMainController
if ($remote_properties) { if ($remote_properties) {
$boxes[] = id(new PHUIObjectBoxView()) $boxes[] = id(new PHUIObjectBoxView())
->setHeaderText(pht('Remote')) ->setHeaderText(pht('Remote'))
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->addPropertyList($remote_properties); ->addPropertyList($remote_properties);
} }
if ($storage_properties) { if ($storage_properties) {
$boxes[] = id(new PHUIObjectBoxView()) $boxes[] = id(new PHUIObjectBoxView())
->setHeaderText(pht('Storage')) ->setHeaderText(pht('Storage'))
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->addPropertyList($storage_properties); ->addPropertyList($storage_properties);
} }
if ($staging_properties) { if ($staging_properties) {
$boxes[] = id(new PHUIObjectBoxView()) $boxes[] = id(new PHUIObjectBoxView())
->setHeaderText(pht('Staging')) ->setHeaderText(pht('Staging'))
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->addPropertyList($staging_properties); ->addPropertyList($staging_properties);
} }
if ($automation_properties) { if ($automation_properties) {
$boxes[] = id(new PHUIObjectBoxView()) $boxes[] = id(new PHUIObjectBoxView())
->setHeaderText(pht('Automation')) ->setHeaderText(pht('Automation'))
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->addPropertyList($automation_properties); ->addPropertyList($automation_properties);
} }
$boxes[] = id(new PHUIObjectBoxView()) $boxes[] = id(new PHUIObjectBoxView())
->setHeaderText(pht('Text Encoding')) ->setHeaderText(pht('Text Encoding'))
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->addPropertyList($encoding_properties); ->addPropertyList($encoding_properties);
$boxes[] = id(new PHUIObjectBoxView()) $boxes[] = id(new PHUIObjectBoxView())
->setHeaderText(pht('Symbols')) ->setHeaderText(pht('Symbols'))
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->addPropertyList($symbols_properties); ->addPropertyList($symbols_properties);
if ($branches_properties) { if ($branches_properties) {
$boxes[] = id(new PHUIObjectBoxView()) $boxes[] = id(new PHUIObjectBoxView())
->setHeaderText(pht('Branches')) ->setHeaderText(pht('Branches'))
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->addPropertyList($branches_properties); ->addPropertyList($branches_properties);
} }
if ($subversion_properties) { if ($subversion_properties) {
$boxes[] = id(new PHUIObjectBoxView()) $boxes[] = id(new PHUIObjectBoxView())
->setHeaderText(pht('Subversion')) ->setHeaderText(pht('Subversion'))
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->addPropertyList($subversion_properties); ->addPropertyList($subversion_properties);
} }
$boxes[] = id(new PHUIObjectBoxView()) $boxes[] = id(new PHUIObjectBoxView())
->setHeaderText(pht('Actions')) ->setHeaderText(pht('Actions'))
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->addPropertyList($actions_properties); ->addPropertyList($actions_properties);
return $this->buildApplicationPage( $crumbs->setBorder(true);
array(
$crumbs, $view = id(new PHUITwoColumnView())
->setHeader($header)
->setCurtain($curtain)
->addPropertySection(pht('Properties'), $basic_properties)
->setMainColumn(array(
$boxes, $boxes,
$timeline, $timeline,
),
array(
'title' => $title,
)); ));
return $this->newPage()
->setTitle($title)
->setCrumbs($crumbs)
->appendChild($view);
} }
private function buildBasicActions(PhabricatorRepository $repository) { private function buildCurtain(PhabricatorRepository $repository) {
$viewer = $this->getRequest()->getUser(); $viewer = $this->getViewer();
$view = id(new PhabricatorActionListView()) $curtain = $this->newCurtainView($repository);
->setUser($viewer);
$edit = id(new PhabricatorActionView()) $edit = id(new PhabricatorActionView())
->setIcon('fa-pencil') ->setIcon('fa-pencil')
->setName(pht('Edit Basic Information')) ->setName(pht('Edit Basic Information'))
->setHref($this->getRepositoryControllerURI($repository, 'edit/basic/')); ->setHref($this->getRepositoryControllerURI($repository, 'edit/basic/'));
$view->addAction($edit); $curtain->addAction($edit);
$edit = id(new PhabricatorActionView()) $edit = id(new PhabricatorActionView())
->setIcon('fa-refresh') ->setIcon('fa-refresh')
@ -238,7 +252,7 @@ final class DiffusionRepositoryEditMainController
->setWorkflow(true) ->setWorkflow(true)
->setHref( ->setHref(
$this->getRepositoryControllerURI($repository, 'edit/update/')); $this->getRepositoryControllerURI($repository, 'edit/update/'));
$view->addAction($edit); $curtain->addAction($edit);
$activate = id(new PhabricatorActionView()) $activate = id(new PhabricatorActionView())
->setHref( ->setHref(
@ -255,9 +269,9 @@ final class DiffusionRepositoryEditMainController
->setName(pht('Activate Repository')); ->setName(pht('Activate Repository'));
} }
$view->addAction($activate); $curtain->addAction($activate);
$view->addAction( $curtain->addAction(
id(new PhabricatorActionView()) id(new PhabricatorActionView())
->setName(pht('Delete Repository')) ->setName(pht('Delete Repository'))
->setIcon('fa-times') ->setIcon('fa-times')
@ -266,19 +280,16 @@ final class DiffusionRepositoryEditMainController
->setDisabled(true) ->setDisabled(true)
->setWorkflow(true)); ->setWorkflow(true));
return $view; return $curtain;
} }
private function buildBasicProperties( private function buildBasicProperties(
PhabricatorRepository $repository, PhabricatorRepository $repository) {
PhabricatorActionListView $actions) {
$viewer = $this->getRequest()->getUser(); $viewer = $this->getViewer();
$view = id(new PHUIPropertyListView()) $view = id(new PHUIPropertyListView())
->setUser($viewer) ->setUser($viewer);
->setObject($repository)
->setActionList($actions);
$type = PhabricatorRepositoryType::getNameForRepositoryType( $type = PhabricatorRepositoryType::getNameForRepositoryType(
$repository->getVersionControlSystem()); $repository->getVersionControlSystem());
@ -322,7 +333,7 @@ final class DiffusionRepositoryEditMainController
} }
private function buildEncodingActions(PhabricatorRepository $repository) { private function buildEncodingActions(PhabricatorRepository $repository) {
$viewer = $this->getRequest()->getUser(); $viewer = $this->getViewer();
$view = id(new PhabricatorActionListView()) $view = id(new PhabricatorActionListView())
->setUser($viewer); ->setUser($viewer);
@ -341,7 +352,7 @@ final class DiffusionRepositoryEditMainController
PhabricatorRepository $repository, PhabricatorRepository $repository,
PhabricatorActionListView $actions) { PhabricatorActionListView $actions) {
$viewer = $this->getRequest()->getUser(); $viewer = $this->getViewer();
$view = id(new PHUIPropertyListView()) $view = id(new PHUIPropertyListView())
->setUser($viewer) ->setUser($viewer)
@ -358,7 +369,7 @@ final class DiffusionRepositoryEditMainController
} }
private function buildPolicyActions(PhabricatorRepository $repository) { private function buildPolicyActions(PhabricatorRepository $repository) {
$viewer = $this->getRequest()->getUser(); $viewer = $this->getViewer();
$view = id(new PhabricatorActionListView()) $view = id(new PhabricatorActionListView())
->setUser($viewer); ->setUser($viewer);
@ -377,7 +388,7 @@ final class DiffusionRepositoryEditMainController
PhabricatorRepository $repository, PhabricatorRepository $repository,
PhabricatorActionListView $actions) { PhabricatorActionListView $actions) {
$viewer = $this->getRequest()->getUser(); $viewer = $this->getViewer();
$view = id(new PHUIPropertyListView()) $view = id(new PHUIPropertyListView())
->setUser($viewer) ->setUser($viewer)
@ -412,7 +423,7 @@ final class DiffusionRepositoryEditMainController
} }
private function buildBranchesActions(PhabricatorRepository $repository) { private function buildBranchesActions(PhabricatorRepository $repository) {
$viewer = $this->getRequest()->getUser(); $viewer = $this->getViewer();
$view = id(new PhabricatorActionListView()) $view = id(new PhabricatorActionListView())
->setUser($viewer); ->setUser($viewer);
@ -431,7 +442,7 @@ final class DiffusionRepositoryEditMainController
PhabricatorRepository $repository, PhabricatorRepository $repository,
PhabricatorActionListView $actions) { PhabricatorActionListView $actions) {
$viewer = $this->getRequest()->getUser(); $viewer = $this->getViewer();
$view = id(new PHUIPropertyListView()) $view = id(new PHUIPropertyListView())
->setUser($viewer) ->setUser($viewer)
@ -461,7 +472,7 @@ final class DiffusionRepositoryEditMainController
} }
private function buildSubversionActions(PhabricatorRepository $repository) { private function buildSubversionActions(PhabricatorRepository $repository) {
$viewer = $this->getRequest()->getUser(); $viewer = $this->getViewer();
$view = id(new PhabricatorActionListView()) $view = id(new PhabricatorActionListView())
->setUser($viewer); ->setUser($viewer);
@ -480,7 +491,7 @@ final class DiffusionRepositoryEditMainController
PhabricatorRepository $repository, PhabricatorRepository $repository,
PhabricatorActionListView $actions) { PhabricatorActionListView $actions) {
$viewer = $this->getRequest()->getUser(); $viewer = $this->getViewer();
$view = id(new PHUIPropertyListView()) $view = id(new PHUIPropertyListView())
->setUser($viewer) ->setUser($viewer)
@ -500,7 +511,7 @@ final class DiffusionRepositoryEditMainController
} }
private function buildActionsActions(PhabricatorRepository $repository) { private function buildActionsActions(PhabricatorRepository $repository) {
$viewer = $this->getRequest()->getUser(); $viewer = $this->getViewer();
$view = id(new PhabricatorActionListView()) $view = id(new PhabricatorActionListView())
->setUser($viewer); ->setUser($viewer);
@ -519,7 +530,7 @@ final class DiffusionRepositoryEditMainController
PhabricatorRepository $repository, PhabricatorRepository $repository,
PhabricatorActionListView $actions) { PhabricatorActionListView $actions) {
$viewer = $this->getRequest()->getUser(); $viewer = $this->getViewer();
$view = id(new PHUIPropertyListView()) $view = id(new PHUIPropertyListView())
->setUser($viewer) ->setUser($viewer)
@ -541,7 +552,7 @@ final class DiffusionRepositoryEditMainController
} }
private function buildRemoteActions(PhabricatorRepository $repository) { private function buildRemoteActions(PhabricatorRepository $repository) {
$viewer = $this->getRequest()->getUser(); $viewer = $this->getViewer();
$view = id(new PhabricatorActionListView()) $view = id(new PhabricatorActionListView())
->setUser($viewer); ->setUser($viewer);
@ -560,7 +571,7 @@ final class DiffusionRepositoryEditMainController
PhabricatorRepository $repository, PhabricatorRepository $repository,
PhabricatorActionListView $actions) { PhabricatorActionListView $actions) {
$viewer = $this->getRequest()->getUser(); $viewer = $this->getViewer();
$view = id(new PHUIPropertyListView()) $view = id(new PHUIPropertyListView())
->setUser($viewer) ->setUser($viewer)
@ -581,7 +592,7 @@ final class DiffusionRepositoryEditMainController
} }
private function buildStorageActions(PhabricatorRepository $repository) { private function buildStorageActions(PhabricatorRepository $repository) {
$viewer = $this->getRequest()->getUser(); $viewer = $this->getViewer();
$view = id(new PhabricatorActionListView()) $view = id(new PhabricatorActionListView())
->setUser($viewer); ->setUser($viewer);
@ -600,7 +611,7 @@ final class DiffusionRepositoryEditMainController
PhabricatorRepository $repository, PhabricatorRepository $repository,
PhabricatorActionListView $actions) { PhabricatorActionListView $actions) {
$viewer = $this->getRequest()->getUser(); $viewer = $this->getViewer();
$view = id(new PHUIPropertyListView()) $view = id(new PHUIPropertyListView())
->setUser($viewer) ->setUser($viewer)
@ -801,7 +812,7 @@ final class DiffusionRepositoryEditMainController
private function buildRepositoryStatus( private function buildRepositoryStatus(
PhabricatorRepository $repository) { PhabricatorRepository $repository) {
$viewer = $this->getRequest()->getUser(); $viewer = $this->getViewer();
$is_cluster = $repository->getAlmanacServicePHID(); $is_cluster = $repository->getAlmanacServicePHID();
$view = new PHUIStatusListView(); $view = new PHUIStatusListView();
@ -1188,7 +1199,7 @@ final class DiffusionRepositoryEditMainController
private function buildMirrorActions( private function buildMirrorActions(
PhabricatorRepository $repository) { PhabricatorRepository $repository) {
$viewer = $this->getRequest()->getUser(); $viewer = $this->getViewer();
$mirror_actions = id(new PhabricatorActionListView()) $mirror_actions = id(new PhabricatorActionListView())
->setUser($viewer); ->setUser($viewer);
@ -1211,7 +1222,7 @@ final class DiffusionRepositoryEditMainController
PhabricatorRepository $repository, PhabricatorRepository $repository,
PhabricatorActionListView $actions) { PhabricatorActionListView $actions) {
$viewer = $this->getRequest()->getUser(); $viewer = $this->getViewer();
$mirror_properties = id(new PHUIPropertyListView()) $mirror_properties = id(new PHUIPropertyListView())
->setUser($viewer) ->setUser($viewer)
@ -1262,11 +1273,14 @@ final class DiffusionRepositoryEditMainController
$mirror_list->addItem($item); $mirror_list->addItem($item);
} }
return $mirror_list; return id(new PHUIObjectBoxView())
->setHeaderText(pht('Configured Mirrors'))
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setObjectList($mirror_list);
} }
private function buildSymbolsActions(PhabricatorRepository $repository) { private function buildSymbolsActions(PhabricatorRepository $repository) {
$viewer = $this->getRequest()->getUser(); $viewer = $this->getViewer();
$view = id(new PhabricatorActionListView()) $view = id(new PhabricatorActionListView())
->setUser($viewer); ->setUser($viewer);
@ -1285,7 +1299,7 @@ final class DiffusionRepositoryEditMainController
PhabricatorRepository $repository, PhabricatorRepository $repository,
PhabricatorActionListView $actions) { PhabricatorActionListView $actions) {
$viewer = $this->getRequest()->getUser(); $viewer = $this->getViewer();
$view = id(new PHUIPropertyListView()) $view = id(new PHUIPropertyListView())
->setUser($viewer) ->setUser($viewer)

View file

@ -45,7 +45,10 @@ final class DiffusionRepositoryEditStagingController
$crumbs = $this->buildApplicationCrumbs(); $crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb(pht('Edit Staging')); $crumbs->addTextCrumb(pht('Edit Staging'));
$title = pht('Edit %s', $repository->getName()); $title = pht('Edit Staging (%s)', $repository->getName());
$header = id(new PHUIHeaderView())
->setHeader($title)
->setHeaderIcon('fa-pencil');
$form = id(new AphrontFormView()) $form = id(new AphrontFormView())
->setUser($viewer) ->setUser($viewer)
@ -68,14 +71,21 @@ final class DiffusionRepositoryEditStagingController
->setValue(pht('Save')) ->setValue(pht('Save'))
->addCancelButton($edit_uri)); ->addCancelButton($edit_uri));
$object_box = id(new PHUIObjectBoxView()) $form_box = id(new PHUIObjectBoxView())
->setHeaderText($title) ->setHeaderText(pht('Staging'))
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setForm($form); ->setForm($form);
$view = id(new PHUITwoColumnView())
->setHeader($header)
->setFooter(array(
$form_box,
));
return $this->newPage() return $this->newPage()
->setTitle($title) ->setTitle($title)
->setCrumbs($crumbs) ->setCrumbs($crumbs)
->appendChild($object_box); ->appendChild($view);
} }
} }

View file

@ -22,6 +22,9 @@ final class DiffusionRepositoryEditStorageController
$crumbs->addTextCrumb(pht('Edit Storage')); $crumbs->addTextCrumb(pht('Edit Storage'));
$title = pht('Edit %s', $repository->getName()); $title = pht('Edit %s', $repository->getName());
$header = id(new PHUIHeaderView())
->setHeader($title)
->setHeaderIcon('fa-pencil');
$service_phid = $repository->getAlmanacServicePHID(); $service_phid = $repository->getAlmanacServicePHID();
if ($service_phid) { if ($service_phid) {
@ -57,15 +60,21 @@ final class DiffusionRepositoryEditStorageController
id(new AphrontFormSubmitControl()) id(new AphrontFormSubmitControl())
->addCancelButton($edit_uri, pht('Done'))); ->addCancelButton($edit_uri, pht('Done')));
$object_box = id(new PHUIObjectBoxView()) $form_box = id(new PHUIObjectBoxView())
->setHeaderText($title) ->setHeaderText(pht('Storage'))
->setForm($form) ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setFormErrors($errors); ->setForm($form);
$view = id(new PHUITwoColumnView())
->setHeader($header)
->setFooter(array(
$form_box,
));
return $this->newPage() return $this->newPage()
->setTitle($title) ->setTitle($title)
->setCrumbs($crumbs) ->setCrumbs($crumbs)
->appendChild($object_box); ->appendChild($view);
} }
} }

View file

@ -63,6 +63,9 @@ final class DiffusionRepositoryEditSubversionController
$crumbs->addTextCrumb(pht('Edit Subversion Info')); $crumbs->addTextCrumb(pht('Edit Subversion Info'));
$title = pht('Edit Subversion Info (%s)', $repository->getName()); $title = pht('Edit Subversion Info (%s)', $repository->getName());
$header = id(new PHUIHeaderView())
->setHeader($title)
->setHeaderIcon('fa-pencil');
$policies = id(new PhabricatorPolicyQuery()) $policies = id(new PhabricatorPolicyQuery())
->setViewer($viewer) ->setViewer($viewer)
@ -96,13 +99,20 @@ final class DiffusionRepositoryEditSubversionController
->addCancelButton($edit_uri)); ->addCancelButton($edit_uri));
$form_box = id(new PHUIObjectBoxView()) $form_box = id(new PHUIObjectBoxView())
->setHeaderText($title) ->setHeaderText(pht('Subversion'))
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setForm($form); ->setForm($form);
$view = id(new PHUITwoColumnView())
->setHeader($header)
->setFooter(array(
$form_box,
));
return $this->newPage() return $this->newPage()
->setTitle($title) ->setTitle($title)
->setCrumbs($crumbs) ->setCrumbs($crumbs)
->appendChild($form_box); ->appendChild($view);
} }
} }

View file

@ -59,7 +59,10 @@ final class DiffusionRepositorySymbolsController
$crumbs = $this->buildApplicationCrumbs(); $crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb(pht('Edit Symbols')); $crumbs->addTextCrumb(pht('Edit Symbols'));
$title = pht('Edit %s', $repository->getName()); $title = pht('Edit Symbols (%s)', $repository->getName());
$header = id(new PHUIHeaderView())
->setHeader($title)
->setHeaderIcon('fa-pencil');
$form = id(new AphrontFormView()) $form = id(new AphrontFormView())
->setUser($viewer) ->setUser($viewer)
@ -85,15 +88,22 @@ final class DiffusionRepositorySymbolsController
->setValue(pht('Save')) ->setValue(pht('Save'))
->addCancelButton($edit_uri)); ->addCancelButton($edit_uri));
$object_box = id(new PHUIObjectBoxView()) $form_box = id(new PHUIObjectBoxView())
->setHeaderText($title) ->setHeaderText(pht('Symbols'))
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setForm($form) ->setForm($form)
->setFormErrors($errors); ->setFormErrors($errors);
$view = id(new PHUITwoColumnView())
->setHeader($header)
->setFooter(array(
$form_box,
));
return $this->newPage() return $this->newPage()
->setTitle($title) ->setTitle($title)
->setCrumbs($crumbs) ->setCrumbs($crumbs)
->appendChild($object_box); ->appendChild($view);
} }
private function getInstructions() { private function getInstructions() {

View file

@ -134,17 +134,24 @@ final class DiffusionSymbolController extends DiffusionController {
$table->setNoDataString( $table->setNoDataString(
pht('No matching symbol could be found in any indexed repository.')); pht('No matching symbol could be found in any indexed repository.'));
$panel = id(new PHUIObjectBoxView()) $header = id(new PHUIHeaderView())
->setHeaderText(pht('Similar Symbols')) ->setHeader(pht('Similar Symbols'))
->setTable($table); ->setHeaderIcon('fa-bullseye');
$crumbs = $this->buildApplicationCrumbs(); $crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb(pht('Find Symbol')); $crumbs->addTextCrumb(pht('Find Symbol'));
$crumbs->setBorder(true);
$view = id(new PHUITwoColumnView())
->setHeader($header)
->setFooter(array(
$table,
));
return $this->newPage() return $this->newPage()
->setTitle(pht('Find Symbol')) ->setTitle(pht('Find Symbol'))
->setCrumbs($crumbs) ->setCrumbs($crumbs)
->appendChild($panel); ->appendChild($view);
} }
} }

View file

@ -45,6 +45,11 @@ final class DiffusionTagListController extends DiffusionController {
$tags = $pager->sliceResults($tags); $tags = $pager->sliceResults($tags);
$content = null; $content = null;
$header = id(new PHUIHeaderView())
->setHeader(pht('Tags'))
->setHeaderIcon('fa-tags');
if (!$tags) { if (!$tags) {
$content = $this->renderStatusMessage( $content = $this->renderStatusMessage(
pht('No Tags'), pht('No Tags'),
@ -69,11 +74,7 @@ final class DiffusionTagListController extends DiffusionController {
$handles = $this->loadViewerHandles($phids); $handles = $this->loadViewerHandles($phids);
$view->setHandles($handles); $view->setHandles($handles);
$panel = id(new PHUIObjectBoxView()) $content = $view;
->setHeaderText(pht('Tags'))
->appendChild($view);
$content = $panel;
} }
$crumbs = $this->buildCrumbs( $crumbs = $this->buildCrumbs(
@ -81,9 +82,22 @@ final class DiffusionTagListController extends DiffusionController {
'tags' => true, 'tags' => true,
'commit' => $drequest->getSymbolicCommit(), 'commit' => $drequest->getSymbolicCommit(),
)); ));
$crumbs->setBorder(true);
$box = id(new PHUIObjectBoxView())
->setHeaderText($repository->getDisplayName())
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setTable($view);
$pager_box = $this->renderTablePagerBox($pager); $pager_box = $this->renderTablePagerBox($pager);
$view = id(new PHUITwoColumnView())
->setHeader($header)
->setFooter(array(
$box,
$pager_box,
));
return $this->newPage() return $this->newPage()
->setTitle( ->setTitle(
array( array(
@ -91,11 +105,7 @@ final class DiffusionTagListController extends DiffusionController {
$repository->getDisplayName(), $repository->getDisplayName(),
)) ))
->setCrumbs($crumbs) ->setCrumbs($crumbs)
->appendChild( ->appendChild($view);
array(
$content,
$pager_box,
));
} }
} }

View file

@ -90,7 +90,6 @@ final class DiffusionBrowseTableView extends DiffusionView {
$browse_link, $browse_link,
idx($dict, 'lint'), idx($dict, 'lint'),
$dict['commit'], $dict['commit'],
$dict['author'],
$dict['details'], $dict['details'],
$dict['date'], $dict['date'],
); );
@ -120,7 +119,6 @@ final class DiffusionBrowseTableView extends DiffusionView {
pht('Path'), pht('Path'),
($lint ? $lint : pht('Lint')), ($lint ? $lint : pht('Lint')),
pht('Modified'), pht('Modified'),
pht('Author/Committer'),
pht('Details'), pht('Details'),
pht('Committed'), pht('Committed'),
)); ));
@ -130,7 +128,6 @@ final class DiffusionBrowseTableView extends DiffusionView {
'', '',
'', '',
'', '',
'',
'wide', 'wide',
'', '',
)); ));
@ -142,7 +139,6 @@ final class DiffusionBrowseTableView extends DiffusionView {
true, true,
true, true,
true, true,
true,
)); ));
$view->setDeviceVisibility( $view->setDeviceVisibility(
@ -150,7 +146,6 @@ final class DiffusionBrowseTableView extends DiffusionView {
true, true,
true, true,
false, false,
true,
false, false,
true, true,
false, false,

View file

@ -95,7 +95,9 @@ abstract class DiffusionView extends AphrontView {
} }
$icon = DifferentialChangeType::getIconForFileType($file_type); $icon = DifferentialChangeType::getIconForFileType($file_type);
$icon_view = id(new PHUIIconView())->setIcon($icon); $color = DifferentialChangeType::getIconColorForFileType($file_type);
$icon_view = id(new PHUIIconView())
->setIcon($icon.' '.$color);
// If we're rendering a file or directory name, don't show the tooltip. // If we're rendering a file or directory name, don't show the tooltip.
if ($display_name !== null) { if ($display_name !== null) {

View file

@ -14,6 +14,7 @@ final class PHUIInfoView extends AphrontView {
private $id; private $id;
private $buttons = array(); private $buttons = array();
private $isHidden; private $isHidden;
private $flush;
public function setTitle($title) { public function setTitle($title) {
$this->title = $title; $this->title = $title;
@ -40,6 +41,11 @@ final class PHUIInfoView extends AphrontView {
return $this; return $this;
} }
public function setFlush($flush) {
$this->flush = $flush;
return $this;
}
public function addButton(PHUIButtonView $button) { public function addButton(PHUIButtonView $button) {
$this->buttons[] = $button; $this->buttons[] = $button;
return $this; return $this;
@ -87,6 +93,9 @@ final class PHUIInfoView extends AphrontView {
$classes[] = 'phui-info-view'; $classes[] = 'phui-info-view';
$classes[] = 'phui-info-severity-'.$this->severity; $classes[] = 'phui-info-severity-'.$this->severity;
$classes[] = 'grouped'; $classes[] = 'grouped';
if ($this->flush) {
$classes[] = 'phui-info-view-flush';
}
$classes = implode(' ', $classes); $classes = implode(' ', $classes);
$children = $this->renderChildren(); $children = $this->renderChildren();

View file

@ -263,6 +263,7 @@ final class PHUIPagedFormView extends AphrontView {
$form->appendChild($submit); $form->appendChild($submit);
$box = id(new PHUIObjectBoxView()) $box = id(new PHUIObjectBoxView())
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setFormErrors($errors) ->setFormErrors($errors)
->setForm($form); ->setForm($form);

View file

@ -35,6 +35,9 @@ final class PHUIHeadThingView extends AphrontTagView {
$classes = array(); $classes = array();
$classes[] = 'phui-head-thing-view'; $classes[] = 'phui-head-thing-view';
if ($this->image) {
$classes[] = 'phui-head-has-image';
}
if ($this->size) { if ($this->size) {
$classes[] = $this->size; $classes[] = $this->size;
@ -57,8 +60,11 @@ final class PHUIHeadThingView extends AphrontTagView {
'href' => $this->imageHref, 'href' => $this->imageHref,
)); ));
return array($image, $this->content); if ($this->image) {
return array($image, $this->content);
} else {
return $this->content;
}
} }

View file

@ -20,3 +20,11 @@ input.diffusion-clone-uri {
.diffusion-link-icon + .diffusion-link-icon { .diffusion-link-icon + .diffusion-link-icon {
margin-left: 6px; margin-left: 6px;
} }
.diffusion-search-boxen {
padding: 16px;
}
.diffusion-search-boxen .phui-form-view {
padding: 0;
}

View file

@ -4,7 +4,6 @@
.diffusion-source { .diffusion-source {
width: 100%; width: 100%;
font: 10px/13px "Menlo", "Consolas", "Monaco", monospace;
background: #fff; background: #fff;
} }
@ -21,13 +20,12 @@
} }
.diffusion-source td { .diffusion-source td {
letter-spacing: 0.0083334px; vertical-align: top;
vertical-align: top; white-space: pre-wrap;
white-space: pre-wrap; padding-top: 1px;
padding-bottom: 1px; padding-bottom: 1px;
padding-left: 8px; padding-left: 8px;
line-height: 16px; width: 100%;
width: 100%;
} }
.diffusion-browse-type-form { .diffusion-browse-type-form {

View file

@ -86,8 +86,10 @@
padding: 6px 16px; padding: 6px 16px;
} }
.device .phui-box.phui-box-blue-property .phui-header-shell { .device .phui-box.phui-box-blue-property .phui-header-shell,
padding: 6px 12px; .device .phui-box-blue-property.phui-object-box.phui-object-box-collapsed
.phui-header-shell {
padding: 6px 12px;
} }
.phui-box.phui-box-blue-property .phui-header-header { .phui-box.phui-box-blue-property .phui-header-header {
@ -98,3 +100,16 @@
.phui-box-blue-property .phui-object-item-list-view.phui-object-list-flush { .phui-box-blue-property .phui-object-item-list-view.phui-object-list-flush {
padding: 2px 8px; padding: 2px 8px;
} }
body .phui-box-blue-property.phui-object-box.phui-object-box-collapsed {
padding: 0;
}
body .phui-box-blue-property .phui-header-shell + .phui-object-box {
margin-bottom: 0;
}
.phui-box-blue-property .phui-header-shell + .phui-object-box
.phui-header-shell {
background: #fff;
}

View file

@ -6,6 +6,9 @@
height: 24px; height: 24px;
line-height: 22px; line-height: 22px;
color: {$greytext}; color: {$greytext};
}
.phui-head-thing-view.phui-head-has-image {
position: relative; position: relative;
padding-left: 32px; padding-left: 32px;
} }

View file

@ -324,3 +324,7 @@ body .phui-header-shell.phui-bleed-header
.phui-profile-header .phui-header-col3 { .phui-profile-header .phui-header-col3 {
vertical-align: top; vertical-align: top;
} }
.phui-header-view .phui-tag-shade-indigo a {
color: {$sh-indigotext};
}

View file

@ -10,6 +10,10 @@
border-radius: 3px; border-radius: 3px;
} }
.phui-info-view.phui-info-view-flush {
margin: 0 0 20px 0;
}
.device .phui-info-view { .device .phui-info-view {
margin: 8px; margin: 8px;
} }

View file

@ -199,7 +199,6 @@
.phui-property-list-image-content img { .phui-property-list-image-content img {
margin: 20px auto; margin: 20px auto;
background: url('/rsrc/image/checker_light.png'); background: url('/rsrc/image/checker_light.png');
border: 1px solid {$lightblueborder};
} }
.device-desktop .phui-property-list-image-content img:hover { .device-desktop .phui-property-list-image-content img:hover {

View file

@ -79,10 +79,6 @@
margin: 0 0 20px 0; margin: 0 0 20px 0;
} }
.phui-two-column-view .phui-object-box.phui-object-box-collapsed {
padding: 0;
}
/* Timeline */ /* Timeline */
.phui-two-column-view .phui-timeline-view { .phui-two-column-view .phui-timeline-view {
@ -115,12 +111,12 @@
.device-desktop .phui-main-column .phui-property-list-key { .device-desktop .phui-main-column .phui-property-list-key {
margin-left: 0; margin-left: 0;
width: 140px; width: 160px;
} }
.device-desktop .phui-main-column .phui-property-list-value { .device-desktop .phui-main-column .phui-property-list-value {
margin-left: 8px; margin-left: 8px;
width: calc(100% - 180px); width: calc(100% - 200px);
} }
@ -132,13 +128,18 @@
} }
.device-desktop .phui-two-column-view .phui-property-list-container { .device-desktop .phui-two-column-view .phui-property-list-container {
padding: 12px 16px; padding: 16px 0;
} }
.device .phui-two-column-view .phui-property-list-container { .device .phui-two-column-view .phui-property-list-container {
padding: 12px 8px; padding: 12px 8px;
} }
.phui-two-column-view .phui-property-list-container
.keyboard-shortcuts-available {
display: none;
}
.phui-two-column-properties.phui-object-box { .phui-two-column-properties.phui-object-box {
border: 1px solid rgba({$alphablue}, .2); border: 1px solid rgba({$alphablue}, .2);
} }
@ -191,3 +192,7 @@
.phui-info-view { .phui-info-view {
margin: 0; margin: 0;
} }
.phui-two-column-view .phui-object-box .phui-header-shell + .phui-info-view {
margin: 16px 16px 0 16px;
}