Changeset View
Changeset View
Standalone View
Standalone View
src/applications/harbormaster/view/HarbormasterUnitSummaryView.php
<?php | <?php | ||||
final class HarbormasterUnitSummaryView extends AphrontView { | final class HarbormasterUnitSummaryView extends AphrontView { | ||||
private $buildable; | private $buildable; | ||||
private $messages; | private $messages; | ||||
private $limit; | private $limit; | ||||
private $excuse; | |||||
private $showViewAll; | private $showViewAll; | ||||
public function setBuildable(HarbormasterBuildable $buildable) { | public function setBuildable(HarbormasterBuildable $buildable) { | ||||
$this->buildable = $buildable; | $this->buildable = $buildable; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function setUnitMessages(array $messages) { | public function setUnitMessages(array $messages) { | ||||
$this->messages = $messages; | $this->messages = $messages; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function setLimit($limit) { | public function setLimit($limit) { | ||||
$this->limit = $limit; | $this->limit = $limit; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function setExcuse($excuse) { | |||||
$this->excuse = $excuse; | |||||
return $this; | |||||
} | |||||
public function setShowViewAll($show_view_all) { | public function setShowViewAll($show_view_all) { | ||||
$this->showViewAll = $show_view_all; | $this->showViewAll = $show_view_all; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function render() { | public function render() { | ||||
$messages = $this->messages; | $messages = $this->messages; | ||||
$buildable = $this->buildable; | $buildable = $this->buildable; | ||||
▲ Show 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | public function render() { | ||||
if ($this->showViewAll) { | if ($this->showViewAll) { | ||||
$table->setFullResultsURI($full_uri); | $table->setFullResultsURI($full_uri); | ||||
} | } | ||||
if ($this->limit) { | if ($this->limit) { | ||||
$table->setLimit($this->limit); | $table->setLimit($this->limit); | ||||
} | } | ||||
$excuse = $this->excuse; | |||||
if (strlen($excuse)) { | |||||
$excuse_icon = id(new PHUIIconView()) | |||||
->setIcon('fa-commenting-o red'); | |||||
$table->setNotice( | |||||
array( | |||||
$excuse_icon, | |||||
' ', | |||||
phutil_tag('strong', array(), pht('Excuse:')), | |||||
' ', | |||||
$excuse, | |||||
)); | |||||
} | |||||
$box->setTable($table); | $box->setTable($table); | ||||
return $box; | return $box; | ||||
} | } | ||||
} | } |