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

Move actions into Diffusion header

Summary: This moves actions into the Diffusion main header, removes the locate file box, and widens description and cloning details. Projects are not currently in this layout, but will follow up in another diff. Trying to keep these changes small and iterative.

Test Plan:
Locate some files, test actions dropdown, repository with and without description. Also tablet, mobile layouts.

{F5040026}

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D18193
This commit is contained in:
Chad Little 2017-07-09 18:38:38 -07:00
parent b4aedab955
commit 646ad36b15
9 changed files with 76 additions and 30 deletions

View file

@ -71,11 +71,11 @@ 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-history.css' => '898ed727',
'rsrc/css/application/diffusion/diffusion-icons.css' => '0c15255e', 'rsrc/css/application/diffusion/diffusion-icons.css' => '0c15255e',
'rsrc/css/application/diffusion/diffusion-readme.css' => '419dd5b6', 'rsrc/css/application/diffusion/diffusion-readme.css' => '419dd5b6',
'rsrc/css/application/diffusion/diffusion-repository.css' => 'ee6f20ec', 'rsrc/css/application/diffusion/diffusion-repository.css' => 'ee6f20ec',
'rsrc/css/application/diffusion/diffusion-source.css' => '750add59', 'rsrc/css/application/diffusion/diffusion-source.css' => '750add59',
'rsrc/css/application/diffusion/diffusion.css' => '08991f7e',
'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' => 'bba8f811', 'rsrc/css/application/flag/flag.css' => 'bba8f811',
@ -570,7 +570,7 @@ 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-history-css' => '898ed727', 'diffusion-css' => '08991f7e',
'diffusion-icons-css' => '0c15255e', 'diffusion-icons-css' => '0c15255e',
'diffusion-readme-css' => '419dd5b6', 'diffusion-readme-css' => '419dd5b6',
'diffusion-repository-css' => 'ee6f20ec', 'diffusion-repository-css' => 'ee6f20ec',

View file

@ -17,6 +17,8 @@ final class DiffusionRepositoryController extends DiffusionController {
return $response; return $response;
} }
require_celerity_resource('diffusion-css');
$viewer = $this->getViewer(); $viewer = $this->getViewer();
$drequest = $this->getDiffusionRequest(); $drequest = $this->getDiffusionRequest();
$repository = $drequest->getRepository(); $repository = $drequest->getRepository();
@ -25,11 +27,13 @@ final class DiffusionRepositoryController extends DiffusionController {
$crumbs->setBorder(true); $crumbs->setBorder(true);
$header = $this->buildHeaderView($repository); $header = $this->buildHeaderView($repository);
$curtain = $this->buildCurtain($repository);
$property_table = $this->buildPropertiesTable($repository); $property_table = $this->buildPropertiesTable($repository);
$actions = $this->buildActionList($repository);
$description = $this->buildDescriptionView($repository); $description = $this->buildDescriptionView($repository);
$locate_file = $this->buildLocateFile(); $locate_file = $this->buildLocateFile();
$header->setActionList($actions);
// 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.
$page_has_content = false; $page_has_content = false;
@ -88,14 +92,13 @@ final class DiffusionRepositoryController extends DiffusionController {
$view = id(new PHUITwoColumnView()) $view = id(new PHUITwoColumnView())
->setHeader($header) ->setHeader($header)
->setCurtain($curtain)
->setTabs($tabs) ->setTabs($tabs)
->setMainColumn(array( ->setFooter(array(
$locate_file,
$property_table, $property_table,
$description, $description,
$locate_file, $content,
)) ));
->setFooter($content);
return $this->newPage() return $this->newPage()
->setTitle( ->setTitle(
@ -236,7 +239,8 @@ final class DiffusionRepositoryController extends DiffusionController {
->setPolicyObject($repository) ->setPolicyObject($repository)
->setProfileHeader(true) ->setProfileHeader(true)
->setImage($repository->getProfileImageURI()) ->setImage($repository->getProfileImageURI())
->setImageEditURL('/diffusion/picture/'.$repository->getID().'/'); ->setImageEditURL('/diffusion/picture/'.$repository->getID().'/')
->addClass('diffusion-profile-header');
if (!$repository->isTracked()) { if (!$repository->isTracked()) {
$header->setStatus('fa-ban', 'dark', pht('Inactive')); $header->setStatus('fa-ban', 'dark', pht('Inactive'));
@ -254,13 +258,15 @@ final class DiffusionRepositoryController extends DiffusionController {
return $header; return $header;
} }
private function buildCurtain(PhabricatorRepository $repository) { private function buildActionList(PhabricatorRepository $repository) {
$viewer = $this->getViewer(); $viewer = $this->getViewer();
$edit_uri = $repository->getPathURI('manage/'); $edit_uri = $repository->getPathURI('manage/');
$curtain = $this->newCurtainView($repository); $action_view = id(new PhabricatorActionListView())
->setUser($viewer)
->setObject($repository);
$curtain->addAction( $action_view->addAction(
id(new PhabricatorActionView()) id(new PhabricatorActionView())
->setName(pht('Manage Repository')) ->setName(pht('Manage Repository'))
->setIcon('fa-cogs') ->setIcon('fa-cogs')
@ -270,14 +276,14 @@ final class DiffusionRepositoryController extends DiffusionController {
$push_uri = $this->getApplicationURI( $push_uri = $this->getApplicationURI(
'pushlog/?repositories='.$repository->getMonogram()); 'pushlog/?repositories='.$repository->getMonogram());
$curtain->addAction( $action_view->addAction(
id(new PhabricatorActionView()) id(new PhabricatorActionView())
->setName(pht('View Push Logs')) ->setName(pht('View Push Logs'))
->setIcon('fa-list-alt') ->setIcon('fa-list-alt')
->setHref($push_uri)); ->setHref($push_uri));
} }
return $curtain; return $action_view;
} }
private function buildDescriptionView(PhabricatorRepository $repository) { private function buildDescriptionView(PhabricatorRepository $repository) {
@ -290,9 +296,8 @@ final class DiffusionRepositoryController extends DiffusionController {
$description = new PHUIRemarkupView($viewer, $description); $description = new PHUIRemarkupView($viewer, $description);
$view->addTextContent($description); $view->addTextContent($description);
return id(new PHUIObjectBoxView()) return id(new PHUIObjectBoxView())
->setHeaderText(pht('Description')) ->appendChild($view)
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) ->addClass('diffusion-profile-description');
->appendChild($view);
} }
return null; return null;
} }
@ -455,15 +460,12 @@ final class DiffusionRepositoryController extends DiffusionController {
id(new AphrontFormTypeaheadControl()) id(new AphrontFormTypeaheadControl())
->setHardpointID('locate-control') ->setHardpointID('locate-control')
->setID('locate-input') ->setID('locate-input')
->setLabel(pht('Locate File'))); ->setPlaceholder(pht('Locate File')));
$form_box = id(new PHUIBoxView()) $form_box = id(new PHUIBoxView())
->appendChild($form->buildLayoutView()); ->appendChild($form->buildLayoutView())
$locate_panel = id(new PHUIObjectBoxView()) ->addClass('diffusion-profile-locate');
->setHeaderText(pht('Locate File'))
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->appendChild($form_box);
} }
return $locate_panel; return $form_box;
} }
private function buildBrowseTable( private function buildBrowseTable(

View file

@ -23,7 +23,7 @@ final class DiffusionBranchListView extends DiffusionView {
$repository = $drequest->getRepository(); $repository = $drequest->getRepository();
$commits = $this->commits; $commits = $this->commits;
$viewer = $this->getUser(); $viewer = $this->getUser();
require_celerity_resource('diffusion-history-css'); require_celerity_resource('diffusion-css');
$buildables = $this->loadBuildables($commits); $buildables = $this->loadBuildables($commits);
$have_builds = false; $have_builds = false;

View file

@ -20,7 +20,7 @@ final class DiffusionBrowseTableView extends DiffusionView {
public function render() { public function render() {
$request = $this->getDiffusionRequest(); $request = $this->getDiffusionRequest();
$repository = $request->getRepository(); $repository = $request->getRepository();
require_celerity_resource('diffusion-history-css'); require_celerity_resource('diffusion-css');
$base_path = trim($request->getPath(), '/'); $base_path = trim($request->getPath(), '/');
if ($base_path) { if ($base_path) {

View file

@ -73,7 +73,7 @@ final class DiffusionCommitListView extends AphrontView {
} }
public function render() { public function render() {
require_celerity_resource('diffusion-history-css'); require_celerity_resource('diffusion-css');
return $this->buildList(); return $this->buildList();
} }

View file

@ -7,7 +7,7 @@ final class DiffusionHistoryListView extends DiffusionHistoryView {
$viewer = $this->getUser(); $viewer = $this->getUser();
$repository = $drequest->getRepository(); $repository = $drequest->getRepository();
require_celerity_resource('diffusion-history-css'); require_celerity_resource('diffusion-css');
Javelin::initBehavior('phabricator-tooltips'); Javelin::initBehavior('phabricator-tooltips');
$buildables = $this->loadBuildables( $buildables = $this->loadBuildables(

View file

@ -29,7 +29,7 @@ final class DiffusionTagListView extends DiffusionView {
$drequest = $this->getDiffusionRequest(); $drequest = $this->getDiffusionRequest();
$repository = $drequest->getRepository(); $repository = $drequest->getRepository();
$viewer = $this->getViewer(); $viewer = $this->getViewer();
require_celerity_resource('diffusion-history-css'); require_celerity_resource('diffusion-css');
$buildables = $this->loadBuildables($this->commits); $buildables = $this->loadBuildables($this->commits);

View file

@ -3,6 +3,7 @@
final class AphrontFormTypeaheadControl extends AphrontFormControl { final class AphrontFormTypeaheadControl extends AphrontFormControl {
private $hardpointID; private $hardpointID;
private $placeholder;
public function setHardpointID($hardpoint_id) { public function setHardpointID($hardpoint_id) {
$this->hardpointID = $hardpoint_id; $this->hardpointID = $hardpoint_id;
@ -13,6 +14,11 @@ final class AphrontFormTypeaheadControl extends AphrontFormControl {
return $this->hardpointID; return $this->hardpointID;
} }
public function setPlaceholder($placeholder) {
$this->placeholder = $placeholder;
return $this;
}
protected function getCustomControlClass() { protected function getCustomControlClass() {
return 'aphront-form-control-typeahead'; return 'aphront-form-control-typeahead';
} }
@ -30,6 +36,7 @@ final class AphrontFormTypeaheadControl extends AphrontFormControl {
'type' => 'text', 'type' => 'text',
'name' => $this->getName(), 'name' => $this->getName(),
'value' => $this->getValue(), 'value' => $this->getValue(),
'placeholder' => $this->placeholder,
'disabled' => $this->getDisabled() ? 'disabled' : null, 'disabled' => $this->getDisabled() ? 'disabled' : null,
'autocomplete' => 'off', 'autocomplete' => 'off',
'id' => $this->getID(), 'id' => $this->getID(),

View file

@ -1,7 +1,44 @@
/** /**
* @provides diffusion-history-css * @provides diffusion-css
*/ */
/* - Home Styles ------------------------------------------------------------*/
.diffusion-profile-header.phui-profile-header .phui-header-col3 {
vertical-align: middle;
}
.diffusion-profile-header .phui-header-action-links a.button {
display: block;
}
.diffusion-profile-locate .phui-form-view {
margin: 0 0 16px 0;
padding: 0;
}
.diffusion-profile-locate .phui-form-view .aphront-form-control {
padding: 0;
}
.diffusion-profile-locate .phui-form-view .aphront-form-input {
margin: 0;
width: 480px;
}
.device .diffusion-profile-locate .phui-form-view .aphront-form-input {
margin: 0;
width: 100%;
}
.diffusion-profile-description.phui-object-box {
padding: 0;
}
.device-phone .diffusion-profile-description.phui-object-box {
padding: 0;
}
/* - List Styles ------------------------------------------------------------*/ /* - List Styles ------------------------------------------------------------*/
.diffusion-history-list .phui-oi-link { .diffusion-history-list .phui-oi-link {