@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Update Phurl to PHUITwoColumnView

Summary: Cleaner UI, moved visit to be button.

Test Plan: Make a phurl about cats, click on it.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D15385

authored by

Chad Little and committed by
chad
e3a97e31 fe01949a

+45 -41
+45 -41
src/applications/phurl/controller/PhabricatorPhurlURLViewController.php
··· 24 24 $title = $url->getMonogram(); 25 25 $page_title = $title.' '.$url->getName(); 26 26 $crumbs = $this->buildApplicationCrumbs(); 27 - $crumbs->addTextCrumb($title, $url->getURI()); 27 + $crumbs->addTextCrumb($title); 28 + $crumbs->setBorder(true); 28 29 29 30 $timeline = $this->buildTransactionTimeline( 30 31 $url, 31 32 new PhabricatorPhurlURLTransactionQuery()); 32 33 33 34 $header = $this->buildHeaderView($url); 34 - $actions = $this->buildActionView($url); 35 - $properties = $this->buildPropertyView($url); 35 + $curtain = $this->buildCurtain($url); 36 + $details = $this->buildPropertySectionView($url); 36 37 37 - $properties->setActionList($actions); 38 38 $url_error = id(new PHUIInfoView()) 39 39 ->setErrors(array(pht('This URL is invalid due to a bad protocol.'))) 40 40 ->setIsHidden($url->isValid()); 41 - $box = id(new PHUIObjectBoxView()) 42 - ->setHeader($header) 43 - ->addPropertyList($properties) 44 - ->setInfoView($url_error); 45 41 46 42 $is_serious = PhabricatorEnv::getEnvConfig('phabricator.serious-business'); 47 43 $add_comment_header = $is_serious ··· 58 54 ->setAction($comment_uri) 59 55 ->setSubmitButtonName(pht('Add Comment')); 60 56 61 - return $this->buildApplicationPage( 62 - array( 63 - $crumbs, 64 - $box, 57 + $view = id(new PHUITwoColumnView()) 58 + ->setHeader($header) 59 + ->setCurtain($curtain) 60 + ->setMainColumn(array( 61 + $url_error, 62 + $details, 65 63 $timeline, 66 64 $add_comment_form, 67 - ), 68 - array( 69 - 'title' => $page_title, 70 - 'pageObjects' => array($url->getPHID()), 65 + )); 66 + 67 + return $this->newPage() 68 + ->setTitle($page_title) 69 + ->setCrumbs($crumbs) 70 + ->setPageObjectPHIDs(array($url->getPHID())) 71 + ->appendChild( 72 + array( 73 + $view, 71 74 )); 75 + 72 76 } 73 77 74 78 private function buildHeaderView(PhabricatorPhurlURL $url) { 75 79 $viewer = $this->getViewer(); 76 - $icon = 'fa-compress'; 77 - $color = 'green'; 80 + $icon = 'fa-check'; 81 + $color = 'bluegrey'; 78 82 $status = pht('Active'); 83 + $id = $url->getID(); 84 + 85 + $visit = id(new PHUIButtonView()) 86 + ->setTag('a') 87 + ->setText(pht('Visit URL')) 88 + ->setIcon('fa-external-link') 89 + ->setHref("u/{$id}") 90 + ->setDisabled(!$url->isValid()); 79 91 80 92 $header = id(new PHUIHeaderView()) 81 93 ->setUser($viewer) 82 94 ->setHeader($url->getDisplayName()) 83 95 ->setStatus($icon, $color, $status) 84 - ->setPolicyObject($url); 96 + ->setPolicyObject($url) 97 + ->setHeaderIcon('fa-compress') 98 + ->addActionLink($visit); 85 99 86 100 return $header; 87 101 } 88 102 89 - private function buildActionView(PhabricatorPhurlURL $url) { 103 + private function buildCurtain(PhabricatorPhurlURL $url) { 90 104 $viewer = $this->getViewer(); 91 105 $id = $url->getID(); 92 106 93 - $actions = id(new PhabricatorActionListView()) 94 - ->setUser($viewer) 95 - ->setObject($url); 107 + $curtain = $this->newCurtainView($url); 96 108 97 109 $can_edit = PhabricatorPolicyFilter::hasCapability( 98 110 $viewer, 99 111 $url, 100 112 PhabricatorPolicyCapability::CAN_EDIT); 101 113 102 - $actions 114 + $curtain 103 115 ->addAction( 104 116 id(new PhabricatorActionView()) 105 117 ->setName(pht('Edit')) 106 118 ->setIcon('fa-pencil') 107 119 ->setHref($this->getApplicationURI("url/edit/{$id}/")) 108 120 ->setDisabled(!$can_edit) 109 - ->setWorkflow(!$can_edit)) 110 - ->addAction( 111 - id(new PhabricatorActionView()) 112 - ->setName(pht('Visit URL')) 113 - ->setIcon('fa-external-link') 114 - ->setHref("u/{$id}") 115 - ->setDisabled(!$url->isValid())); 121 + ->setWorkflow(!$can_edit)); 116 122 117 - return $actions; 123 + return $curtain; 118 124 } 119 125 120 - private function buildPropertyView(PhabricatorPhurlURL $url) { 126 + private function buildPropertySectionView(PhabricatorPhurlURL $url) { 121 127 $viewer = $this->getViewer(); 122 128 123 129 $properties = id(new PHUIPropertyListView()) 124 - ->setUser($viewer) 125 - ->setObject($url); 130 + ->setUser($viewer); 126 131 127 132 $properties->addProperty( 128 133 pht('Original URL'), ··· 132 137 pht('Alias'), 133 138 $url->getAlias()); 134 139 135 - $properties->invokeWillRenderEvent(); 136 - 137 140 $description = $url->getDescription(); 138 141 if (strlen($description)) { 139 142 $description = new PHUIRemarkupView($viewer, $description); 140 - $properties->addSectionHeader( 141 - pht('Description'), 142 - PHUIPropertyListView::ICON_SUMMARY); 143 + $properties->addSectionHeader(pht('Description')); 143 144 $properties->addTextContent($description); 144 145 } 145 146 146 - return $properties; 147 + return id(new PHUIObjectBoxView()) 148 + ->setHeaderText(pht('DETAILS')) 149 + ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) 150 + ->appendChild($properties); 147 151 } 148 152 149 153 }