@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 Badges for PHUITwoColumnView

Summary: Updates the layout to two column, moves "Add Receipients" to dialog. Ref T10318

Test Plan: Give badges, revoke badges.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T10318

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

+57 -51
+2 -2
resources/celerity/map.php
··· 155 155 'rsrc/css/phui/phui-status.css' => '888cedb8', 156 156 'rsrc/css/phui/phui-tag-view.css' => '9d5d4400', 157 157 'rsrc/css/phui/phui-timeline-view.css' => '2efceff8', 158 - 'rsrc/css/phui/phui-two-column-view.css' => 'cc0b8a09', 158 + 'rsrc/css/phui/phui-two-column-view.css' => '64355d16', 159 159 'rsrc/css/phui/workboards/phui-workboard-color.css' => 'ac6fe6a7', 160 160 'rsrc/css/phui/workboards/phui-workboard.css' => 'e6d89647', 161 161 'rsrc/css/phui/workboards/phui-workcard.css' => '3646fb96', ··· 843 843 'phui-tag-view-css' => '9d5d4400', 844 844 'phui-theme-css' => '027ba77e', 845 845 'phui-timeline-view-css' => '2efceff8', 846 - 'phui-two-column-view-css' => 'cc0b8a09', 846 + 'phui-two-column-view-css' => '64355d16', 847 847 'phui-workboard-color-css' => 'ac6fe6a7', 848 848 'phui-workboard-view-css' => 'e6d89647', 849 849 'phui-workcard-view-css' => '3646fb96',
+1 -1
src/__phutil_library_map__.php
··· 6123 6123 'PhabricatorBadgesMailReceiver' => 'PhabricatorObjectMailReceiver', 6124 6124 'PhabricatorBadgesPHIDType' => 'PhabricatorPHIDType', 6125 6125 'PhabricatorBadgesQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 6126 - 'PhabricatorBadgesRecipientsListView' => 'AphrontTagView', 6126 + 'PhabricatorBadgesRecipientsListView' => 'AphrontView', 6127 6127 'PhabricatorBadgesRemoveRecipientsController' => 'PhabricatorBadgesController', 6128 6128 'PhabricatorBadgesReplyHandler' => 'PhabricatorApplicationTransactionReplyHandler', 6129 6129 'PhabricatorBadgesSchemaSpec' => 'PhabricatorConfigSchemaSpec',
+11 -28
src/applications/badges/controller/PhabricatorBadgesEditRecipientsController.php
··· 22 22 } 23 23 24 24 $recipient_phids = $badge->getRecipientPHIDs(); 25 + $view_uri = $this->getApplicationURI('view/'.$badge->getID().'/'); 25 26 26 27 if ($request->isFormPost()) { 27 28 $recipient_spec = array(); ··· 53 54 ->applyTransactions($badge, $xactions); 54 55 55 56 return id(new AphrontRedirectResponse()) 56 - ->setURI($request->getRequestURI()); 57 + ->setURI($view_uri); 57 58 } 58 59 59 60 $recipient_phids = array_reverse($recipient_phids); ··· 76 77 $title = pht('Add Recipient'); 77 78 if ($can_edit) { 78 79 $header_name = pht('Edit Recipients'); 79 - $view_uri = $this->getApplicationURI('view/'.$badge->getID().'/'); 80 80 81 81 $form = new AphrontFormView(); 82 82 $form 83 83 ->setUser($viewer) 84 + ->setFullWidth(true) 84 85 ->appendControl( 85 86 id(new AphrontFormTokenizerControl()) 86 87 ->setName('phids') 87 88 ->setLabel(pht('Add Recipients')) 88 - ->setDatasource(new PhabricatorPeopleDatasource())) 89 - ->appendChild( 90 - id(new AphrontFormSubmitControl()) 91 - ->addCancelButton($view_uri) 92 - ->setValue(pht('Add Recipients'))); 93 - $form_box = id(new PHUIObjectBoxView()) 94 - ->setHeaderText($title) 95 - ->setForm($form); 89 + ->setDatasource(new PhabricatorPeopleDatasource())); 96 90 } 97 91 98 - $recipient_list = id(new PhabricatorBadgesRecipientsListView()) 99 - ->setBadge($badge) 100 - ->setHandles($handles) 101 - ->setUser($viewer); 92 + $dialog = id(new AphrontDialogView()) 93 + ->setUser($viewer) 94 + ->setTitle(pht('Award Badges')) 95 + ->appendForm($form) 96 + ->addCancelButton($view_uri) 97 + ->addSubmitButton(pht('Add Recipients')); 102 98 103 - $badge_url = $this->getApplicationURI('view/'.$id.'/'); 104 - 105 - $crumbs = $this->buildApplicationCrumbs(); 106 - $crumbs->addTextCrumb($badge->getName(), $badge_url); 107 - $crumbs->addTextCrumb(pht('Recipients')); 108 - 109 - return $this->newPage() 110 - ->setTitle($title) 111 - ->setCrumbs($crumbs) 112 - ->appendChild( 113 - array( 114 - $form_box, 115 - $recipient_list, 116 - )); 99 + return $dialog; 117 100 } 118 101 119 102 }
+3 -4
src/applications/badges/controller/PhabricatorBadgesRemoveRecipientsController.php
··· 28 28 return new Aphront404Response(); 29 29 } 30 30 31 - $recipients_uri = 32 - $this->getApplicationURI('recipients/'.$badge->getID().'/'); 31 + $view_uri = $this->getApplicationURI('view/'.$badge->getID().'/'); 33 32 34 33 if ($request->isFormPost()) { 35 34 $recipient_spec = array(); ··· 52 51 ->applyTransactions($badge, $xactions); 53 52 54 53 return id(new AphrontRedirectResponse()) 55 - ->setURI($recipients_uri); 54 + ->setURI($view_uri); 56 55 } 57 56 58 57 $handle = id(new PhabricatorHandleQuery()) ··· 68 67 'Really revoke the badge "%s" from %s?', 69 68 phutil_tag('strong', array(), $badge->getName()), 70 69 phutil_tag('strong', array(), $handle->getName()))) 71 - ->addCancelButton($recipients_uri) 70 + ->addCancelButton($view_uri) 72 71 ->addSubmitButton(pht('Revoke Badge')); 73 72 74 73 return $dialog;
+32 -14
src/applications/badges/controller/PhabricatorBadgesViewController.php
··· 22 22 23 23 $crumbs = $this->buildApplicationCrumbs(); 24 24 $crumbs->addTextCrumb($badge->getName()); 25 + $crumbs->setBorder(true); 25 26 $title = $badge->getName(); 26 27 27 28 if ($badge->isArchived()) { ··· 39 40 ->setHeader($badge->getName()) 40 41 ->setUser($viewer) 41 42 ->setPolicyObject($badge) 42 - ->setStatus($status_icon, $status_color, $status_name); 43 + ->setStatus($status_icon, $status_color, $status_name) 44 + ->setHeaderIcon('fa-trophy'); 43 45 44 46 $properties = $this->buildPropertyListView($badge); 45 47 $actions = $this->buildActionListView($badge); 46 - $properties->setActionList($actions); 47 - 48 - $box = id(new PHUIObjectBoxView()) 49 - ->setHeader($header) 50 - ->addPropertyList($properties); 48 + $details = $this->buildDetailsView($badge); 51 49 52 50 $timeline = $this->buildTransactionTimeline( 53 51 $badge, ··· 64 62 65 63 $add_comment = $this->buildCommentForm($badge); 66 64 65 + $view = id(new PHUITwoColumnView()) 66 + ->setHeader($header) 67 + ->setMainColumn(array( 68 + $recipient_list, 69 + $timeline, 70 + $add_comment, 71 + )) 72 + ->setPropertyList($properties) 73 + ->setActionList($actions) 74 + ->addPropertySection(pht('BADGE DETAILS'), $details); 75 + 67 76 return $this->newPage() 68 77 ->setTitle($title) 69 78 ->setCrumbs($crumbs) 70 79 ->setPageObjectPHIDs(array($badge->getPHID())) 71 80 ->appendChild( 72 81 array( 73 - $box, 74 - $recipient_list, 75 - $timeline, 76 - $add_comment, 82 + $view, 77 83 )); 78 84 } 79 85 80 - private function buildPropertyListView(PhabricatorBadgesBadge $badge) { 86 + private function buildPropertyListView( 87 + PhabricatorBadgesBadge $badge) { 81 88 $viewer = $this->getViewer(); 82 89 83 90 $view = id(new PHUIPropertyListView()) 84 91 ->setUser($viewer) 85 92 ->setObject($badge); 86 93 94 + $view->invokeWillRenderEvent(); 95 + 96 + return $view; 97 + } 98 + 99 + private function buildDetailsView( 100 + PhabricatorBadgesBadge $badge) { 101 + $viewer = $this->getViewer(); 102 + 103 + $view = id(new PHUIPropertyListView()) 104 + ->setUser($viewer); 105 + 87 106 $quality = idx($badge->getQualityNameMap(), $badge->getQuality()); 88 107 89 108 $view->addProperty( ··· 98 117 $view->addProperty( 99 118 pht('Flavor'), 100 119 $badge->getFlavor()); 101 - 102 - $view->invokeWillRenderEvent(); 103 120 104 121 $description = $badge->getDescription(); 105 122 if (strlen($description)) { ··· 160 177 161 178 $view->addAction( 162 179 id(new PhabricatorActionView()) 163 - ->setName('Manage Recipients') 180 + ->setName('Add Recipients') 164 181 ->setIcon('fa-users') 165 182 ->setDisabled(!$can_edit) 183 + ->setWorkflow(true) 166 184 ->setHref($this->getApplicationURI("/recipients/{$id}/"))); 167 185 168 186 return $view;
+2 -2
src/applications/badges/view/PhabricatorBadgesRecipientsListView.php
··· 1 1 <?php 2 2 3 - final class PhabricatorBadgesRecipientsListView extends AphrontTagView { 3 + final class PhabricatorBadgesRecipientsListView extends AphrontView { 4 4 5 5 private $badge; 6 6 private $handles; ··· 15 15 return $this; 16 16 } 17 17 18 - protected function getTagContent() { 18 + public function render() { 19 19 20 20 $viewer = $this->user; 21 21
+6
webroot/rsrc/css/phui/phui-two-column-view.css
··· 200 200 201 201 .phui-two-column-view .phui-two-column-content .phui-info-view { 202 202 margin: 0 0 20px 0; 203 + padding: 16px; 204 + } 205 + 206 + .phui-two-column-view .phui-two-column-content .phui-object-box 207 + .phui-info-view { 208 + margin: 0; 203 209 }