Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/view/DiffusionBrowseTableView.php
Show First 20 Lines • Show All 68 Lines • ▼ Show 20 Lines | foreach ($this->paths as $path) { | ||||
$history_path = $full_path; | $history_path = $full_path; | ||||
} | } | ||||
$history_link = $this->linkHistory($history_path); | $history_link = $this->linkHistory($history_path); | ||||
$dict = array( | $dict = array( | ||||
'lint' => celerity_generate_unique_node_id(), | 'lint' => celerity_generate_unique_node_id(), | ||||
'coverage' => celerity_generate_unique_node_id(), | |||||
'commit' => celerity_generate_unique_node_id(), | 'commit' => celerity_generate_unique_node_id(), | ||||
'date' => celerity_generate_unique_node_id(), | 'date' => celerity_generate_unique_node_id(), | ||||
'author' => celerity_generate_unique_node_id(), | 'author' => celerity_generate_unique_node_id(), | ||||
'details' => celerity_generate_unique_node_id(), | 'details' => celerity_generate_unique_node_id(), | ||||
); | ); | ||||
$need_pull[$full_path.$dir_slash] = $dict; | $need_pull[$full_path.$dir_slash] = $dict; | ||||
foreach ($dict as $k => $uniq) { | foreach ($dict as $k => $uniq) { | ||||
$dict[$k] = phutil_tag('span', array('id' => $uniq), ''); | $dict[$k] = phutil_tag('span', array('id' => $uniq), ''); | ||||
} | } | ||||
$rows[] = array( | $rows[] = array( | ||||
$history_link, | $history_link, | ||||
$browse_link, | $browse_link, | ||||
idx($dict, 'lint'), | idx($dict, 'lint'), | ||||
$dict['coverage'], | |||||
$dict['commit'], | $dict['commit'], | ||||
$dict['author'], | $dict['author'], | ||||
$dict['details'], | $dict['details'], | ||||
$dict['date'], | $dict['date'], | ||||
); | ); | ||||
} | } | ||||
if ($need_pull) { | if ($need_pull) { | ||||
Javelin::initBehavior( | Javelin::initBehavior( | ||||
'diffusion-pull-lastmodified', | 'diffusion-pull-lastmodified', | ||||
array( | array( | ||||
'uri' => (string)$request->generateURI( | 'uri' => (string)$request->generateURI( | ||||
array( | array( | ||||
'action' => 'lastmodified', | 'action' => 'lastmodified', | ||||
'stable' => true, | 'stable' => true, | ||||
)), | )), | ||||
'map' => $need_pull, | 'map' => $need_pull, | ||||
)); | )); | ||||
} | } | ||||
$branch = $this->getDiffusionRequest()->loadBranch(); | $branch = $this->getDiffusionRequest()->loadBranch(); | ||||
$show_lint = ($branch && $branch->getLintCommit()); | $show_lint = ($branch && $branch->getLintCommit()); | ||||
$lint = $request->getLint(); | $lint = $request->getLint(); | ||||
$show_coverage = $this->getDiffusionRequest()->loadCoverage(); | |||||
$view = new AphrontTableView($rows); | $view = new AphrontTableView($rows); | ||||
$view->setHeaders( | $view->setHeaders( | ||||
array( | array( | ||||
null, | null, | ||||
pht('Path'), | pht('Path'), | ||||
($lint ? $lint : pht('Lint')), | ($lint ? $lint : pht('Lint')), | ||||
pht('Coverage'), | |||||
pht('Modified'), | pht('Modified'), | ||||
pht('Author/Committer'), | pht('Author/Committer'), | ||||
pht('Details'), | pht('Details'), | ||||
pht('Committed'), | pht('Committed'), | ||||
)); | )); | ||||
$view->setColumnClasses( | $view->setColumnClasses( | ||||
array( | array( | ||||
'nudgeright', | 'nudgeright', | ||||
'', | '', | ||||
'', | '', | ||||
'', | '', | ||||
'', | '', | ||||
'', | |||||
'wide', | 'wide', | ||||
'', | '', | ||||
)); | )); | ||||
$view->setColumnVisibility( | $view->setColumnVisibility( | ||||
array( | array( | ||||
true, | true, | ||||
true, | true, | ||||
$show_lint, | $show_lint, | ||||
$show_coverage, | |||||
true, | true, | ||||
true, | true, | ||||
true, | true, | ||||
true, | true, | ||||
)); | )); | ||||
$view->setDeviceVisibility( | $view->setDeviceVisibility( | ||||
array( | array( | ||||
true, | true, | ||||
true, | true, | ||||
false, | false, | ||||
false, | |||||
true, | true, | ||||
false, | false, | ||||
true, | true, | ||||
false, | false, | ||||
)); | )); | ||||
return $view->render(); | return $view->render(); | ||||
} | } | ||||
} | } |