Differential D20748 Diff 49474 src/applications/diffusion/controller/DiffusionRepositoryController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/controller/DiffusionRepositoryController.php
Show First 20 Lines • Show All 139 Lines • ▼ Show 20 Lines | $clone_button = id(new PHUIButtonView()) | ||||
->setWorkflow(true) | ->setWorkflow(true) | ||||
->setHref($clone_uri); | ->setHref($clone_uri); | ||||
$bar = id(new PHUILeftRightView()) | $bar = id(new PHUILeftRightView()) | ||||
->setLeft($locate_file) | ->setLeft($locate_file) | ||||
->setRight(array($this->branchButton, $actions_button, $clone_button)) | ->setRight(array($this->branchButton, $actions_button, $clone_button)) | ||||
->addClass('diffusion-action-bar'); | ->addClass('diffusion-action-bar'); | ||||
$status_view = null; | |||||
if ($repository->isReadOnly()) { | |||||
$status_view = id(new PHUIInfoView()) | |||||
->setSeverity(PHUIInfoView::SEVERITY_WARNING) | |||||
->setErrors( | |||||
array( | |||||
phutil_escape_html_newlines( | |||||
$repository->getReadOnlyMessageForDisplay()), | |||||
)); | |||||
} | |||||
$view = id(new PHUITwoColumnView()) | $view = id(new PHUITwoColumnView()) | ||||
->setHeader($header) | ->setHeader($header) | ||||
->setFooter(array( | ->setFooter( | ||||
array( | |||||
$status_view, | |||||
$bar, | $bar, | ||||
$description, | $description, | ||||
$content, | $content, | ||||
)); | )); | ||||
if ($page_has_content) { | if ($page_has_content) { | ||||
$view->setTabs($tabs); | $view->setTabs($tabs); | ||||
} | } | ||||
return $this->newPage() | return $this->newPage() | ||||
->setTitle( | ->setTitle( | ||||
array( | array( | ||||
▲ Show 20 Lines • Show All 159 Lines • ▼ Show 20 Lines | $header = id(new PHUIHeaderView()) | ||||
->setProfileHeader(true) | ->setProfileHeader(true) | ||||
->setImage($repository->getProfileImageURI()) | ->setImage($repository->getProfileImageURI()) | ||||
->setImageEditURL('/diffusion/picture/'.$repository->getID().'/') | ->setImageEditURL('/diffusion/picture/'.$repository->getID().'/') | ||||
->addActionItem($search) | ->addActionItem($search) | ||||
->addClass('diffusion-profile-header'); | ->addClass('diffusion-profile-header'); | ||||
if (!$repository->isTracked()) { | if (!$repository->isTracked()) { | ||||
$header->setStatus('fa-ban', 'dark', pht('Inactive')); | $header->setStatus('fa-ban', 'dark', pht('Inactive')); | ||||
} else if ($repository->isReadOnly()) { | |||||
$header->setStatus('fa-wrench', 'indigo', pht('Under Maintenance')); | |||||
} else if ($repository->isImporting()) { | } else if ($repository->isImporting()) { | ||||
$ratio = $repository->loadImportProgress(); | $ratio = $repository->loadImportProgress(); | ||||
$percentage = sprintf('%.2f%%', 100 * $ratio); | $percentage = sprintf('%.2f%%', 100 * $ratio); | ||||
$header->setStatus( | $header->setStatus( | ||||
'fa-clock-o', | 'fa-clock-o', | ||||
'indigo', | 'indigo', | ||||
pht('Importing (%s)...', $percentage)); | pht('Importing (%s)...', $percentage)); | ||||
} else if ($repository->isPublishingDisabled()) { | } else if ($repository->isPublishingDisabled()) { | ||||
▲ Show 20 Lines • Show All 296 Lines • Show Last 20 Lines |