mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-18 19:40:55 +01:00
Convert every two-column application except Maniphest to curtain views
Summary: Moves over everything except Maniphest, which has some special behavior. Test Plan: - Viewed a badge. - Viewed a calendar event. - Viewed a countdown. - Viewed a Fund initiative. - Viewed a Herald rule. - Viewed a macro. - Viewed an application. - Viewed an owners package. - Viewed a credential. - Viewed a Ponder question. - Viewed a poll. Reviewers: chad Reviewed By: chad Differential Revision: https://secure.phabricator.com/D15416
This commit is contained in:
parent
eb1a0799ae
commit
fd9de5d6ec
12 changed files with 184 additions and 373 deletions
|
@ -43,8 +43,7 @@ final class PhabricatorBadgesViewController
|
|||
->setStatus($status_icon, $status_color, $status_name)
|
||||
->setHeaderIcon('fa-trophy');
|
||||
|
||||
$properties = $this->buildPropertyListView($badge);
|
||||
$actions = $this->buildActionListView($badge);
|
||||
$curtain = $this->buildCurtain($badge);
|
||||
$details = $this->buildDetailsView($badge);
|
||||
|
||||
$timeline = $this->buildTransactionTimeline(
|
||||
|
@ -64,36 +63,19 @@ final class PhabricatorBadgesViewController
|
|||
|
||||
$view = id(new PHUITwoColumnView())
|
||||
->setHeader($header)
|
||||
->setCurtain($curtain)
|
||||
->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(
|
||||
$view,
|
||||
));
|
||||
}
|
||||
|
||||
private function buildPropertyListView(
|
||||
PhabricatorBadgesBadge $badge) {
|
||||
$viewer = $this->getViewer();
|
||||
|
||||
$view = id(new PHUIPropertyListView())
|
||||
->setUser($viewer)
|
||||
->setObject($badge);
|
||||
|
||||
$view->invokeWillRenderEvent();
|
||||
|
||||
return $view;
|
||||
->appendChild($view);
|
||||
}
|
||||
|
||||
private function buildDetailsView(
|
||||
|
@ -137,53 +119,55 @@ final class PhabricatorBadgesViewController
|
|||
return $view;
|
||||
}
|
||||
|
||||
private function buildActionListView(PhabricatorBadgesBadge $badge) {
|
||||
private function buildCurtain(PhabricatorBadgesBadge $badge) {
|
||||
$viewer = $this->getViewer();
|
||||
$id = $badge->getID();
|
||||
|
||||
$can_edit = PhabricatorPolicyFilter::hasCapability(
|
||||
$viewer,
|
||||
$badge,
|
||||
PhabricatorPolicyCapability::CAN_EDIT);
|
||||
|
||||
$view = id(new PhabricatorActionListView())
|
||||
->setUser($viewer)
|
||||
->setObject($badge);
|
||||
$id = $badge->getID();
|
||||
$edit_uri = $this->getApplicationURI("/edit/{$id}/");
|
||||
$archive_uri = $this->getApplicationURI("/archive/{$id}/");
|
||||
$award_uri = $this->getApplicationURI("/recipients/{$id}/");
|
||||
|
||||
$view->addAction(
|
||||
$curtain = $this->newCurtainView($badge);
|
||||
|
||||
$curtain->addAction(
|
||||
id(new PhabricatorActionView())
|
||||
->setName(pht('Edit Badge'))
|
||||
->setIcon('fa-pencil')
|
||||
->setDisabled(!$can_edit)
|
||||
->setHref($this->getApplicationURI("/edit/{$id}/")));
|
||||
->setHref($edit_uri));
|
||||
|
||||
if ($badge->isArchived()) {
|
||||
$view->addAction(
|
||||
$curtain->addAction(
|
||||
id(new PhabricatorActionView())
|
||||
->setName(pht('Activate Badge'))
|
||||
->setIcon('fa-check')
|
||||
->setDisabled(!$can_edit)
|
||||
->setWorkflow($can_edit)
|
||||
->setHref($this->getApplicationURI("/archive/{$id}/")));
|
||||
->setHref($archive_uri));
|
||||
} else {
|
||||
$view->addAction(
|
||||
$curtain->addAction(
|
||||
id(new PhabricatorActionView())
|
||||
->setName(pht('Archive Badge'))
|
||||
->setIcon('fa-ban')
|
||||
->setDisabled(!$can_edit)
|
||||
->setWorkflow($can_edit)
|
||||
->setHref($this->getApplicationURI("/archive/{$id}/")));
|
||||
->setHref($archive_uri));
|
||||
}
|
||||
|
||||
$view->addAction(
|
||||
$curtain->addAction(
|
||||
id(new PhabricatorActionView())
|
||||
->setName('Add Recipients')
|
||||
->setIcon('fa-users')
|
||||
->setDisabled(!$can_edit)
|
||||
->setWorkflow(true)
|
||||
->setHref($this->getApplicationURI("/recipients/{$id}/")));
|
||||
->setHref($award_uri));
|
||||
|
||||
return $view;
|
||||
return $curtain;
|
||||
}
|
||||
|
||||
private function buildCommentForm(PhabricatorBadgesBadge $badge) {
|
||||
|
|
|
@ -475,8 +475,14 @@ abstract class PhabricatorController extends AphrontController {
|
|||
$viewer = $this->getViewer();
|
||||
|
||||
$action_list = id(new PhabricatorActionListView())
|
||||
->setViewer($viewer)
|
||||
->setObject($object);
|
||||
->setViewer($viewer);
|
||||
|
||||
// NOTE: Applications (objects of class PhabricatorApplication) can't
|
||||
// currently be set here, although they don't need any of the extensions
|
||||
// anyway. This should probably work differently than it does, though.
|
||||
if ($object instanceof PhabricatorLiskDAO) {
|
||||
$action_list->setObject($object);
|
||||
}
|
||||
|
||||
$curtain = id(new PHUICurtainView())
|
||||
->setViewer($viewer)
|
||||
|
|
|
@ -63,8 +63,7 @@ final class PhabricatorCalendarEventViewController
|
|||
}
|
||||
|
||||
$header = $this->buildHeaderView($event);
|
||||
$actions = $this->buildActionView($event);
|
||||
$properties = $this->buildPropertyListView($event);
|
||||
$curtain = $this->buildCurtain($event);
|
||||
$details = $this->buildPropertySection($event);
|
||||
$description = $this->buildDescriptionView($event);
|
||||
|
||||
|
@ -91,10 +90,9 @@ final class PhabricatorCalendarEventViewController
|
|||
$view = id(new PHUITwoColumnView())
|
||||
->setHeader($header)
|
||||
->setMainColumn($timeline)
|
||||
->setPropertyList($properties)
|
||||
->setCurtain($curtain)
|
||||
->addPropertySection(pht('DETAILS'), $details)
|
||||
->addPropertySection(pht('DESCRIPTION'), $description)
|
||||
->setActionList($actions);
|
||||
->addPropertySection(pht('DESCRIPTION'), $description);
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($page_title)
|
||||
|
@ -148,16 +146,12 @@ final class PhabricatorCalendarEventViewController
|
|||
return $header;
|
||||
}
|
||||
|
||||
private function buildActionView(PhabricatorCalendarEvent $event) {
|
||||
private function buildCurtain(PhabricatorCalendarEvent $event) {
|
||||
$viewer = $this->getRequest()->getUser();
|
||||
$id = $event->getID();
|
||||
$is_cancelled = $event->getIsCancelled();
|
||||
$is_attending = $event->getIsUserAttending($viewer->getPHID());
|
||||
|
||||
$actions = id(new PhabricatorActionListView())
|
||||
->setUser($viewer)
|
||||
->setObject($event);
|
||||
|
||||
$can_edit = PhabricatorPolicyFilter::hasCapability(
|
||||
$viewer,
|
||||
$event,
|
||||
|
@ -178,8 +172,10 @@ final class PhabricatorCalendarEventViewController
|
|||
$edit_uri = "event/edit/{$id}/";
|
||||
}
|
||||
|
||||
$curtain = $this->newCurtainView($event);
|
||||
|
||||
if ($edit_label && $edit_uri) {
|
||||
$actions->addAction(
|
||||
$curtain->addAction(
|
||||
id(new PhabricatorActionView())
|
||||
->setName($edit_label)
|
||||
->setIcon('fa-pencil')
|
||||
|
@ -189,14 +185,14 @@ final class PhabricatorCalendarEventViewController
|
|||
}
|
||||
|
||||
if ($is_attending) {
|
||||
$actions->addAction(
|
||||
$curtain->addAction(
|
||||
id(new PhabricatorActionView())
|
||||
->setName(pht('Decline Event'))
|
||||
->setIcon('fa-user-times')
|
||||
->setHref($this->getApplicationURI("event/join/{$id}/"))
|
||||
->setWorkflow(true));
|
||||
} else {
|
||||
$actions->addAction(
|
||||
$curtain->addAction(
|
||||
id(new PhabricatorActionView())
|
||||
->setName(pht('Join Event'))
|
||||
->setIcon('fa-user-plus')
|
||||
|
@ -230,7 +226,7 @@ final class PhabricatorCalendarEventViewController
|
|||
}
|
||||
|
||||
if ($is_cancelled) {
|
||||
$actions->addAction(
|
||||
$curtain->addAction(
|
||||
id(new PhabricatorActionView())
|
||||
->setName($reinstate_label)
|
||||
->setIcon('fa-plus')
|
||||
|
@ -238,7 +234,7 @@ final class PhabricatorCalendarEventViewController
|
|||
->setDisabled($cancel_disabled)
|
||||
->setWorkflow(true));
|
||||
} else {
|
||||
$actions->addAction(
|
||||
$curtain->addAction(
|
||||
id(new PhabricatorActionView())
|
||||
->setName($cancel_label)
|
||||
->setIcon('fa-times')
|
||||
|
@ -247,20 +243,7 @@ final class PhabricatorCalendarEventViewController
|
|||
->setWorkflow(true));
|
||||
}
|
||||
|
||||
return $actions;
|
||||
}
|
||||
|
||||
private function buildPropertyListView(
|
||||
PhabricatorCalendarEvent $event) {
|
||||
$viewer = $this->getViewer();
|
||||
|
||||
$properties = id(new PHUIPropertyListView())
|
||||
->setUser($viewer)
|
||||
->setObject($event);
|
||||
|
||||
$properties->invokeWillRenderEvent();
|
||||
|
||||
return $properties;
|
||||
return $curtain;
|
||||
}
|
||||
|
||||
private function buildPropertySection(
|
||||
|
|
|
@ -49,8 +49,7 @@ final class PhabricatorCountdownViewController
|
|||
->setStatus($icon, $color, $status)
|
||||
->setHeaderIcon('fa-rocket');
|
||||
|
||||
$actions = $this->buildActionListView($countdown);
|
||||
$properties = $this->buildPropertyListView($countdown);
|
||||
$curtain = $this->buildCurtain($countdown);
|
||||
$subheader = $this->buildSubheaderView($countdown);
|
||||
|
||||
$timeline = $this->buildTransactionTimeline(
|
||||
|
@ -67,9 +66,8 @@ final class PhabricatorCountdownViewController
|
|||
$view = id(new PHUITwoColumnView())
|
||||
->setHeader($header)
|
||||
->setSubheader($subheader)
|
||||
->setMainColumn($content)
|
||||
->setPropertyList($properties)
|
||||
->setActionList($actions);
|
||||
->setCurtain($curtain)
|
||||
->setMainColumn($content);
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
|
@ -78,28 +76,22 @@ final class PhabricatorCountdownViewController
|
|||
array(
|
||||
$countdown->getPHID(),
|
||||
))
|
||||
->appendChild(
|
||||
array(
|
||||
$view,
|
||||
));
|
||||
->appendChild($view);
|
||||
}
|
||||
|
||||
private function buildActionListView(PhabricatorCountdown $countdown) {
|
||||
$request = $this->getRequest();
|
||||
$viewer = $request->getUser();
|
||||
private function buildCurtain(PhabricatorCountdown $countdown) {
|
||||
$viewer = $this->getViewer();
|
||||
|
||||
$id = $countdown->getID();
|
||||
|
||||
$view = id(new PhabricatorActionListView())
|
||||
->setObject($countdown)
|
||||
->setUser($viewer);
|
||||
|
||||
$can_edit = PhabricatorPolicyFilter::hasCapability(
|
||||
$viewer,
|
||||
$countdown,
|
||||
PhabricatorPolicyCapability::CAN_EDIT);
|
||||
|
||||
$view->addAction(
|
||||
$curtain = $this->newCurtainView($countdown);
|
||||
|
||||
$curtain->addAction(
|
||||
id(new PhabricatorActionView())
|
||||
->setIcon('fa-pencil')
|
||||
->setName(pht('Edit Countdown'))
|
||||
|
@ -107,7 +99,7 @@ final class PhabricatorCountdownViewController
|
|||
->setDisabled(!$can_edit)
|
||||
->setWorkflow(!$can_edit));
|
||||
|
||||
$view->addAction(
|
||||
$curtain->addAction(
|
||||
id(new PhabricatorActionView())
|
||||
->setIcon('fa-times')
|
||||
->setName(pht('Delete Countdown'))
|
||||
|
@ -115,17 +107,7 @@ final class PhabricatorCountdownViewController
|
|||
->setDisabled(!$can_edit)
|
||||
->setWorkflow(true));
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
||||
private function buildPropertyListView(
|
||||
PhabricatorCountdown $countdown) {
|
||||
$viewer = $this->getViewer();
|
||||
$view = id(new PHUIPropertyListView())
|
||||
->setUser($viewer)
|
||||
->setObject($countdown);
|
||||
$view->invokeWillRenderEvent();
|
||||
return $view;
|
||||
return $curtain;
|
||||
}
|
||||
|
||||
private function buildSubheaderView(
|
||||
|
|
|
@ -46,8 +46,7 @@ final class FundInitiativeViewController
|
|||
->setStatus($status_icon, $status_color, $status_name)
|
||||
->setHeaderIcon('fa-heart');
|
||||
|
||||
$properties = $this->buildPropertyListView($initiative);
|
||||
$actions = $this->buildActionListView($initiative);
|
||||
$curtain = $this->buildCurtain($initiative);
|
||||
$details = $this->buildPropertySectionView($initiative);
|
||||
|
||||
$timeline = $this->buildTransactionTimeline(
|
||||
|
@ -57,31 +56,15 @@ final class FundInitiativeViewController
|
|||
|
||||
$view = id(new PHUITwoColumnView())
|
||||
->setHeader($header)
|
||||
->setCurtain($curtain)
|
||||
->setMainColumn($timeline)
|
||||
->setPropertyList($properties)
|
||||
->addPropertySection(pht('DETAILS'), $details)
|
||||
->setActionList($actions);
|
||||
->addPropertySection(pht('DETAILS'), $details);
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
->setCrumbs($crumbs)
|
||||
->setPageObjectPHIDs(array($initiative->getPHID()))
|
||||
->appendChild(
|
||||
array(
|
||||
$view,
|
||||
));
|
||||
}
|
||||
|
||||
private function buildPropertyListView(FundInitiative $initiative) {
|
||||
$viewer = $this->getRequest()->getUser();
|
||||
|
||||
$view = id(new PHUIPropertyListView())
|
||||
->setUser($viewer)
|
||||
->setObject($initiative);
|
||||
|
||||
$view->invokeWillRenderEvent();
|
||||
|
||||
return $view;
|
||||
->appendChild($view);
|
||||
}
|
||||
|
||||
private function buildPropertySectionView(FundInitiative $initiative) {
|
||||
|
@ -124,8 +107,9 @@ final class FundInitiativeViewController
|
|||
return $view;
|
||||
}
|
||||
|
||||
private function buildActionListView(FundInitiative $initiative) {
|
||||
$viewer = $this->getRequest()->getUser();
|
||||
private function buildCurtain(FundInitiative $initiative) {
|
||||
$viewer = $this->getViewer();
|
||||
|
||||
$id = $initiative->getID();
|
||||
|
||||
$can_edit = PhabricatorPolicyFilter::hasCapability(
|
||||
|
@ -133,11 +117,9 @@ final class FundInitiativeViewController
|
|||
$initiative,
|
||||
PhabricatorPolicyCapability::CAN_EDIT);
|
||||
|
||||
$view = id(new PhabricatorActionListView())
|
||||
->setUser($viewer)
|
||||
->setObject($initiative);
|
||||
$curtain = $this->newCurtainView($initiative);
|
||||
|
||||
$view->addAction(
|
||||
$curtain->addAction(
|
||||
id(new PhabricatorActionView())
|
||||
->setName(pht('Edit Initiative'))
|
||||
->setIcon('fa-pencil')
|
||||
|
@ -153,7 +135,7 @@ final class FundInitiativeViewController
|
|||
$close_icon = 'fa-times';
|
||||
}
|
||||
|
||||
$view->addAction(
|
||||
$curtain->addAction(
|
||||
id(new PhabricatorActionView())
|
||||
->setName($close_name)
|
||||
->setIcon($close_icon)
|
||||
|
@ -161,7 +143,7 @@ final class FundInitiativeViewController
|
|||
->setWorkflow(true)
|
||||
->setHref($this->getApplicationURI("/close/{$id}/")));
|
||||
|
||||
$view->addAction(
|
||||
$curtain->addAction(
|
||||
id(new PhabricatorActionView())
|
||||
->setName(pht('Back Initiative'))
|
||||
->setIcon('fa-money')
|
||||
|
@ -169,13 +151,13 @@ final class FundInitiativeViewController
|
|||
->setWorkflow(true)
|
||||
->setHref($this->getApplicationURI("/back/{$id}/")));
|
||||
|
||||
$view->addAction(
|
||||
$curtain->addAction(
|
||||
id(new PhabricatorActionView())
|
||||
->setName(pht('View Backers'))
|
||||
->setIcon('fa-bank')
|
||||
->setHref($this->getApplicationURI("/backers/{$id}/")));
|
||||
|
||||
return $view;
|
||||
return $curtain;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -33,8 +33,7 @@ final class HeraldRuleViewController extends HeraldController {
|
|||
pht('Active'));
|
||||
}
|
||||
|
||||
$actions = $this->buildActionView($rule);
|
||||
$properties = $this->buildPropertyView($rule);
|
||||
$curtain = $this->buildCurtain($rule);
|
||||
$details = $this->buildPropertySectionView($rule);
|
||||
$description = $this->buildDescriptionView($rule);
|
||||
|
||||
|
@ -44,10 +43,6 @@ final class HeraldRuleViewController extends HeraldController {
|
|||
$crumbs->addTextCrumb("H{$id}");
|
||||
$crumbs->setBorder(true);
|
||||
|
||||
$object_box = id(new PHUIObjectBoxView())
|
||||
->setHeader($header)
|
||||
->addPropertyList($properties);
|
||||
|
||||
$timeline = $this->buildTransactionTimeline(
|
||||
$rule,
|
||||
new HeraldTransactionQuery());
|
||||
|
@ -57,35 +52,30 @@ final class HeraldRuleViewController extends HeraldController {
|
|||
|
||||
$view = id(new PHUITwoColumnView())
|
||||
->setHeader($header)
|
||||
->setCurtain($curtain)
|
||||
->setMainColumn($timeline)
|
||||
->addPropertySection(pht('DETAILS'), $details)
|
||||
->addPropertySection(pht('DESCRIPTION'), $description)
|
||||
->setPropertyList($properties)
|
||||
->setActionList($actions);
|
||||
->addPropertySection(pht('DESCRIPTION'), $description);
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
->setCrumbs($crumbs)
|
||||
->appendChild(
|
||||
array(
|
||||
$view,
|
||||
));
|
||||
->appendChild($view);
|
||||
}
|
||||
|
||||
private function buildActionView(HeraldRule $rule) {
|
||||
$viewer = $this->getRequest()->getUser();
|
||||
$id = $rule->getID();
|
||||
private function buildCurtain(HeraldRule $rule) {
|
||||
$viewer = $this->getViewer();
|
||||
|
||||
$view = id(new PhabricatorActionListView())
|
||||
->setUser($viewer)
|
||||
->setObject($rule);
|
||||
$id = $rule->getID();
|
||||
|
||||
$can_edit = PhabricatorPolicyFilter::hasCapability(
|
||||
$viewer,
|
||||
$rule,
|
||||
PhabricatorPolicyCapability::CAN_EDIT);
|
||||
|
||||
$view->addAction(
|
||||
$curtain = $this->newCurtainView($rule);
|
||||
|
||||
$curtain->addAction(
|
||||
id(new PhabricatorActionView())
|
||||
->setName(pht('Edit Rule'))
|
||||
->setHref($this->getApplicationURI("edit/{$id}/"))
|
||||
|
@ -103,7 +93,7 @@ final class HeraldRuleViewController extends HeraldController {
|
|||
$disable_name = pht('Archive Rule');
|
||||
}
|
||||
|
||||
$view->addAction(
|
||||
$curtain->addAction(
|
||||
id(new PhabricatorActionView())
|
||||
->setName(pht('Disable Rule'))
|
||||
->setHref($this->getApplicationURI($disable_uri))
|
||||
|
@ -112,23 +102,10 @@ final class HeraldRuleViewController extends HeraldController {
|
|||
->setDisabled(!$can_edit)
|
||||
->setWorkflow(true));
|
||||
|
||||
return $view;
|
||||
return $curtain;
|
||||
}
|
||||
|
||||
private function buildPropertyView(
|
||||
HeraldRule $rule) {
|
||||
|
||||
$viewer = $this->getRequest()->getUser();
|
||||
$view = id(new PHUIPropertyListView())
|
||||
->setUser($viewer)
|
||||
->setObject($rule);
|
||||
|
||||
$view->invokeWillRenderEvent();
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
||||
private function buildPropertySectionView(
|
||||
private function buildPropertySectionView(
|
||||
HeraldRule $rule) {
|
||||
|
||||
$viewer = $this->getRequest()->getUser();
|
||||
|
|
|
@ -23,9 +23,8 @@ final class PhabricatorMacroViewController
|
|||
$title_short = pht('Macro "%s"', $macro->getName());
|
||||
$title_long = pht('Image Macro "%s"', $macro->getName());
|
||||
|
||||
$actions = $this->buildActionView($macro);
|
||||
$curtain = $this->buildCurtain($macro);
|
||||
$subheader = $this->buildSubheaderView($macro);
|
||||
$properties = $this->buildPropertyView($macro);
|
||||
$file = $this->buildFileView($macro);
|
||||
$details = $this->buildPropertySectionView($macro);
|
||||
|
||||
|
@ -68,35 +67,29 @@ final class PhabricatorMacroViewController
|
|||
$view = id(new PHUITwoColumnView())
|
||||
->setHeader($header)
|
||||
->setSubheader($subheader)
|
||||
->setCurtain($curtain)
|
||||
->setMainColumn(array(
|
||||
$timeline,
|
||||
$add_comment_form,
|
||||
))
|
||||
->addPropertySection(pht('MACRO'), $file)
|
||||
->addPropertySection(pht('DETAILS'), $details)
|
||||
->setPropertyList($properties)
|
||||
->setActionList($actions);
|
||||
->addPropertySection(pht('DETAILS'), $details);
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($title_short)
|
||||
->setCrumbs($crumbs)
|
||||
->setPageObjectPHIDs(array($macro->getPHID()))
|
||||
->appendChild(
|
||||
array(
|
||||
$view,
|
||||
));
|
||||
->appendChild($view);
|
||||
}
|
||||
|
||||
private function buildActionView(
|
||||
private function buildCurtain(
|
||||
PhabricatorFileImageMacro $macro) {
|
||||
$can_manage = $this->hasApplicationCapability(
|
||||
PhabricatorMacroManageCapability::CAPABILITY);
|
||||
|
||||
$request = $this->getRequest();
|
||||
$view = id(new PhabricatorActionListView())
|
||||
->setUser($request->getUser())
|
||||
->setObject($macro)
|
||||
->addAction(
|
||||
$curtain = $this->newCurtainView($macro);
|
||||
|
||||
$curtain->addAction(
|
||||
id(new PhabricatorActionView())
|
||||
->setName(pht('Edit Macro'))
|
||||
->setHref($this->getApplicationURI('/edit/'.$macro->getID().'/'))
|
||||
|
@ -104,7 +97,7 @@ final class PhabricatorMacroViewController
|
|||
->setWorkflow(!$can_manage)
|
||||
->setIcon('fa-pencil'));
|
||||
|
||||
$view->addAction(
|
||||
$curtain->addAction(
|
||||
id(new PhabricatorActionView())
|
||||
->setName(pht('Edit Audio'))
|
||||
->setHref($this->getApplicationURI('/audio/'.$macro->getID().'/'))
|
||||
|
@ -113,7 +106,7 @@ final class PhabricatorMacroViewController
|
|||
->setIcon('fa-music'));
|
||||
|
||||
if ($macro->getIsDisabled()) {
|
||||
$view->addAction(
|
||||
$curtain->addAction(
|
||||
id(new PhabricatorActionView())
|
||||
->setName(pht('Activate Macro'))
|
||||
->setHref($this->getApplicationURI('/disable/'.$macro->getID().'/'))
|
||||
|
@ -121,7 +114,7 @@ final class PhabricatorMacroViewController
|
|||
->setDisabled(!$can_manage)
|
||||
->setIcon('fa-check'));
|
||||
} else {
|
||||
$view->addAction(
|
||||
$curtain->addAction(
|
||||
id(new PhabricatorActionView())
|
||||
->setName(pht('Archive Macro'))
|
||||
->setHref($this->getApplicationURI('/disable/'.$macro->getID().'/'))
|
||||
|
@ -130,7 +123,7 @@ final class PhabricatorMacroViewController
|
|||
->setIcon('fa-ban'));
|
||||
}
|
||||
|
||||
return $view;
|
||||
return $curtain;
|
||||
}
|
||||
|
||||
private function buildSubheaderView(
|
||||
|
@ -206,17 +199,4 @@ final class PhabricatorMacroViewController
|
|||
return null;
|
||||
}
|
||||
|
||||
private function buildPropertyView(
|
||||
PhabricatorFileImageMacro $macro) {
|
||||
$viewer = $this->getViewer();
|
||||
|
||||
$view = id(new PHUIPropertyListView())
|
||||
->setUser($this->getRequest()->getUser())
|
||||
->setObject($macro);
|
||||
|
||||
$view->invokeWillRenderEvent();
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ final class PhabricatorApplicationDetailViewController
|
|||
$header->setStatus('fa-ban', 'dark', pht('Uninstalled'));
|
||||
}
|
||||
|
||||
$actions = $this->buildActionView($viewer, $selected);
|
||||
$curtain = $this->buildCurtain($selected);
|
||||
$details = $this->buildPropertySectionView($selected);
|
||||
$policies = $this->buildPolicyView($selected);
|
||||
|
||||
|
@ -58,12 +58,12 @@ final class PhabricatorApplicationDetailViewController
|
|||
|
||||
$view = id(new PHUITwoColumnView())
|
||||
->setHeader($header)
|
||||
->setCurtain($curtain)
|
||||
->setMainColumn(array(
|
||||
$policies,
|
||||
$panels,
|
||||
))
|
||||
->addPropertySection(pht('DETAILS'), $details)
|
||||
->setActionList($actions);
|
||||
->addPropertySection(pht('DETAILS'), $details);
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
|
@ -147,21 +147,22 @@ final class PhabricatorApplicationDetailViewController
|
|||
|
||||
}
|
||||
|
||||
private function buildActionView(
|
||||
PhabricatorUser $user,
|
||||
PhabricatorApplication $selected) {
|
||||
|
||||
$view = id(new PhabricatorActionListView())
|
||||
->setUser($user);
|
||||
private function buildCurtain(PhabricatorApplication $application) {
|
||||
$viewer = $this->getViewer();
|
||||
|
||||
$can_edit = PhabricatorPolicyFilter::hasCapability(
|
||||
$user,
|
||||
$selected,
|
||||
$viewer,
|
||||
$application,
|
||||
PhabricatorPolicyCapability::CAN_EDIT);
|
||||
|
||||
$edit_uri = $this->getApplicationURI('edit/'.get_class($selected).'/');
|
||||
$key = get_class($application);
|
||||
$edit_uri = $this->getApplicationURI("edit/{$key}/");
|
||||
$install_uri = $this->getApplicationURI("{$key}/install/");
|
||||
$uninstall_uri = $this->getApplicationURI("{$key}/uninstall/");
|
||||
|
||||
$view->addAction(
|
||||
$curtain = $this->newCurtainView($application);
|
||||
|
||||
$curtain->addAction(
|
||||
id(new PhabricatorActionView())
|
||||
->setName(pht('Edit Policies'))
|
||||
->setIcon('fa-pencil')
|
||||
|
@ -169,45 +170,42 @@ final class PhabricatorApplicationDetailViewController
|
|||
->setWorkflow(!$can_edit)
|
||||
->setHref($edit_uri));
|
||||
|
||||
if ($selected->canUninstall()) {
|
||||
if ($selected->isInstalled()) {
|
||||
$view->addAction(
|
||||
if ($application->canUninstall()) {
|
||||
if ($application->isInstalled()) {
|
||||
$curtain->addAction(
|
||||
id(new PhabricatorActionView())
|
||||
->setName(pht('Uninstall'))
|
||||
->setIcon('fa-times')
|
||||
->setDisabled(!$can_edit)
|
||||
->setWorkflow(true)
|
||||
->setHref(
|
||||
$this->getApplicationURI(get_class($selected).'/uninstall/')));
|
||||
->setHref($uninstall_uri));
|
||||
} else {
|
||||
$action = id(new PhabricatorActionView())
|
||||
->setName(pht('Install'))
|
||||
->setIcon('fa-plus')
|
||||
->setDisabled(!$can_edit)
|
||||
->setWorkflow(true)
|
||||
->setHref(
|
||||
$this->getApplicationURI(get_class($selected).'/install/'));
|
||||
->setHref($install_uri);
|
||||
|
||||
$prototypes_enabled = PhabricatorEnv::getEnvConfig(
|
||||
'phabricator.show-prototypes');
|
||||
if ($selected->isPrototype() && !$prototypes_enabled) {
|
||||
if ($application->isPrototype() && !$prototypes_enabled) {
|
||||
$action->setDisabled(true);
|
||||
}
|
||||
|
||||
$view->addAction($action);
|
||||
$curtain->addAction($action);
|
||||
}
|
||||
} else {
|
||||
$view->addAction(
|
||||
$curtain->addAction(
|
||||
id(new PhabricatorActionView())
|
||||
->setName(pht('Uninstall'))
|
||||
->setIcon('fa-times')
|
||||
->setWorkflow(true)
|
||||
->setDisabled(true)
|
||||
->setHref(
|
||||
$this->getApplicationURI(get_class($selected).'/uninstall/')));
|
||||
->setHref($uninstall_uri));
|
||||
}
|
||||
|
||||
return $view;
|
||||
return $curtain;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -43,8 +43,7 @@ final class PhabricatorOwnersDetailController
|
|||
->setViewer($viewer)
|
||||
->readFieldsFromStorage($package);
|
||||
|
||||
$actions = $this->buildPackageActionView($package);
|
||||
$properties = $this->buildPackagePropertyView($package, $field_list);
|
||||
$curtain = $this->buildCurtain($package);
|
||||
$details = $this->buildPackageDetailView($package, $field_list);
|
||||
|
||||
if ($package->isArchived()) {
|
||||
|
@ -155,35 +154,18 @@ final class PhabricatorOwnersDetailController
|
|||
|
||||
$view = id(new PHUITwoColumnView())
|
||||
->setHeader($header)
|
||||
->setCurtain($curtain)
|
||||
->setMainColumn(array(
|
||||
$this->renderPathsTable($paths, $repositories),
|
||||
$commit_panels,
|
||||
$timeline,
|
||||
))
|
||||
->addPropertySection(pht('Details'), $details)
|
||||
->setPropertyList($properties)
|
||||
->setActionList($actions);
|
||||
->addPropertySection(pht('Details'), $details);
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($package->getName())
|
||||
->setCrumbs($crumbs)
|
||||
->appendChild(
|
||||
array(
|
||||
$view,
|
||||
));
|
||||
}
|
||||
|
||||
private function buildPackagePropertyView(
|
||||
PhabricatorOwnersPackage $package,
|
||||
PhabricatorCustomFieldList $field_list) {
|
||||
|
||||
$viewer = $this->getViewer();
|
||||
$view = id(new PHUIPropertyListView())
|
||||
->setUser($viewer)
|
||||
->setObject($package);
|
||||
$view->invokeWillRenderEvent();
|
||||
|
||||
return $view;
|
||||
->appendChild($view);
|
||||
}
|
||||
|
||||
private function buildPackageDetailView(
|
||||
|
@ -224,7 +206,7 @@ final class PhabricatorOwnersDetailController
|
|||
return $view;
|
||||
}
|
||||
|
||||
private function buildPackageActionView(PhabricatorOwnersPackage $package) {
|
||||
private function buildCurtain(PhabricatorOwnersPackage $package) {
|
||||
$viewer = $this->getViewer();
|
||||
|
||||
$can_edit = PhabricatorPolicyFilter::hasCapability(
|
||||
|
@ -236,45 +218,43 @@ final class PhabricatorOwnersDetailController
|
|||
$edit_uri = $this->getApplicationURI("/edit/{$id}/");
|
||||
$paths_uri = $this->getApplicationURI("/paths/{$id}/");
|
||||
|
||||
$action_list = id(new PhabricatorActionListView())
|
||||
->setUser($viewer)
|
||||
->setObject($package);
|
||||
$curtain = $this->newCurtainView($package);
|
||||
|
||||
$action_list->addAction(
|
||||
id(new PhabricatorActionView())
|
||||
->setName(pht('Edit Package'))
|
||||
->setIcon('fa-pencil')
|
||||
->setDisabled(!$can_edit)
|
||||
->setWorkflow(!$can_edit)
|
||||
->setHref($edit_uri));
|
||||
$curtain->addAction(
|
||||
id(new PhabricatorActionView())
|
||||
->setName(pht('Edit Package'))
|
||||
->setIcon('fa-pencil')
|
||||
->setDisabled(!$can_edit)
|
||||
->setWorkflow(!$can_edit)
|
||||
->setHref($edit_uri));
|
||||
|
||||
if ($package->isArchived()) {
|
||||
$action_list->addAction(
|
||||
id(new PhabricatorActionView())
|
||||
->setName(pht('Activate Package'))
|
||||
->setIcon('fa-check')
|
||||
->setDisabled(!$can_edit)
|
||||
->setWorkflow($can_edit)
|
||||
->setHref($this->getApplicationURI("/archive/{$id}/")));
|
||||
$curtain->addAction(
|
||||
id(new PhabricatorActionView())
|
||||
->setName(pht('Activate Package'))
|
||||
->setIcon('fa-check')
|
||||
->setDisabled(!$can_edit)
|
||||
->setWorkflow($can_edit)
|
||||
->setHref($this->getApplicationURI("/archive/{$id}/")));
|
||||
} else {
|
||||
$action_list->addAction(
|
||||
id(new PhabricatorActionView())
|
||||
->setName(pht('Archive Package'))
|
||||
->setIcon('fa-ban')
|
||||
->setDisabled(!$can_edit)
|
||||
->setWorkflow($can_edit)
|
||||
->setHref($this->getApplicationURI("/archive/{$id}/")));
|
||||
$curtain->addAction(
|
||||
id(new PhabricatorActionView())
|
||||
->setName(pht('Archive Package'))
|
||||
->setIcon('fa-ban')
|
||||
->setDisabled(!$can_edit)
|
||||
->setWorkflow($can_edit)
|
||||
->setHref($this->getApplicationURI("/archive/{$id}/")));
|
||||
}
|
||||
|
||||
$action_list->addAction(
|
||||
id(new PhabricatorActionView())
|
||||
->setName(pht('Edit Paths'))
|
||||
->setIcon('fa-folder-open')
|
||||
->setDisabled(!$can_edit)
|
||||
->setWorkflow(!$can_edit)
|
||||
->setHref($paths_uri));
|
||||
$curtain->addAction(
|
||||
id(new PhabricatorActionView())
|
||||
->setName(pht('Edit Paths'))
|
||||
->setIcon('fa-folder-open')
|
||||
->setDisabled(!$can_edit)
|
||||
->setWorkflow(!$can_edit)
|
||||
->setHref($paths_uri));
|
||||
|
||||
return $action_list;
|
||||
return $curtain;
|
||||
}
|
||||
|
||||
private function renderPathsTable(array $paths, array $repositories) {
|
||||
|
|
|
@ -31,26 +31,21 @@ final class PassphraseCredentialViewController extends PassphraseController {
|
|||
$crumbs->setBorder(true);
|
||||
|
||||
$header = $this->buildHeaderView($credential);
|
||||
$actions = $this->buildActionView($credential, $type);
|
||||
$properties = $this->buildPropertyView($credential, $type);
|
||||
$curtain = $this->buildCurtain($credential, $type);
|
||||
$subheader = $this->buildSubheaderView($credential);
|
||||
$content = $this->buildPropertySectionView($credential, $type);
|
||||
|
||||
$view = id(new PHUITwoColumnView())
|
||||
->setHeader($header)
|
||||
->setSubheader($subheader)
|
||||
->setCurtain($curtain)
|
||||
->setMainColumn($timeline)
|
||||
->addPropertySection(pht('PROPERTIES'), $content)
|
||||
->setPropertyList($properties)
|
||||
->setActionList($actions);
|
||||
->addPropertySection(pht('PROPERTIES'), $content);
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
->setCrumbs($crumbs)
|
||||
->appendChild(
|
||||
array(
|
||||
$view,
|
||||
));
|
||||
->appendChild($view);
|
||||
}
|
||||
|
||||
private function buildHeaderView(PassphraseCredential $credential) {
|
||||
|
@ -98,10 +93,10 @@ final class PassphraseCredentialViewController extends PassphraseController {
|
|||
->setContent($content);
|
||||
}
|
||||
|
||||
private function buildActionView(
|
||||
private function buildCurtain(
|
||||
PassphraseCredential $credential,
|
||||
PassphraseCredentialType $type) {
|
||||
$viewer = $this->getRequest()->getUser();
|
||||
$viewer = $this->getViewer();
|
||||
|
||||
$id = $credential->getID();
|
||||
|
||||
|
@ -123,16 +118,14 @@ final class PassphraseCredentialViewController extends PassphraseController {
|
|||
$credential_conduit_icon = 'fa-wrench';
|
||||
}
|
||||
|
||||
$actions = id(new PhabricatorActionListView())
|
||||
->setObject($credential)
|
||||
->setUser($viewer);
|
||||
|
||||
$can_edit = PhabricatorPolicyFilter::hasCapability(
|
||||
$viewer,
|
||||
$credential,
|
||||
PhabricatorPolicyCapability::CAN_EDIT);
|
||||
|
||||
$actions->addAction(
|
||||
$curtain = $this->newCurtainView($credential);
|
||||
|
||||
$curtain->addAction(
|
||||
id(new PhabricatorActionView())
|
||||
->setName(pht('Edit Credential'))
|
||||
->setIcon('fa-pencil')
|
||||
|
@ -141,7 +134,7 @@ final class PassphraseCredentialViewController extends PassphraseController {
|
|||
->setWorkflow(!$can_edit));
|
||||
|
||||
if (!$credential->getIsDestroyed()) {
|
||||
$actions->addAction(
|
||||
$curtain->addAction(
|
||||
id(new PhabricatorActionView())
|
||||
->setName(pht('Destroy Credential'))
|
||||
->setIcon('fa-times')
|
||||
|
@ -149,7 +142,7 @@ final class PassphraseCredentialViewController extends PassphraseController {
|
|||
->setDisabled(!$can_edit)
|
||||
->setWorkflow(true));
|
||||
|
||||
$actions->addAction(
|
||||
$curtain->addAction(
|
||||
id(new PhabricatorActionView())
|
||||
->setName(pht('Show Secret'))
|
||||
->setIcon('fa-eye')
|
||||
|
@ -158,7 +151,7 @@ final class PassphraseCredentialViewController extends PassphraseController {
|
|||
->setWorkflow(true));
|
||||
|
||||
if ($type->hasPublicKey()) {
|
||||
$actions->addAction(
|
||||
$curtain->addAction(
|
||||
id(new PhabricatorActionView())
|
||||
->setName(pht('Show Public Key'))
|
||||
->setIcon('fa-download')
|
||||
|
@ -167,7 +160,7 @@ final class PassphraseCredentialViewController extends PassphraseController {
|
|||
->setWorkflow(true));
|
||||
}
|
||||
|
||||
$actions->addAction(
|
||||
$curtain->addAction(
|
||||
id(new PhabricatorActionView())
|
||||
->setName($credential_conduit_text)
|
||||
->setIcon($credential_conduit_icon)
|
||||
|
@ -175,7 +168,7 @@ final class PassphraseCredentialViewController extends PassphraseController {
|
|||
->setDisabled(!$can_edit)
|
||||
->setWorkflow(true));
|
||||
|
||||
$actions->addAction(
|
||||
$curtain->addAction(
|
||||
id(new PhabricatorActionView())
|
||||
->setName($credential_lock_text)
|
||||
->setIcon($credential_lock_icon)
|
||||
|
@ -184,8 +177,7 @@ final class PassphraseCredentialViewController extends PassphraseController {
|
|||
->setWorkflow(true));
|
||||
}
|
||||
|
||||
|
||||
return $actions;
|
||||
return $curtain;
|
||||
}
|
||||
|
||||
private function buildPropertySectionView(
|
||||
|
@ -236,17 +228,4 @@ final class PassphraseCredentialViewController extends PassphraseController {
|
|||
return $properties;
|
||||
}
|
||||
|
||||
private function buildPropertyView(
|
||||
PassphraseCredential $credential,
|
||||
PassphraseCredentialType $type) {
|
||||
$viewer = $this->getRequest()->getUser();
|
||||
|
||||
$properties = id(new PHUIPropertyListView())
|
||||
->setUser($viewer)
|
||||
->setObject($credential);
|
||||
|
||||
$properties->invokeWillRenderEvent();
|
||||
return $properties;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -43,8 +43,7 @@ final class PonderQuestionViewController extends PonderController {
|
|||
$header->setStatus($icon, 'dark', $text);
|
||||
}
|
||||
|
||||
$properties = $this->buildPropertyListView($question);
|
||||
$actions = $this->buildActionListView($question);
|
||||
$curtain = $this->buildCurtain($question);
|
||||
$details = $this->buildPropertySectionView($question);
|
||||
|
||||
$can_edit = PhabricatorPolicyFilter::hasCapability(
|
||||
|
@ -118,29 +117,24 @@ final class PonderQuestionViewController extends PonderController {
|
|||
$ponder_view = id(new PHUITwoColumnView())
|
||||
->setHeader($header)
|
||||
->setSubheader($subheader)
|
||||
->setCurtain($curtain)
|
||||
->setMainColumn($ponder_content)
|
||||
->setPropertyList($properties)
|
||||
->addPropertySection(pht('DETAILS'), $details)
|
||||
->setActionList($actions)
|
||||
->addClass('ponder-question-view');
|
||||
|
||||
$page_objects = array_merge(
|
||||
array($question->getPHID()),
|
||||
mpull($question->getAnswers(), 'getPHID'));
|
||||
array($question->getPHID()),
|
||||
mpull($question->getAnswers(), 'getPHID'));
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle('Q'.$question->getID().' '.$question->getTitle())
|
||||
->setCrumbs($crumbs)
|
||||
->setPageObjectPHIDs($page_objects)
|
||||
->appendChild(
|
||||
array(
|
||||
$ponder_view,
|
||||
));
|
||||
->appendChild($ponder_view);
|
||||
}
|
||||
|
||||
private function buildActionListView(PonderQuestion $question) {
|
||||
private function buildCurtain(PonderQuestion $question) {
|
||||
$viewer = $this->getViewer();
|
||||
$request = $this->getRequest();
|
||||
$id = $question->getID();
|
||||
|
||||
$can_edit = PhabricatorPolicyFilter::hasCapability(
|
||||
|
@ -148,9 +142,7 @@ final class PonderQuestionViewController extends PonderController {
|
|||
$question,
|
||||
PhabricatorPolicyCapability::CAN_EDIT);
|
||||
|
||||
$view = id(new PhabricatorActionListView())
|
||||
->setUser($viewer)
|
||||
->setObject($question);
|
||||
$curtain = $this->newCurtainView($question);
|
||||
|
||||
if ($question->getStatus() == PonderQuestionStatus::STATUS_OPEN) {
|
||||
$name = pht('Close Question');
|
||||
|
@ -160,7 +152,7 @@ final class PonderQuestionViewController extends PonderController {
|
|||
$icon = 'fa-square-o';
|
||||
}
|
||||
|
||||
$view->addAction(
|
||||
$curtain->addAction(
|
||||
id(new PhabricatorActionView())
|
||||
->setIcon('fa-pencil')
|
||||
->setName(pht('Edit Question'))
|
||||
|
@ -168,7 +160,7 @@ final class PonderQuestionViewController extends PonderController {
|
|||
->setDisabled(!$can_edit)
|
||||
->setWorkflow(!$can_edit));
|
||||
|
||||
$view->addAction(
|
||||
$curtain->addAction(
|
||||
id(new PhabricatorActionView())
|
||||
->setName($name)
|
||||
->setIcon($icon)
|
||||
|
@ -176,26 +168,13 @@ final class PonderQuestionViewController extends PonderController {
|
|||
->setDisabled(!$can_edit)
|
||||
->setHref($this->getApplicationURI("/question/status/{$id}/")));
|
||||
|
||||
$view->addAction(
|
||||
$curtain->addAction(
|
||||
id(new PhabricatorActionView())
|
||||
->setIcon('fa-list')
|
||||
->setName(pht('View History'))
|
||||
->setHref($this->getApplicationURI("/question/history/{$id}/")));
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
||||
private function buildPropertyListView(
|
||||
PonderQuestion $question) {
|
||||
|
||||
$viewer = $this->getViewer();
|
||||
$view = id(new PHUIPropertyListView())
|
||||
->setUser($viewer)
|
||||
->setObject($question);
|
||||
|
||||
$view->invokeWillRenderEvent();
|
||||
|
||||
return $view;
|
||||
return $curtain;
|
||||
}
|
||||
|
||||
private function buildSubheaderView(
|
||||
|
|
|
@ -46,8 +46,7 @@ final class PhabricatorSlowvotePollController
|
|||
->setPolicyObject($poll)
|
||||
->setHeaderIcon('fa-bar-chart');
|
||||
|
||||
$actions = $this->buildActionView($poll);
|
||||
$properties = $this->buildPropertyView($poll);
|
||||
$curtain = $this->buildCurtain($poll);
|
||||
$subheader = $this->buildSubheaderView($poll);
|
||||
|
||||
$crumbs = $this->buildApplicationCrumbs();
|
||||
|
@ -68,37 +67,31 @@ final class PhabricatorSlowvotePollController
|
|||
$view = id(new PHUITwoColumnView())
|
||||
->setHeader($header)
|
||||
->setSubheader($subheader)
|
||||
->setMainColumn($poll_content)
|
||||
->setPropertyList($properties)
|
||||
->setActionList($actions);
|
||||
->setCurtain($curtain)
|
||||
->setMainColumn($poll_content);
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle('V'.$poll->getID().' '.$poll->getQuestion())
|
||||
->setCrumbs($crumbs)
|
||||
->setPageObjectPHIDs(array($poll->getPHID()))
|
||||
->appendChild(
|
||||
array(
|
||||
$view,
|
||||
));
|
||||
->appendChild($view);
|
||||
}
|
||||
|
||||
private function buildActionView(PhabricatorSlowvotePoll $poll) {
|
||||
$viewer = $this->getRequest()->getUser();
|
||||
|
||||
$view = id(new PhabricatorActionListView())
|
||||
->setUser($viewer)
|
||||
->setObject($poll);
|
||||
private function buildCurtain(PhabricatorSlowvotePoll $poll) {
|
||||
$viewer = $this->getViewer();
|
||||
|
||||
$can_edit = PhabricatorPolicyFilter::hasCapability(
|
||||
$viewer,
|
||||
$poll,
|
||||
PhabricatorPolicyCapability::CAN_EDIT);
|
||||
|
||||
$curtain = $this->newCurtainView($poll);
|
||||
|
||||
$is_closed = $poll->getIsClosed();
|
||||
$close_poll_text = $is_closed ? pht('Reopen Poll') : pht('Close Poll');
|
||||
$close_poll_icon = $is_closed ? 'fa-play-circle-o' : 'fa-ban';
|
||||
|
||||
$view->addAction(
|
||||
$curtain->addAction(
|
||||
id(new PhabricatorActionView())
|
||||
->setName(pht('Edit Poll'))
|
||||
->setIcon('fa-pencil')
|
||||
|
@ -106,7 +99,7 @@ final class PhabricatorSlowvotePollController
|
|||
->setDisabled(!$can_edit)
|
||||
->setWorkflow(!$can_edit));
|
||||
|
||||
$view->addAction(
|
||||
$curtain->addAction(
|
||||
id(new PhabricatorActionView())
|
||||
->setName($close_poll_text)
|
||||
->setIcon($close_poll_icon)
|
||||
|
@ -114,19 +107,7 @@ final class PhabricatorSlowvotePollController
|
|||
->setDisabled(!$can_edit)
|
||||
->setWorkflow(true));
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
||||
private function buildPropertyView(
|
||||
PhabricatorSlowvotePoll $poll) {
|
||||
|
||||
$viewer = $this->getRequest()->getUser();
|
||||
$view = id(new PHUIPropertyListView())
|
||||
->setUser($viewer)
|
||||
->setObject($poll);
|
||||
$view->invokeWillRenderEvent();
|
||||
|
||||
return $view;
|
||||
return $curtain;
|
||||
}
|
||||
|
||||
private function buildSubheaderView(
|
||||
|
|
Loading…
Reference in a new issue