mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-29 17:00:59 +01:00
Update Releeph to new UI
Summary: Runs through Releeph to move to new UI and `newPage` Test Plan: Ran through product, release, branch, everything seems to work. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D15623
This commit is contained in:
parent
1bd33ad759
commit
00604dff45
9 changed files with 121 additions and 85 deletions
|
@ -2,19 +2,6 @@
|
||||||
|
|
||||||
abstract class ReleephController extends PhabricatorController {
|
abstract class ReleephController extends PhabricatorController {
|
||||||
|
|
||||||
public function buildStandardPageResponse($view, array $data) {
|
|
||||||
$page = $this->buildStandardPageView();
|
|
||||||
|
|
||||||
$page->setApplicationName(pht('Releeph'));
|
|
||||||
$page->setBaseURI('/releeph/');
|
|
||||||
$page->setTitle(idx($data, 'title'));
|
|
||||||
$page->setGlyph("\xD3\x82");
|
|
||||||
$page->appendChild($view);
|
|
||||||
|
|
||||||
$response = new AphrontWebpageResponse();
|
|
||||||
return $response->setContent($page->render());
|
|
||||||
}
|
|
||||||
|
|
||||||
public function buildSideNavView($for_app = false) {
|
public function buildSideNavView($for_app = false) {
|
||||||
$user = $this->getRequest()->getUser();
|
$user = $this->getRequest()->getUser();
|
||||||
|
|
||||||
|
|
|
@ -105,20 +105,29 @@ final class ReleephBranchCreateController extends ReleephProductController {
|
||||||
->addCancelButton($product_uri));
|
->addCancelButton($product_uri));
|
||||||
|
|
||||||
$box = id(new PHUIObjectBoxView())
|
$box = id(new PHUIObjectBoxView())
|
||||||
->setHeaderText(pht('New Branch'))
|
->setHeaderText(pht('Branch'))
|
||||||
->setFormErrors($errors)
|
->setFormErrors($errors)
|
||||||
|
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||||
->appendChild($form);
|
->appendChild($form);
|
||||||
|
|
||||||
$crumbs = $this->buildApplicationCrumbs();
|
$title = pht('New Branch');
|
||||||
$crumbs->addTextCrumb(pht('New Branch'));
|
|
||||||
|
$crumbs = $this->buildApplicationCrumbs();
|
||||||
|
$crumbs->addTextCrumb($title);
|
||||||
|
$crumbs->setBorder(true);
|
||||||
|
|
||||||
|
$header = id(new PHUIHeaderView())
|
||||||
|
->setHeader($title)
|
||||||
|
->setHeaderIcon('fa-plus-square');
|
||||||
|
|
||||||
|
$view = id(new PHUITwoColumnView())
|
||||||
|
->setHeader($header)
|
||||||
|
->setFooter($box);
|
||||||
|
|
||||||
|
return $this->newPage()
|
||||||
|
->setTitle($title)
|
||||||
|
->setCrumbs($crumbs)
|
||||||
|
->appendChild($view);
|
||||||
|
|
||||||
return $this->buildApplicationPage(
|
|
||||||
array(
|
|
||||||
$crumbs,
|
|
||||||
$box,
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
'title' => pht('New Branch'),
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,23 +86,29 @@ final class ReleephBranchEditController extends ReleephBranchController {
|
||||||
->setValue(pht('Save Branch')));
|
->setValue(pht('Save Branch')));
|
||||||
|
|
||||||
$title = pht(
|
$title = pht(
|
||||||
'Edit Branch %s',
|
'Edit Branch: %s',
|
||||||
$branch->getDisplayNameWithDetail());
|
$branch->getDisplayNameWithDetail());
|
||||||
|
|
||||||
|
$box = id(new PHUIObjectBoxView())
|
||||||
|
->setHeaderText(pht('Branch'))
|
||||||
|
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||||
|
->appendChild($form);
|
||||||
|
|
||||||
$crumbs = $this->buildApplicationCrumbs();
|
$crumbs = $this->buildApplicationCrumbs();
|
||||||
$crumbs->addTextCrumb(pht('Edit'));
|
$crumbs->addTextCrumb(pht('Edit'));
|
||||||
|
$crumbs->setBorder(true);
|
||||||
|
|
||||||
$box = id(new PHUIObjectBoxView())
|
$header = id(new PHUIHeaderView())
|
||||||
->setHeaderText($title)
|
->setHeader(pht('Edit Branch'))
|
||||||
->appendChild($form);
|
->setHeaderIcon('fa-pencil');
|
||||||
|
|
||||||
return $this->buildApplicationPage(
|
$view = id(new PHUITwoColumnView())
|
||||||
array(
|
->setHeader($header)
|
||||||
$crumbs,
|
->setFooter($box);
|
||||||
$box,
|
|
||||||
),
|
return $this->newPage()
|
||||||
array(
|
->setTitle($title)
|
||||||
'title' => $title,
|
->setCrumbs($crumbs)
|
||||||
));
|
->appendChild($view);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,15 +27,15 @@ final class ReleephBranchHistoryController extends ReleephBranchController {
|
||||||
|
|
||||||
$crumbs = $this->buildApplicationCrumbs();
|
$crumbs = $this->buildApplicationCrumbs();
|
||||||
$crumbs->addTextCrumb(pht('History'));
|
$crumbs->addTextCrumb(pht('History'));
|
||||||
|
$crumbs->setBorder(true);
|
||||||
|
|
||||||
|
$title = pht('Branch History');
|
||||||
|
|
||||||
|
return $this->newPage()
|
||||||
|
->setTitle($title)
|
||||||
|
->setCrumbs($crumbs)
|
||||||
|
->appendChild($timeline);
|
||||||
|
|
||||||
return $this->buildApplicationPage(
|
|
||||||
array(
|
|
||||||
$crumbs,
|
|
||||||
$timeline,
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
'title' => pht('Branch History'),
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -91,22 +91,30 @@ final class ReleephProductCreateController extends ReleephProductController {
|
||||||
->addCancelButton('/releeph/project/')
|
->addCancelButton('/releeph/project/')
|
||||||
->setValue(pht('Create Release Product')));
|
->setValue(pht('Create Release Product')));
|
||||||
|
|
||||||
$form_box = id(new PHUIObjectBoxView())
|
$box = id(new PHUIObjectBoxView())
|
||||||
->setHeaderText(pht('Create New Product'))
|
->setHeaderText(pht('Product'))
|
||||||
->setFormErrors($errors)
|
->setFormErrors($errors)
|
||||||
|
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||||
->setForm($form);
|
->setForm($form);
|
||||||
|
|
||||||
|
$title = pht('Create New Product');
|
||||||
|
|
||||||
$crumbs = $this->buildApplicationCrumbs();
|
$crumbs = $this->buildApplicationCrumbs();
|
||||||
$crumbs->addTextCrumb(pht('New Product'));
|
$crumbs->addTextCrumb(pht('New Product'));
|
||||||
|
$crumbs->setBorder(true);
|
||||||
|
|
||||||
return $this->buildApplicationPage(
|
$header = id(new PHUIHeaderView())
|
||||||
array(
|
->setHeader($title)
|
||||||
$crumbs,
|
->setHeaderIcon('fa-plus-square');
|
||||||
$form_box,
|
|
||||||
),
|
$view = id(new PHUITwoColumnView())
|
||||||
array(
|
->setHeader($header)
|
||||||
'title' => pht('Create New Product'),
|
->setFooter($box);
|
||||||
));
|
|
||||||
|
return $this->newPage()
|
||||||
|
->setTitle($title)
|
||||||
|
->setCrumbs($crumbs)
|
||||||
|
->appendChild($view);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getRepositorySelectOptions() {
|
private function getRepositorySelectOptions() {
|
||||||
|
|
|
@ -195,22 +195,30 @@ final class ReleephProductEditController extends ReleephProductController {
|
||||||
->setValue(pht('Save')));
|
->setValue(pht('Save')));
|
||||||
|
|
||||||
$box = id(new PHUIObjectBoxView())
|
$box = id(new PHUIObjectBoxView())
|
||||||
->setHeaderText(pht('Edit Releeph Product'))
|
->setHeaderText(pht('Product'))
|
||||||
->setFormErrors($errors)
|
->setFormErrors($errors)
|
||||||
|
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||||
->appendChild($form);
|
->appendChild($form);
|
||||||
|
|
||||||
|
$title = pht('Edit Product');
|
||||||
|
|
||||||
$crumbs = $this->buildApplicationCrumbs();
|
$crumbs = $this->buildApplicationCrumbs();
|
||||||
$crumbs->addTextCrumb(pht('Edit Product'));
|
$crumbs->addTextCrumb(pht('Edit Product'));
|
||||||
|
$crumbs->setBorder(true);
|
||||||
|
|
||||||
|
$header = id(new PHUIHeaderView())
|
||||||
|
->setHeader($title)
|
||||||
|
->setHeaderIcon('fa-pencil');
|
||||||
|
|
||||||
|
$view = id(new PHUITwoColumnView())
|
||||||
|
->setHeader($header)
|
||||||
|
->setFooter($box);
|
||||||
|
|
||||||
|
return $this->newPage()
|
||||||
|
->setTitle($title)
|
||||||
|
->setCrumbs($crumbs)
|
||||||
|
->appendChild($view);
|
||||||
|
|
||||||
return $this->buildStandardPageResponse(
|
|
||||||
array(
|
|
||||||
$crumbs,
|
|
||||||
$box,
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
'title' => pht('Edit Releeph Product'),
|
|
||||||
'device' => true,
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getBranchHelpText() {
|
private function getBranchHelpText() {
|
||||||
|
|
|
@ -28,14 +28,12 @@ final class ReleephProductHistoryController extends ReleephProductController {
|
||||||
$crumbs->addTextCrumb(pht('History'));
|
$crumbs->addTextCrumb(pht('History'));
|
||||||
$crumbs->setBorder(true);
|
$crumbs->setBorder(true);
|
||||||
|
|
||||||
return $this->buildApplicationPage(
|
$title = pht('Product History');
|
||||||
array(
|
|
||||||
$crumbs,
|
return $this->newPage()
|
||||||
$timeline,
|
->setTitle($title)
|
||||||
),
|
->setCrumbs($crumbs)
|
||||||
array(
|
->appendChild($timeline);
|
||||||
'title' => pht('Product History'),
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -275,12 +275,14 @@ final class ReleephRequestEditController extends ReleephBranchController {
|
||||||
if ($is_edit) {
|
if ($is_edit) {
|
||||||
$title = pht('Edit Pull Request');
|
$title = pht('Edit Pull Request');
|
||||||
$submit_name = pht('Save');
|
$submit_name = pht('Save');
|
||||||
|
$header_icon = 'fa-pencil';
|
||||||
|
|
||||||
$crumbs->addTextCrumb($pull->getMonogram(), '/'.$pull->getMonogram());
|
$crumbs->addTextCrumb($pull->getMonogram(), '/'.$pull->getMonogram());
|
||||||
$crumbs->addTextCrumb(pht('Edit'));
|
$crumbs->addTextCrumb(pht('Edit'));
|
||||||
} else {
|
} else {
|
||||||
$title = pht('Create Pull Request');
|
$title = pht('Create Pull Request');
|
||||||
$submit_name = pht('Create Pull Request');
|
$submit_name = pht('Create Pull Request');
|
||||||
|
$header_icon = 'fa-plus-square';
|
||||||
|
|
||||||
$crumbs->addTextCrumb(pht('New Pull Request'));
|
$crumbs->addTextCrumb(pht('New Pull Request'));
|
||||||
}
|
}
|
||||||
|
@ -291,18 +293,28 @@ final class ReleephRequestEditController extends ReleephBranchController {
|
||||||
->setValue($submit_name));
|
->setValue($submit_name));
|
||||||
|
|
||||||
$box = id(new PHUIObjectBoxView())
|
$box = id(new PHUIObjectBoxView())
|
||||||
->setHeaderText($title)
|
->setHeaderText(pht('Request'))
|
||||||
->setFormErrors($errors)
|
->setFormErrors($errors)
|
||||||
|
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||||
->appendChild($form);
|
->appendChild($form);
|
||||||
|
|
||||||
return $this->buildApplicationPage(
|
$crumbs->setBorder(true);
|
||||||
array(
|
|
||||||
$crumbs,
|
$header = id(new PHUIHeaderView())
|
||||||
|
->setHeader($title)
|
||||||
|
->setHeaderIcon($header_icon);
|
||||||
|
|
||||||
|
$view = id(new PHUITwoColumnView())
|
||||||
|
->setHeader($header)
|
||||||
|
->setFooter(array(
|
||||||
$notice_view,
|
$notice_view,
|
||||||
$box,
|
$box,
|
||||||
),
|
|
||||||
array(
|
|
||||||
'title' => $title,
|
|
||||||
));
|
));
|
||||||
|
|
||||||
|
return $this->newPage()
|
||||||
|
->setTitle($title)
|
||||||
|
->setCrumbs($crumbs)
|
||||||
|
->appendChild($view);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,17 +76,25 @@ final class ReleephRequestViewController
|
||||||
|
|
||||||
$crumbs = $this->buildApplicationCrumbs();
|
$crumbs = $this->buildApplicationCrumbs();
|
||||||
$crumbs->addTextCrumb($pull->getMonogram(), '/'.$pull->getMonogram());
|
$crumbs->addTextCrumb($pull->getMonogram(), '/'.$pull->getMonogram());
|
||||||
|
$crumbs->setBorder(true);
|
||||||
|
|
||||||
return $this->buildStandardPageResponse(
|
$header = id(new PHUIHeaderView())
|
||||||
array(
|
->setHeader($title)
|
||||||
$crumbs,
|
->setHeaderIcon('fa-flag-checkered');
|
||||||
|
|
||||||
|
$view = id(new PHUITwoColumnView())
|
||||||
|
->setHeader($header)
|
||||||
|
->setFooter(array(
|
||||||
$pull_box,
|
$pull_box,
|
||||||
$timeline,
|
$timeline,
|
||||||
$add_comment_form,
|
$add_comment_form,
|
||||||
),
|
|
||||||
array(
|
|
||||||
'title' => $title,
|
|
||||||
));
|
));
|
||||||
|
|
||||||
|
return $this->newPage()
|
||||||
|
->setTitle($title)
|
||||||
|
->setCrumbs($crumbs)
|
||||||
|
->appendChild($view);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue