Changeset View
Changeset View
Standalone View
Standalone View
src/applications/slowvote/view/SlowvoteEmbedView.php
Show First 20 Lines • Show All 89 Lines • ▼ Show 20 Lines | public function render() { | ||||
$hint = phutil_tag( | $hint = phutil_tag( | ||||
'span', | 'span', | ||||
array( | array( | ||||
'class' => 'slowvote-hint', | 'class' => 'slowvote-hint', | ||||
), | ), | ||||
$quip); | $quip); | ||||
if ($poll->getIsClosed()) { | if ($poll->isClosed()) { | ||||
$submit = null; | $submit = null; | ||||
} else { | } else { | ||||
$submit = phutil_tag( | $submit = phutil_tag( | ||||
'div', | 'div', | ||||
array( | array( | ||||
'class' => 'slowvote-footer', | 'class' => 'slowvote-footer', | ||||
), | ), | ||||
phutil_tag( | phutil_tag( | ||||
▲ Show 20 Lines • Show All 116 Lines • ▼ Show 20 Lines | final class SlowvoteEmbedView extends AphrontView { | ||||
} | } | ||||
private function renderControl(PhabricatorSlowvoteOption $option, $selected) { | private function renderControl(PhabricatorSlowvoteOption $option, $selected) { | ||||
$types = array( | $types = array( | ||||
SlowvotePollVotingMethod::METHOD_PLURALITY => 'radio', | SlowvotePollVotingMethod::METHOD_PLURALITY => 'radio', | ||||
SlowvotePollVotingMethod::METHOD_APPROVAL => 'checkbox', | SlowvotePollVotingMethod::METHOD_APPROVAL => 'checkbox', | ||||
); | ); | ||||
$closed = $this->getPoll()->getIsClosed(); | $closed = $this->getPoll()->isClosed(); | ||||
return phutil_tag( | return phutil_tag( | ||||
'input', | 'input', | ||||
array( | array( | ||||
'type' => idx($types, $this->getPoll()->getMethod()), | 'type' => idx($types, $this->getPoll()->getMethod()), | ||||
'name' => 'vote[]', | 'name' => 'vote[]', | ||||
'value' => $option->getID(), | 'value' => $option->getID(), | ||||
'checked' => ($selected ? 'checked' : null), | 'checked' => ($selected ? 'checked' : null), | ||||
▲ Show 20 Lines • Show All 104 Lines • Show Last 20 Lines |