1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-19 20:10:55 +01:00

Merge pull request #41 from CodeBlock/master

D700
This commit is contained in:
Evan Priestley 2011-07-21 09:02:04 -07:00
commit 08ded289b7

View file

@ -42,18 +42,18 @@ class PhabricatorPasteViewController extends PhabricatorPasteController {
} }
$corpus = $this->buildCorpus($paste, $file); $corpus = $this->buildCorpus($paste, $file);
$panel = new AphrontPanelView(); $paste_panel = new AphrontPanelView();
if (strlen($paste->getTitle())) { if (strlen($paste->getTitle())) {
$panel->setHeader( $paste_panel->setHeader(
'Viewing Paste '.$paste->getID().' - '. 'Viewing Paste '.$paste->getID().' - '.
phutil_escape_html($paste->getTitle())); phutil_escape_html($paste->getTitle()));
} else { } else {
$panel->setHeader('Viewing Paste '.$paste->getID()); $paste_panel->setHeader('Viewing Paste '.$paste->getID());
} }
$panel->setWidth(AphrontPanelView::WIDTH_FULL); $paste_panel->setWidth(AphrontPanelView::WIDTH_FULL);
$panel->addButton( $paste_panel->addButton(
phutil_render_tag( phutil_render_tag(
'a', 'a',
array( array(
@ -63,7 +63,7 @@ class PhabricatorPasteViewController extends PhabricatorPasteController {
'Fork This')); 'Fork This'));
$raw_uri = PhabricatorFileURI::getViewURIForPHID($paste->getFilePHID()); $raw_uri = PhabricatorFileURI::getViewURIForPHID($paste->getFilePHID());
$panel->addButton( $paste_panel->addButton(
phutil_render_tag( phutil_render_tag(
'a', 'a',
array( array(
@ -72,13 +72,16 @@ class PhabricatorPasteViewController extends PhabricatorPasteController {
), ),
'View Raw Text')); 'View Raw Text'));
$panel->appendChild($corpus); $paste_panel->appendChild($corpus);
$forks_panel = null;
$forks_of_this_paste = id(new PhabricatorPaste())->loadAllWhere( $forks_of_this_paste = id(new PhabricatorPaste())->loadAllWhere(
'parentPHID = %s', 'parentPHID = %s',
$paste->getPHID()); $paste->getPHID());
if ($forks_of_this_paste) { if ($forks_of_this_paste) {
$forks_panel = new AphrontPanelView();
$forks_panel->setHeader("Forks of this paste");
$forks = array(); $forks = array();
foreach ($forks_of_this_paste as $fork) { foreach ($forks_of_this_paste as $fork) {
$forks[] = array( $forks[] = array(
@ -92,7 +95,6 @@ class PhabricatorPasteViewController extends PhabricatorPasteController {
) )
); );
} }
$forks_table = new AphrontTableView($forks); $forks_table = new AphrontTableView($forks);
$forks_table->setHeaders( $forks_table->setHeaders(
array( array(
@ -100,13 +102,20 @@ class PhabricatorPasteViewController extends PhabricatorPasteController {
'Title', 'Title',
) )
); );
$forks_table->setColumnClasses(
$panel->setHeader("Forks of this Paste"); array(
$panel->appendChild($forks_table); null,
'wide pri',
)
);
$forks_panel->appendChild($forks_table);
} }
return $this->buildStandardPageResponse( return $this->buildStandardPageResponse(
$panel, array(
$paste_panel,
$forks_panel,
),
array( array(
'title' => 'Paste: '.nonempty($paste->getTitle(), 'P'.$paste->getID()), 'title' => 'Paste: '.nonempty($paste->getTitle(), 'P'.$paste->getID()),
'tab' => 'view', 'tab' => 'view',