Changeset View
Changeset View
Standalone View
Standalone View
src/repository/graph/view/ArcanistCommitGraphSetView.php
Show First 20 Lines • Show All 227 Lines • ▼ Show 20 Lines | public function newCellViews() { | ||||
$marker_view = $this->drawMarkerCell($items); | $marker_view = $this->drawMarkerCell($items); | ||||
$commits_view = $this->drawCommitsCell($items); | $commits_view = $this->drawCommitsCell($items); | ||||
$status_view = $this->drawStatusCell($items); | $status_view = $this->drawStatusCell($items); | ||||
$revisions_view = $this->drawRevisionsCell($items); | $revisions_view = $this->drawRevisionsCell($items); | ||||
$messages_view = $this->drawMessagesCell($items); | $messages_view = $this->drawMessagesCell($items); | ||||
return array( | return array( | ||||
id(new ArcanistGridCell()) | (new ArcanistGridCell()) | ||||
->setKey('marker') | ->setKey('marker') | ||||
->setContent($marker_view), | ->setContent($marker_view), | ||||
id(new ArcanistGridCell()) | (new ArcanistGridCell()) | ||||
->setKey('commits') | ->setKey('commits') | ||||
->setContent($commits_view), | ->setContent($commits_view), | ||||
id(new ArcanistGridCell()) | (new ArcanistGridCell()) | ||||
->setKey('status') | ->setKey('status') | ||||
->setContent($status_view), | ->setContent($status_view), | ||||
id(new ArcanistGridCell()) | (new ArcanistGridCell()) | ||||
->setKey('revisions') | ->setKey('revisions') | ||||
->setContent($revisions_view), | ->setContent($revisions_view), | ||||
id(new ArcanistGridCell()) | (new ArcanistGridCell()) | ||||
->setKey('messages') | ->setKey('messages') | ||||
->setContent($messages_view), | ->setContent($messages_view), | ||||
); | ); | ||||
} | } | ||||
private function drawMarkerCell(array $items) { | private function drawMarkerCell(array $items) { | ||||
$api = $this->getRepositoryAPI(); | $api = $this->getRepositoryAPI(); | ||||
▲ Show 20 Lines • Show All 67 Lines • ▼ Show 20 Lines | foreach ($items as $item_key => $item) { | ||||
$is_active = $marker_ref->getIsActive(); | $is_active = $marker_ref->getIsActive(); | ||||
if ($is_active) { | if ($is_active) { | ||||
$marker_width = $available_width - 4; | $marker_width = $available_width - 4; | ||||
} else { | } else { | ||||
$marker_width = $available_width; | $marker_width = $available_width; | ||||
} | } | ||||
$marker_name = id(new PhutilUTF8StringTruncator()) | $marker_name = (new PhutilUTF8StringTruncator()) | ||||
->setMaximumGlyphs($marker_width) | ->setMaximumGlyphs($marker_width) | ||||
->truncateString($marker_name); | ->truncateString($marker_name); | ||||
if ($marker_ref->getIsActive()) { | if ($marker_ref->getIsActive()) { | ||||
$label = tsprintf( | $label = tsprintf( | ||||
'<bg:green>**%s**</bg> **%s**', | '<bg:green>**%s**</bg> **%s**', | ||||
' * ', | ' * ', | ||||
$marker_name); | $marker_name); | ||||
▲ Show 20 Lines • Show All 228 Lines • Show Last 20 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0