1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-26 00:32:42 +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-list.css' => 'f3c47d33',
'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-readme.css' => '419dd5b6',
'rsrc/css/application/diffusion/diffusion-repository.css' => 'ee6f20ec',
'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/files/global-drag-and-drop.css' => '5c1b47c2',
'rsrc/css/application/flag/flag.css' => 'bba8f811',
@ -570,7 +570,7 @@ return array(
'differential-revision-history-css' => '0e8eb855',
'differential-revision-list-css' => 'f3c47d33',
'differential-table-of-contents-css' => 'ae4b7a55',
'diffusion-history-css' => '898ed727',
'diffusion-css' => '08991f7e',
'diffusion-icons-css' => '0c15255e',
'diffusion-readme-css' => '419dd5b6',
'diffusion-repository-css' => 'ee6f20ec',

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -3,6 +3,7 @@
final class AphrontFormTypeaheadControl extends AphrontFormControl {
private $hardpointID;
private $placeholder;
public function setHardpointID($hardpoint_id) {
$this->hardpointID = $hardpoint_id;
@ -13,6 +14,11 @@ final class AphrontFormTypeaheadControl extends AphrontFormControl {
return $this->hardpointID;
}
public function setPlaceholder($placeholder) {
$this->placeholder = $placeholder;
return $this;
}
protected function getCustomControlClass() {
return 'aphront-form-control-typeahead';
}
@ -30,6 +36,7 @@ final class AphrontFormTypeaheadControl extends AphrontFormControl {
'type' => 'text',
'name' => $this->getName(),
'value' => $this->getValue(),
'placeholder' => $this->placeholder,
'disabled' => $this->getDisabled() ? 'disabled' : null,
'autocomplete' => 'off',
'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 ------------------------------------------------------------*/
.diffusion-history-list .phui-oi-link {