Page MenuHomePhabricator

D15382.diff
No OneTemporary

D15382.diff

diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -155,7 +155,7 @@
'rsrc/css/phui/phui-status.css' => '888cedb8',
'rsrc/css/phui/phui-tag-view.css' => '9d5d4400',
'rsrc/css/phui/phui-timeline-view.css' => '2efceff8',
- 'rsrc/css/phui/phui-two-column-view.css' => 'cc0b8a09',
+ 'rsrc/css/phui/phui-two-column-view.css' => '64355d16',
'rsrc/css/phui/workboards/phui-workboard-color.css' => 'ac6fe6a7',
'rsrc/css/phui/workboards/phui-workboard.css' => 'e6d89647',
'rsrc/css/phui/workboards/phui-workcard.css' => '3646fb96',
@@ -843,7 +843,7 @@
'phui-tag-view-css' => '9d5d4400',
'phui-theme-css' => '027ba77e',
'phui-timeline-view-css' => '2efceff8',
- 'phui-two-column-view-css' => 'cc0b8a09',
+ 'phui-two-column-view-css' => '64355d16',
'phui-workboard-color-css' => 'ac6fe6a7',
'phui-workboard-view-css' => 'e6d89647',
'phui-workcard-view-css' => '3646fb96',
diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -6123,7 +6123,7 @@
'PhabricatorBadgesMailReceiver' => 'PhabricatorObjectMailReceiver',
'PhabricatorBadgesPHIDType' => 'PhabricatorPHIDType',
'PhabricatorBadgesQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
- 'PhabricatorBadgesRecipientsListView' => 'AphrontTagView',
+ 'PhabricatorBadgesRecipientsListView' => 'AphrontView',
'PhabricatorBadgesRemoveRecipientsController' => 'PhabricatorBadgesController',
'PhabricatorBadgesReplyHandler' => 'PhabricatorApplicationTransactionReplyHandler',
'PhabricatorBadgesSchemaSpec' => 'PhabricatorConfigSchemaSpec',
diff --git a/src/applications/badges/controller/PhabricatorBadgesEditRecipientsController.php b/src/applications/badges/controller/PhabricatorBadgesEditRecipientsController.php
--- a/src/applications/badges/controller/PhabricatorBadgesEditRecipientsController.php
+++ b/src/applications/badges/controller/PhabricatorBadgesEditRecipientsController.php
@@ -22,6 +22,7 @@
}
$recipient_phids = $badge->getRecipientPHIDs();
+ $view_uri = $this->getApplicationURI('view/'.$badge->getID().'/');
if ($request->isFormPost()) {
$recipient_spec = array();
@@ -53,7 +54,7 @@
->applyTransactions($badge, $xactions);
return id(new AphrontRedirectResponse())
- ->setURI($request->getRequestURI());
+ ->setURI($view_uri);
}
$recipient_phids = array_reverse($recipient_phids);
@@ -76,44 +77,26 @@
$title = pht('Add Recipient');
if ($can_edit) {
$header_name = pht('Edit Recipients');
- $view_uri = $this->getApplicationURI('view/'.$badge->getID().'/');
$form = new AphrontFormView();
$form
->setUser($viewer)
+ ->setFullWidth(true)
->appendControl(
id(new AphrontFormTokenizerControl())
->setName('phids')
->setLabel(pht('Add Recipients'))
- ->setDatasource(new PhabricatorPeopleDatasource()))
- ->appendChild(
- id(new AphrontFormSubmitControl())
- ->addCancelButton($view_uri)
- ->setValue(pht('Add Recipients')));
- $form_box = id(new PHUIObjectBoxView())
- ->setHeaderText($title)
- ->setForm($form);
+ ->setDatasource(new PhabricatorPeopleDatasource()));
}
- $recipient_list = id(new PhabricatorBadgesRecipientsListView())
- ->setBadge($badge)
- ->setHandles($handles)
- ->setUser($viewer);
+ $dialog = id(new AphrontDialogView())
+ ->setUser($viewer)
+ ->setTitle(pht('Award Badges'))
+ ->appendForm($form)
+ ->addCancelButton($view_uri)
+ ->addSubmitButton(pht('Add Recipients'));
- $badge_url = $this->getApplicationURI('view/'.$id.'/');
-
- $crumbs = $this->buildApplicationCrumbs();
- $crumbs->addTextCrumb($badge->getName(), $badge_url);
- $crumbs->addTextCrumb(pht('Recipients'));
-
- return $this->newPage()
- ->setTitle($title)
- ->setCrumbs($crumbs)
- ->appendChild(
- array(
- $form_box,
- $recipient_list,
- ));
+ return $dialog;
}
}
diff --git a/src/applications/badges/controller/PhabricatorBadgesRemoveRecipientsController.php b/src/applications/badges/controller/PhabricatorBadgesRemoveRecipientsController.php
--- a/src/applications/badges/controller/PhabricatorBadgesRemoveRecipientsController.php
+++ b/src/applications/badges/controller/PhabricatorBadgesRemoveRecipientsController.php
@@ -28,8 +28,7 @@
return new Aphront404Response();
}
- $recipients_uri =
- $this->getApplicationURI('recipients/'.$badge->getID().'/');
+ $view_uri = $this->getApplicationURI('view/'.$badge->getID().'/');
if ($request->isFormPost()) {
$recipient_spec = array();
@@ -52,7 +51,7 @@
->applyTransactions($badge, $xactions);
return id(new AphrontRedirectResponse())
- ->setURI($recipients_uri);
+ ->setURI($view_uri);
}
$handle = id(new PhabricatorHandleQuery())
@@ -68,7 +67,7 @@
'Really revoke the badge "%s" from %s?',
phutil_tag('strong', array(), $badge->getName()),
phutil_tag('strong', array(), $handle->getName())))
- ->addCancelButton($recipients_uri)
+ ->addCancelButton($view_uri)
->addSubmitButton(pht('Revoke Badge'));
return $dialog;
diff --git a/src/applications/badges/controller/PhabricatorBadgesViewController.php b/src/applications/badges/controller/PhabricatorBadgesViewController.php
--- a/src/applications/badges/controller/PhabricatorBadgesViewController.php
+++ b/src/applications/badges/controller/PhabricatorBadgesViewController.php
@@ -22,6 +22,7 @@
$crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb($badge->getName());
+ $crumbs->setBorder(true);
$title = $badge->getName();
if ($badge->isArchived()) {
@@ -39,15 +40,12 @@
->setHeader($badge->getName())
->setUser($viewer)
->setPolicyObject($badge)
- ->setStatus($status_icon, $status_color, $status_name);
+ ->setStatus($status_icon, $status_color, $status_name)
+ ->setHeaderIcon('fa-trophy');
$properties = $this->buildPropertyListView($badge);
$actions = $this->buildActionListView($badge);
- $properties->setActionList($actions);
-
- $box = id(new PHUIObjectBoxView())
- ->setHeader($header)
- ->addPropertyList($properties);
+ $details = $this->buildDetailsView($badge);
$timeline = $this->buildTransactionTimeline(
$badge,
@@ -64,26 +62,47 @@
$add_comment = $this->buildCommentForm($badge);
+ $view = id(new PHUITwoColumnView())
+ ->setHeader($header)
+ ->setMainColumn(array(
+ $recipient_list,
+ $timeline,
+ $add_comment,
+ ))
+ ->setPropertyList($properties)
+ ->setActionList($actions)
+ ->addPropertySection(pht('BADGE DETAILS'), $details);
+
return $this->newPage()
->setTitle($title)
->setCrumbs($crumbs)
->setPageObjectPHIDs(array($badge->getPHID()))
->appendChild(
array(
- $box,
- $recipient_list,
- $timeline,
- $add_comment,
+ $view,
));
}
- private function buildPropertyListView(PhabricatorBadgesBadge $badge) {
+ private function buildPropertyListView(
+ PhabricatorBadgesBadge $badge) {
$viewer = $this->getViewer();
$view = id(new PHUIPropertyListView())
->setUser($viewer)
->setObject($badge);
+ $view->invokeWillRenderEvent();
+
+ return $view;
+ }
+
+ private function buildDetailsView(
+ PhabricatorBadgesBadge $badge) {
+ $viewer = $this->getViewer();
+
+ $view = id(new PHUIPropertyListView())
+ ->setUser($viewer);
+
$quality = idx($badge->getQualityNameMap(), $badge->getQuality());
$view->addProperty(
@@ -99,8 +118,6 @@
pht('Flavor'),
$badge->getFlavor());
- $view->invokeWillRenderEvent();
-
$description = $badge->getDescription();
if (strlen($description)) {
$view->addSectionHeader(
@@ -160,9 +177,10 @@
$view->addAction(
id(new PhabricatorActionView())
- ->setName('Manage Recipients')
+ ->setName('Add Recipients')
->setIcon('fa-users')
->setDisabled(!$can_edit)
+ ->setWorkflow(true)
->setHref($this->getApplicationURI("/recipients/{$id}/")));
return $view;
diff --git a/src/applications/badges/view/PhabricatorBadgesRecipientsListView.php b/src/applications/badges/view/PhabricatorBadgesRecipientsListView.php
--- a/src/applications/badges/view/PhabricatorBadgesRecipientsListView.php
+++ b/src/applications/badges/view/PhabricatorBadgesRecipientsListView.php
@@ -1,6 +1,6 @@
<?php
-final class PhabricatorBadgesRecipientsListView extends AphrontTagView {
+final class PhabricatorBadgesRecipientsListView extends AphrontView {
private $badge;
private $handles;
@@ -15,7 +15,7 @@
return $this;
}
- protected function getTagContent() {
+ public function render() {
$viewer = $this->user;
diff --git a/webroot/rsrc/css/phui/phui-two-column-view.css b/webroot/rsrc/css/phui/phui-two-column-view.css
--- a/webroot/rsrc/css/phui/phui-two-column-view.css
+++ b/webroot/rsrc/css/phui/phui-two-column-view.css
@@ -200,4 +200,10 @@
.phui-two-column-view .phui-two-column-content .phui-info-view {
margin: 0 0 20px 0;
+ padding: 16px;
+}
+
+.phui-two-column-view .phui-two-column-content .phui-object-box
+ .phui-info-view {
+ margin: 0;
}

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 15, 11:38 AM (3 d, 8 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6747206
Default Alt Text
D15382.diff (9 KB)

Event Timeline