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:
		| @@ -2,19 +2,6 @@ | ||||
|  | ||||
| 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) { | ||||
|     $user = $this->getRequest()->getUser(); | ||||
|  | ||||
|   | ||||
| @@ -105,20 +105,29 @@ final class ReleephBranchCreateController extends ReleephProductController { | ||||
|           ->addCancelButton($product_uri)); | ||||
|  | ||||
|     $box = id(new PHUIObjectBoxView()) | ||||
|       ->setHeaderText(pht('New Branch')) | ||||
|       ->setHeaderText(pht('Branch')) | ||||
|       ->setFormErrors($errors) | ||||
|       ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) | ||||
|       ->appendChild($form); | ||||
|  | ||||
|     $crumbs = $this->buildApplicationCrumbs(); | ||||
|     $crumbs->addTextCrumb(pht('New Branch')); | ||||
|     $title = 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'))); | ||||
|  | ||||
|     $title = pht( | ||||
|       'Edit Branch %s', | ||||
|       'Edit Branch: %s', | ||||
|       $branch->getDisplayNameWithDetail()); | ||||
|  | ||||
|     $box = id(new PHUIObjectBoxView()) | ||||
|       ->setHeaderText(pht('Branch')) | ||||
|       ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) | ||||
|       ->appendChild($form); | ||||
|  | ||||
|     $crumbs = $this->buildApplicationCrumbs(); | ||||
|     $crumbs->addTextCrumb(pht('Edit')); | ||||
|     $crumbs->setBorder(true); | ||||
|  | ||||
|     $box = id(new PHUIObjectBoxView()) | ||||
|       ->setHeaderText($title) | ||||
|       ->appendChild($form); | ||||
|     $header = id(new PHUIHeaderView()) | ||||
|       ->setHeader(pht('Edit Branch')) | ||||
|       ->setHeaderIcon('fa-pencil'); | ||||
|  | ||||
|     return $this->buildApplicationPage( | ||||
|       array( | ||||
|         $crumbs, | ||||
|         $box, | ||||
|       ), | ||||
|       array( | ||||
|         'title' => $title, | ||||
|       )); | ||||
|     $view = id(new PHUITwoColumnView()) | ||||
|       ->setHeader($header) | ||||
|       ->setFooter($box); | ||||
|  | ||||
|     return $this->newPage() | ||||
|       ->setTitle($title) | ||||
|       ->setCrumbs($crumbs) | ||||
|       ->appendChild($view); | ||||
|   } | ||||
| } | ||||
|   | ||||
| @@ -27,15 +27,15 @@ final class ReleephBranchHistoryController extends ReleephBranchController { | ||||
|  | ||||
|     $crumbs = $this->buildApplicationCrumbs(); | ||||
|     $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/') | ||||
|           ->setValue(pht('Create Release Product'))); | ||||
|  | ||||
|     $form_box = id(new PHUIObjectBoxView()) | ||||
|       ->setHeaderText(pht('Create New Product')) | ||||
|     $box = id(new PHUIObjectBoxView()) | ||||
|       ->setHeaderText(pht('Product')) | ||||
|       ->setFormErrors($errors) | ||||
|       ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) | ||||
|       ->setForm($form); | ||||
|  | ||||
|     $title = pht('Create New Product'); | ||||
|  | ||||
|     $crumbs = $this->buildApplicationCrumbs(); | ||||
|     $crumbs->addTextCrumb(pht('New Product')); | ||||
|     $crumbs->setBorder(true); | ||||
|  | ||||
|     return $this->buildApplicationPage( | ||||
|       array( | ||||
|         $crumbs, | ||||
|         $form_box, | ||||
|       ), | ||||
|       array( | ||||
|         'title' => pht('Create New Product'), | ||||
|       )); | ||||
|     $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); | ||||
|   } | ||||
|  | ||||
|   private function getRepositorySelectOptions() { | ||||
|   | ||||
| @@ -195,22 +195,30 @@ final class ReleephProductEditController extends ReleephProductController { | ||||
|           ->setValue(pht('Save'))); | ||||
|  | ||||
|     $box = id(new PHUIObjectBoxView()) | ||||
|       ->setHeaderText(pht('Edit Releeph Product')) | ||||
|       ->setHeaderText(pht('Product')) | ||||
|       ->setFormErrors($errors) | ||||
|       ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) | ||||
|       ->appendChild($form); | ||||
|  | ||||
|     $title = pht('Edit Product'); | ||||
|  | ||||
|     $crumbs = $this->buildApplicationCrumbs(); | ||||
|     $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() { | ||||
|   | ||||
| @@ -28,14 +28,12 @@ final class ReleephProductHistoryController extends ReleephProductController { | ||||
|     $crumbs->addTextCrumb(pht('History')); | ||||
|     $crumbs->setBorder(true); | ||||
|  | ||||
|     return $this->buildApplicationPage( | ||||
|       array( | ||||
|         $crumbs, | ||||
|         $timeline, | ||||
|       ), | ||||
|       array( | ||||
|         'title' => pht('Product History'), | ||||
|       )); | ||||
|     $title = pht('Product History'); | ||||
|  | ||||
|     return $this->newPage() | ||||
|       ->setTitle($title) | ||||
|       ->setCrumbs($crumbs) | ||||
|       ->appendChild($timeline); | ||||
|   } | ||||
|  | ||||
| } | ||||
|   | ||||
| @@ -275,12 +275,14 @@ final class ReleephRequestEditController extends ReleephBranchController { | ||||
|     if ($is_edit) { | ||||
|       $title = pht('Edit Pull Request'); | ||||
|       $submit_name = pht('Save'); | ||||
|       $header_icon = 'fa-pencil'; | ||||
|  | ||||
|       $crumbs->addTextCrumb($pull->getMonogram(), '/'.$pull->getMonogram()); | ||||
|       $crumbs->addTextCrumb(pht('Edit')); | ||||
|     } else { | ||||
|       $title = pht('Create Pull Request'); | ||||
|       $submit_name = pht('Create Pull Request'); | ||||
|       $header_icon = 'fa-plus-square'; | ||||
|  | ||||
|       $crumbs->addTextCrumb(pht('New Pull Request')); | ||||
|     } | ||||
| @@ -291,18 +293,28 @@ final class ReleephRequestEditController extends ReleephBranchController { | ||||
|         ->setValue($submit_name)); | ||||
|  | ||||
|     $box = id(new PHUIObjectBoxView()) | ||||
|       ->setHeaderText($title) | ||||
|       ->setHeaderText(pht('Request')) | ||||
|       ->setFormErrors($errors) | ||||
|       ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) | ||||
|       ->appendChild($form); | ||||
|  | ||||
|     return $this->buildApplicationPage( | ||||
|       array( | ||||
|         $crumbs, | ||||
|     $crumbs->setBorder(true); | ||||
|  | ||||
|     $header = id(new PHUIHeaderView()) | ||||
|       ->setHeader($title) | ||||
|       ->setHeaderIcon($header_icon); | ||||
|  | ||||
|     $view = id(new PHUITwoColumnView()) | ||||
|       ->setHeader($header) | ||||
|       ->setFooter(array( | ||||
|         $notice_view, | ||||
|         $box, | ||||
|       ), | ||||
|       array( | ||||
|         'title' => $title, | ||||
|       )); | ||||
|  | ||||
|     return $this->newPage() | ||||
|       ->setTitle($title) | ||||
|       ->setCrumbs($crumbs) | ||||
|       ->appendChild($view); | ||||
|  | ||||
|   } | ||||
| } | ||||
|   | ||||
| @@ -76,17 +76,25 @@ final class ReleephRequestViewController | ||||
|  | ||||
|     $crumbs = $this->buildApplicationCrumbs(); | ||||
|     $crumbs->addTextCrumb($pull->getMonogram(), '/'.$pull->getMonogram()); | ||||
|     $crumbs->setBorder(true); | ||||
|  | ||||
|     return $this->buildStandardPageResponse( | ||||
|       array( | ||||
|         $crumbs, | ||||
|     $header = id(new PHUIHeaderView()) | ||||
|       ->setHeader($title) | ||||
|       ->setHeaderIcon('fa-flag-checkered'); | ||||
|  | ||||
|     $view = id(new PHUITwoColumnView()) | ||||
|       ->setHeader($header) | ||||
|       ->setFooter(array( | ||||
|         $pull_box, | ||||
|         $timeline, | ||||
|         $add_comment_form, | ||||
|       ), | ||||
|       array( | ||||
|         'title' => $title, | ||||
|       )); | ||||
|  | ||||
|     return $this->newPage() | ||||
|       ->setTitle($title) | ||||
|       ->setCrumbs($crumbs) | ||||
|       ->appendChild($view); | ||||
|  | ||||
|   } | ||||
|  | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Chad Little
					Chad Little