Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/view/DifferentialAddCommentView.php
Show First 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | final class DifferentialAddCommentView extends AphrontView { | ||||
public function setCCs(array $names) { | public function setCCs(array $names) { | ||||
$this->ccs = $names; | $this->ccs = $names; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function render() { | public function render() { | ||||
$this->requireResource('differential-revision-add-comment-css'); | $this->requireResource('differential-revision-add-comment-css'); | ||||
$is_serious = PhabricatorEnv::getEnvConfig('phabricator.serious-business'); | |||||
$revision = $this->revision; | $revision = $this->revision; | ||||
$action = null; | $action = null; | ||||
if ($this->draft) { | if ($this->draft) { | ||||
$action = idx($this->draft->getMetadata(), 'action'); | $action = idx($this->draft->getMetadata(), 'action'); | ||||
} | } | ||||
$enable_reviewers = DifferentialAction::allowReviewers($action); | $enable_reviewers = DifferentialAction::allowReviewers($action); | ||||
Show All 38 Lines | $form | ||||
id(new PhabricatorRemarkupControl()) | id(new PhabricatorRemarkupControl()) | ||||
->setName('comment') | ->setName('comment') | ||||
->setID('comment-content') | ->setID('comment-content') | ||||
->setLabel(pht('Comment')) | ->setLabel(pht('Comment')) | ||||
->setValue($this->draft ? $this->draft->getDraft() : null) | ->setValue($this->draft ? $this->draft->getDraft() : null) | ||||
->setUser($this->user)) | ->setUser($this->user)) | ||||
->appendChild( | ->appendChild( | ||||
id(new AphrontFormSubmitControl()) | id(new AphrontFormSubmitControl()) | ||||
->setValue($is_serious ? pht('Submit') : pht('Clowncopterize'))); | ->setValue(pht('Submit'))); | ||||
Javelin::initBehavior( | Javelin::initBehavior( | ||||
'differential-add-reviewers-and-ccs', | 'differential-add-reviewers-and-ccs', | ||||
array( | array( | ||||
'dynamic' => array( | 'dynamic' => array( | ||||
'add-reviewers-tokenizer' => array( | 'add-reviewers-tokenizer' => array( | ||||
'actions' => array( | 'actions' => array( | ||||
'request_review' => 1, | 'request_review' => 1, | ||||
Show All 31 Lines | Javelin::initBehavior( | ||||
'reviewers' => 'add-reviewers-tokenizer', | 'reviewers' => 'add-reviewers-tokenizer', | ||||
'ccs' => 'add-ccs-tokenizer', | 'ccs' => 'add-ccs-tokenizer', | ||||
), | ), | ||||
'inlineuri' => '/differential/comment/inline/preview/'.$rev_id.'/', | 'inlineuri' => '/differential/comment/inline/preview/'.$rev_id.'/', | ||||
'inline' => 'inline-comment-preview', | 'inline' => 'inline-comment-preview', | ||||
)); | )); | ||||
$is_serious = PhabricatorEnv::getEnvConfig('phabricator.serious-business'); | |||||
$header_text = $is_serious | |||||
? pht('Add Comment') | |||||
: pht('Leap Into Action'); | |||||
$header = id(new PHUIHeaderView()) | $header = id(new PHUIHeaderView()) | ||||
->setHeader($is_serious ? pht('Add Comment') : pht('Leap Into Action')); | ->setHeader($header_text); | ||||
$anchor = id(new PhabricatorAnchorView()) | $anchor = id(new PhabricatorAnchorView()) | ||||
->setAnchorName('comment') | ->setAnchorName('comment') | ||||
->setNavigationMarker(true); | ->setNavigationMarker(true); | ||||
$loading = phutil_tag( | $loading = phutil_tag( | ||||
'span', | 'span', | ||||
array('class' => 'aphront-panel-preview-loading-text'), | array('class' => 'aphront-panel-preview-loading-text'), | ||||
Show All 22 Lines |