1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-20 13:52:40 +01:00

Partially modernize UI for Slowvote

Summary: Move some UI stuff to modern kit.

Test Plan: {F50024}

Reviewers: chad, btrahan

Reviewed By: chad

CC: aran

Differential Revision: https://secure.phabricator.com/D6447
This commit is contained in:
epriestley 2013-07-13 10:42:05 -07:00
parent 0630ffffaa
commit 8eef4a6c37
2 changed files with 25 additions and 14 deletions

View file

@ -74,9 +74,11 @@ final class PhabricatorSlowvoteCreateController
$form = id(new AphrontFormView())
->setUser($user)
->setFlexible(true)
->appendChild($instructions)
->appendChild(
id(new AphrontFormTextControl())
id(new AphrontFormTextAreaControl())
->setHeight(AphrontFormTextAreaControl::HEIGHT_VERY_SHORT)
->setLabel(pht('Question'))
->setName('question')
->setValue($poll->getQuestion())
@ -131,19 +133,13 @@ final class PhabricatorSlowvoteCreateController
->addCheckbox(
'shuffle',
1,
pht('Show choices in random order'),
pht('Show choices in random order.'),
$poll->getShuffle()))
->appendChild(
id(new AphrontFormSubmitControl())
->setValue(pht('Create Slowvote'))
->addCancelButton('/vote/'));
$panel = new AphrontPanelView();
$panel->setWidth(AphrontPanelView::WIDTH_FORM);
$panel->setHeader(pht('Create Slowvote'));
$panel->setNoBackground();
$panel->appendChild($form);
$crumbs = $this->buildApplicationCrumbs($this->buildSideNavView());
$crumbs->addCrumb(
id(new PhabricatorCrumbView())
@ -154,11 +150,12 @@ final class PhabricatorSlowvoteCreateController
array(
$crumbs,
$error_view,
$panel,
$form,
),
array(
'title' => pht('Create Slowvote'),
'device' => true,
'dust' => true,
));
}

View file

@ -130,6 +130,7 @@ final class PhabricatorSlowvotePollController
$form = id(new AphrontFormView())
->setUser($user)
->setFlexible(true)
->setAction(sprintf('/vote/%d/', $poll->getID()))
->appendChild(hsprintf(
'<p class="aphront-form-instructions">%s</p>',
@ -148,20 +149,33 @@ final class PhabricatorSlowvotePollController
id(new AphrontFormSubmitControl())
->setValue(pht('Engage in Deliberations')));
$header = id(new PhabricatorHeaderView())
->setHeader($poll->getQuestion());
$crumbs = $this->buildApplicationCrumbs();
$crumbs->addCrumb(
id(new PhabricatorCrumbView())
->setName('V'.$poll->getID()));
$panel = new AphrontPanelView();
$panel->setHeader($poll->getQuestion());
$panel->setWidth(AphrontPanelView::WIDTH_WIDE);
$panel->setNoBackground();
$panel->appendChild($form);
$panel->appendChild(hsprintf('<br /><br />'));
$panel->appendChild($result_markup);
$content = array(
$form,
hsprintf('<br /><br />'),
$panel);
return $this->buildApplicationPage(
$panel,
array(
$crumbs,
$header,
$content,
),
array(
'title' => 'V'.$poll->getID().' '.$poll->getQuestion(),
'device' => true,
'dust' => true,
));
}