@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.

Use modern layout in Phame Blog management

Summary: Uses PHUITwoColumnView in Blog Manage and Blog Picture. Ref T9897

Test Plan: Use each page.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T9897

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

+41 -18
+26 -16
src/applications/phame/controller/blog/PhameBlogManageController.php
··· 38 38 ->setImage($picture) 39 39 ->setStatus($header_icon, $header_color, $header_name); 40 40 41 - $actions = $this->renderActions($blog, $viewer); 42 - $properties = $this->renderProperties($blog, $viewer, $actions); 41 + $curtain = $this->buildCurtain($blog); 42 + $properties = $this->buildPropertyView($blog); 43 43 44 44 $crumbs = $this->buildApplicationCrumbs(); 45 45 $crumbs->addTextCrumb( ··· 47 47 $this->getApplicationURI('blog/')); 48 48 $crumbs->addTextCrumb( 49 49 $blog->getName()); 50 + $crumbs->setBorder(true); 50 51 51 52 $object_box = id(new PHUIObjectBoxView()) 52 53 ->setHeader($header) ··· 57 58 new PhameBlogTransactionQuery()); 58 59 $timeline->setShouldTerminate(true); 59 60 61 + $view = id(new PHUITwoColumnView()) 62 + ->setHeader($header) 63 + ->setCurtain($curtain) 64 + ->addPropertySection(pht('Details'), $properties) 65 + ->setMainColumn( 66 + array( 67 + $timeline, 68 + )); 69 + 60 70 return $this->newPage() 61 71 ->setTitle($blog->getName()) 62 72 ->setCrumbs($crumbs) 63 73 ->appendChild( 64 74 array( 65 - $object_box, 66 - $timeline, 75 + $view, 67 76 )); 68 77 } 69 78 70 - private function renderProperties( 71 - PhameBlog $blog, 72 - PhabricatorUser $viewer, 73 - PhabricatorActionListView $actions) { 79 + private function buildPropertyView(PhameBlog $blog) { 80 + $viewer = $this->getViewer(); 74 81 75 82 require_celerity_resource('aphront-tooltip-css'); 76 83 Javelin::initBehavior('phabricator-tooltips'); 77 84 78 85 $properties = id(new PHUIPropertyListView()) 79 86 ->setUser($viewer) 80 - ->setObject($blog) 81 - ->setActionList($actions); 87 + ->setObject($blog); 82 88 83 89 $domain = $blog->getDomain(); 84 90 if (!$domain) { ··· 129 135 return $properties; 130 136 } 131 137 132 - private function renderActions(PhameBlog $blog, PhabricatorUser $viewer) { 138 + private function buildCurtain(PhameBlog $blog) { 139 + $viewer = $this->getViewer(); 140 + 141 + $curtain = $this->newCurtainView($viewer); 142 + 133 143 $actions = id(new PhabricatorActionListView()) 134 144 ->setObject($blog) 135 145 ->setUser($viewer); ··· 139 149 $blog, 140 150 PhabricatorPolicyCapability::CAN_EDIT); 141 151 142 - $actions->addAction( 152 + $curtain->addAction( 143 153 id(new PhabricatorActionView()) 144 154 ->setIcon('fa-pencil') 145 155 ->setHref($this->getApplicationURI('blog/edit/'.$blog->getID().'/')) ··· 147 157 ->setDisabled(!$can_edit) 148 158 ->setWorkflow(!$can_edit)); 149 159 150 - $actions->addAction( 160 + $curtain->addAction( 151 161 id(new PhabricatorActionView()) 152 162 ->setIcon('fa-picture-o') 153 163 ->setHref($this->getApplicationURI('blog/picture/'.$blog->getID().'/')) ··· 156 166 ->setWorkflow(!$can_edit)); 157 167 158 168 if ($blog->isArchived()) { 159 - $actions->addAction( 169 + $curtain->addAction( 160 170 id(new PhabricatorActionView()) 161 171 ->setName(pht('Activate Blog')) 162 172 ->setIcon('fa-check') ··· 165 175 ->setDisabled(!$can_edit) 166 176 ->setWorkflow(true)); 167 177 } else { 168 - $actions->addAction( 178 + $curtain->addAction( 169 179 id(new PhabricatorActionView()) 170 180 ->setName(pht('Archive Blog')) 171 181 ->setIcon('fa-ban') ··· 175 185 ->setWorkflow(true)); 176 186 } 177 187 178 - return $actions; 188 + return $curtain; 179 189 } 180 190 181 191 }
+15 -2
src/applications/phame/controller/blog/PhameBlogProfilePictureController.php
··· 175 175 $form_box = id(new PHUIObjectBoxView()) 176 176 ->setHeaderText($title) 177 177 ->setFormErrors($errors) 178 + ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) 178 179 ->setForm($form); 179 180 180 181 $upload_form = id(new AphrontFormView()) ··· 194 195 195 196 $upload_box = id(new PHUIObjectBoxView()) 196 197 ->setHeaderText(pht('Upload New Picture')) 198 + ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) 197 199 ->setForm($upload_form); 198 200 199 201 $crumbs = $this->buildApplicationCrumbs(); ··· 204 206 $blog->getName(), 205 207 $this->getApplicationURI('blog/view/'.$id)); 206 208 $crumbs->addTextCrumb(pht('Blog Picture')); 209 + $crumbs->setBorder(true); 210 + 211 + $header = id(new PHUIHeaderView()) 212 + ->setHeader(pht('Edit Blog Picture')) 213 + ->setHeaderIcon('fa-camera'); 214 + 215 + $view = id(new PHUITwoColumnView()) 216 + ->setHeader($header) 217 + ->setFooter(array( 218 + $form_box, 219 + $upload_box, 220 + )); 207 221 208 222 return $this->newPage() 209 223 ->setTitle($title) 210 224 ->setCrumbs($crumbs) 211 225 ->appendChild( 212 226 array( 213 - $form_box, 214 - $upload_box, 227 + $view, 215 228 )); 216 229 217 230 }