Differential D7914 Diff 17922 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 288 Lines • ▼ Show 20 Lines | private function buildBranchListTable(DiffusionRequest $drequest) { | ||||
$panel = new PHUIObjectBoxView(); | $panel = new PHUIObjectBoxView(); | ||||
$header = new PHUIHeaderView(); | $header = new PHUIHeaderView(); | ||||
$header->setHeader(pht('Branches')); | $header->setHeader(pht('Branches')); | ||||
if ($more_branches) { | if ($more_branches) { | ||||
$header->setSubHeader(pht('Showing %d branches.', $limit)); | $header->setSubHeader(pht('Showing %d branches.', $limit)); | ||||
} | } | ||||
$icon = id(new PHUIIconView()) | |||||
->setSpriteSheet(PHUIIconView::SPRITE_ICONS) | |||||
->setSpriteIcon('fork'); | |||||
$button = new PHUIButtonView(); | $button = new PHUIButtonView(); | ||||
$button->setText(pht("Show All Branches")); | $button->setText(pht("Show All Branches")); | ||||
$button->setTag('a'); | $button->setTag('a'); | ||||
$button->setIcon($icon); | |||||
$button->setHref($drequest->generateURI( | $button->setHref($drequest->generateURI( | ||||
array( | array( | ||||
'action' => 'branches', | 'action' => 'branches', | ||||
))); | ))); | ||||
$header->addActionLink($button); | $header->addActionLink($button); | ||||
$panel->setHeader($header); | $panel->setHeader($header); | ||||
$panel->appendChild($table); | $panel->appendChild($table); | ||||
▲ Show 20 Lines • Show All 142 Lines • ▼ Show 20 Lines | private function buildHistoryTable( | ||||
// TODO: Super sketchy. | // TODO: Super sketchy. | ||||
$history_table->loadRevisions(); | $history_table->loadRevisions(); | ||||
if ($history_results) { | if ($history_results) { | ||||
$history_table->setParents($history_results['parents']); | $history_table->setParents($history_results['parents']); | ||||
} | } | ||||
$history_table->setIsHead(true); | $history_table->setIsHead(true); | ||||
$callsign = $drequest->getRepository()->getCallsign(); | $callsign = $drequest->getRepository()->getCallsign(); | ||||
$all = phutil_tag( | |||||
'a', | $icon = id(new PHUIIconView()) | ||||
array( | ->setSpriteSheet(PHUIIconView::SPRITE_ICONS) | ||||
'href' => $drequest->generateURI( | ->setSpriteIcon('transcript'); | ||||
$button = id(new PHUIButtonView()) | |||||
->setText(pht('View Full History')) | |||||
->setHref($drequest->generateURI( | |||||
array( | array( | ||||
'action' => 'history', | 'action' => 'history', | ||||
)), | ))) | ||||
), | ->setTag('a') | ||||
pht('View Full Commit History')); | ->setIcon($icon); | ||||
$panel = new PHUIObjectBoxView(); | $panel = new PHUIObjectBoxView(); | ||||
$panel->setHeaderText(pht("Recent Commits · %s", $all)); | $header = id(new PHUIHeaderView()) | ||||
->setHeader(pht('Recent Commits')) | |||||
->addActionLink($button); | |||||
$panel->setHeader($header); | |||||
$panel->appendChild($history_table); | $panel->appendChild($history_table); | ||||
return $panel; | return $panel; | ||||
} | } | ||||
private function buildBrowseTable( | private function buildBrowseTable( | ||||
$browse_results, | $browse_results, | ||||
$browse_paths, | $browse_paths, | ||||
Show All 24 Lines | if ($browse_paths) { | ||||
$browse_table->setPaths($browse_paths); | $browse_table->setPaths($browse_paths); | ||||
} else { | } else { | ||||
$browse_table->setPaths(array()); | $browse_table->setPaths(array()); | ||||
} | } | ||||
$browse_uri = $drequest->generateURI(array('action' => 'browse')); | $browse_uri = $drequest->generateURI(array('action' => 'browse')); | ||||
$browse_panel = new PHUIObjectBoxView(); | $browse_panel = new PHUIObjectBoxView(); | ||||
$browse_panel->setHeaderText( | $header = id(new PHUIHeaderView()) | ||||
phutil_tag( | ->setHeader(pht('Repository')); | ||||
'a', | |||||
array('href' => $browse_uri), | $icon = id(new PHUIIconView()) | ||||
pht('Browse Repository'))); | ->setSpriteSheet(PHUIIconView::SPRITE_ICONS) | ||||
->setSpriteIcon('data'); | |||||
$button = new PHUIButtonView(); | |||||
$button->setText(pht('Browse Repository')); | |||||
$button->setTag('a'); | |||||
$button->setIcon($icon); | |||||
$button->setHref($browse_uri); | |||||
$header->addActionLink($button); | |||||
$browse_panel->setHeader($header); | |||||
$browse_panel->appendChild($browse_table); | $browse_panel->appendChild($browse_table); | ||||
return $browse_panel; | return $browse_panel; | ||||
} | } | ||||
private function renderCloneURI( | private function renderCloneURI( | ||||
$uri, | $uri, | ||||
$serve_mode = null, | $serve_mode = null, | ||||
▲ Show 20 Lines • Show All 48 Lines • Show Last 20 Lines |