[Redesign] Clean up Slowvote

Summary: Ref T8099, A cleaner, more standard UI for Slowvotes. Because Slowvote is important.

Test Plan: Test a number of poll layouts and embeds.

Reviewers: btrahan, epriestley

Reviewed By: epriestley

Subscribers: epriestley, Korvin

Maniphest Tasks: T8099

Differential Revision: https://secure.phabricator.com/D13445
This commit is contained in:
Chad Little
2015-06-25 12:17:33 -07:00
parent a85010c9bf
commit aa22a578d0
4 changed files with 43 additions and 57 deletions

View File

@@ -67,12 +67,7 @@ final class PhabricatorSlowvotePollController
array(
$crumbs,
$object_box,
phutil_tag(
'div',
array(
'class' => 'mlt mml mmr',
),
$poll_view),
$poll_view,
$timeline,
$add_comment,
),

View File

@@ -71,21 +71,8 @@ final class SlowvoteEmbedView extends AphrontView {
if ($this->headless) {
$header = null;
} else {
$header = phutil_tag(
'div',
array(
'class' => 'slowvote-header',
),
phutil_tag(
'div',
array(
'class' => 'slowvote-header-content',
),
array(
'V'.$poll->getID(),
' ',
$link_to_slowvote,
)));
$header = id(new PHUIHeaderView())
->setHeader($link_to_slowvote);
$description = null;
if ($poll->getDescription()) {
@@ -147,7 +134,7 @@ final class SlowvoteEmbedView extends AphrontView {
'button',
array(
),
pht('Engage in Deliberations')),
pht('Enrage in Deliberations')),
)));
}
@@ -168,7 +155,7 @@ final class SlowvoteEmbedView extends AphrontView {
$submit,
));
return javelin_tag(
$embed = javelin_tag(
'div',
array(
'class' => 'slowvote-embed',
@@ -177,7 +164,11 @@ final class SlowvoteEmbedView extends AphrontView {
'pollID' => $poll->getID(),
),
),
array($header, $body));
array($body));
return id(new PHUIObjectBoxView())
->setHeader($header)
->appendChild($embed);
}
private function renderLabel(PhabricatorSlowvoteOption $option, $selected) {
@@ -213,9 +204,9 @@ final class SlowvoteEmbedView extends AphrontView {
),
array(
$this->renderControl($option, $selected),
$status,
)),
)),
$status,
$voters,
));
}