Page MenuHomePhabricator

D15572.diff
No OneTemporary

D15572.diff

diff --git a/src/applications/phriction/controller/PhrictionDiffController.php b/src/applications/phriction/controller/PhrictionDiffController.php
--- a/src/applications/phriction/controller/PhrictionDiffController.php
+++ b/src/applications/phriction/controller/PhrictionDiffController.php
@@ -98,6 +98,7 @@
->setRenderingReferences(array("{$l},{$r}"))
->setRenderURI('/phriction/diff/'.$document->getID().'/')
->setTitle(pht('Changes'))
+ ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setParser($parser);
require_celerity_resource('phriction-document-css');
@@ -121,11 +122,10 @@
$header = id(new PHUIHeaderView())
->setHeader($title)
- ->setTall(true);
+ ->setHeaderIcon('fa-history');
$crumbs->addTextCrumb($title, $request->getRequestURI());
-
$comparison_table = $this->renderComparisonTable(
array(
$content_r,
@@ -144,7 +144,7 @@
'a',
array(
'href' => $uri->alter('l', $l - 1)->alter('r', $r - 1),
- 'class' => 'button simple',
+ 'class' => 'button grey',
),
pht("\xC2\xAB Previous Change"));
} else {
@@ -163,7 +163,7 @@
'a',
array(
'href' => $uri->alter('l', $l + 1)->alter('r', $r + 1),
- 'class' => 'button simple',
+ 'class' => 'button grey',
),
pht("Next Change \xC2\xBB"));
} else {
@@ -185,7 +185,6 @@
)));
}
-
$output = hsprintf(
'<div class="phriction-document-history-diff">'.
'%s%s'.
@@ -198,21 +197,25 @@
$revert_l,
$revert_r);
-
$object_box = id(new PHUIObjectBoxView())
- ->setHeader($header)
+ ->setHeaderText(pht('Edits'))
+ ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->appendChild($output);
- return $this->buildApplicationPage(
- array(
- $crumbs,
+ $crumbs->setBorder(true);
+
+ $view = id(new PHUITwoColumnView())
+ ->setHeader($header)
+ ->setFooter(array(
$object_box,
$changes,
- ),
- array(
- 'title' => pht('Document History'),
));
+ return $this->newPage()
+ ->setTitle(pht('Document History'))
+ ->setCrumbs($crumbs)
+ ->appendChild($view);
+
}
private function renderRevertButton(
@@ -238,7 +241,7 @@
'a',
array(
'href' => '/phriction/edit/'.$document_id.'/',
- 'class' => 'button simple',
+ 'class' => 'button grey',
),
pht('Edit Current Version'));
}
@@ -248,7 +251,7 @@
'a',
array(
'href' => '/phriction/edit/'.$document_id.'/?revert='.$version,
- 'class' => 'button simple',
+ 'class' => 'button grey',
),
pht('Revert to Version %s...', $version));
}
diff --git a/src/applications/phriction/controller/PhrictionEditController.php b/src/applications/phriction/controller/PhrictionEditController.php
--- a/src/applications/phriction/controller/PhrictionEditController.php
+++ b/src/applications/phriction/controller/PhrictionEditController.php
@@ -177,8 +177,9 @@
}
if ($document->getID()) {
- $panel_header = pht('Edit Phriction Document');
+ $panel_header = pht('Edit Document: %s', $content->getTitle());
$page_title = pht('Edit Document');
+ $header_icon = 'fa-pencil';
if ($overwrite) {
$submit_button = pht('Overwrite Changes');
} else {
@@ -188,6 +189,7 @@
$panel_header = pht('Create New Phriction Document');
$submit_button = pht('Create Document');
$page_title = pht('Create Document');
+ $header_icon = 'fa-plus-square';
}
$uri = $document->getSlug();
@@ -263,8 +265,9 @@
->setValue($submit_button));
$form_box = id(new PHUIObjectBoxView())
- ->setHeaderText($panel_header)
+ ->setHeaderText(pht('Document'))
->setValidationException($validation_exception)
+ ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setForm($form);
$preview = id(new PHUIRemarkupPreviewPanel())
@@ -282,17 +285,25 @@
} else {
$crumbs->addTextCrumb(pht('Create'));
}
+ $crumbs->setBorder(true);
- return $this->buildApplicationPage(
- array(
- $crumbs,
+ $header = id(new PHUIHeaderView())
+ ->setHeader($panel_header)
+ ->setHeaderIcon($header_icon);
+
+ $view = id(new PHUITwoColumnView())
+ ->setHeader($header)
+ ->setFooter(array(
$draft_note,
$form_box,
$preview,
- ),
- array(
- 'title' => $page_title,
));
+
+ return $this->newPage()
+ ->setTitle($page_title)
+ ->setCrumbs($crumbs)
+ ->appendChild($view);
+
}
}
diff --git a/src/applications/phriction/controller/PhrictionHistoryController.php b/src/applications/phriction/controller/PhrictionHistoryController.php
--- a/src/applications/phriction/controller/PhrictionHistoryController.php
+++ b/src/applications/phriction/controller/PhrictionHistoryController.php
@@ -3,19 +3,17 @@
final class PhrictionHistoryController
extends PhrictionController {
- private $slug;
-
public function shouldAllowPublic() {
return true;
}
public function handleRequest(AphrontRequest $request) {
$viewer = $request->getViewer();
- $this->slug = $request->getURIData('slug');
+ $slug = $request->getURIData('slug');
$document = id(new PhrictionDocumentQuery())
->setViewer($viewer)
- ->withSlugs(array(PhabricatorSlug::normalize($this->slug)))
+ ->withSlugs(array(PhabricatorSlug::normalize($slug)))
->needContent(true)
->executeOne();
if (!$document) {
@@ -141,6 +139,7 @@
$crumbs->addTextCrumb(
pht('History'),
PhrictionDocument::getSlugURI($document->getSlug(), 'history'));
+ $crumbs->setBorder(true);
$header = new PHUIHeaderView();
$header->setHeader(phutil_tag(
@@ -150,23 +149,31 @@
$header->setSubheader(pht('Document History'));
$obj_box = id(new PHUIObjectBoxView())
- ->setHeader($header)
+ ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setObjectList($list);
$pager = id(new PHUIBoxView())
->addClass('ml')
->appendChild($pager);
- return $this->buildApplicationPage(
- array(
- $crumbs,
+ $header = id(new PHUIHeaderView())
+ ->setHeader(pht('Document History: %s', head($history)->getTitle()))
+ ->setHeaderIcon('fa-history');
+
+ $view = id(new PHUITwoColumnView())
+ ->setHeader($header)
+ ->setFooter(array(
$obj_box,
$pager,
- ),
- array(
- 'title' => pht('Document History'),
));
+ $title = pht('Document History');
+
+ return $this->newPage()
+ ->setTitle($title)
+ ->setCrumbs($crumbs)
+ ->appendChild($view);
+
}
}
diff --git a/src/applications/phriction/controller/PhrictionNewController.php b/src/applications/phriction/controller/PhrictionNewController.php
--- a/src/applications/phriction/controller/PhrictionNewController.php
+++ b/src/applications/phriction/controller/PhrictionNewController.php
@@ -16,8 +16,8 @@
PhrictionDocumentStatus::STATUS_EXISTS;
if ($document_exists && $prompt == 'no') {
- $dialog = new AphrontDialogView();
- $dialog->setSubmitURI('/phriction/new/')
+ return $this->newDialog()
+ ->setSubmitURI('/phriction/new/')
->setTitle(pht('Edit Existing Document?'))
->setUser($viewer)
->appendChild(pht(
@@ -27,8 +27,6 @@
->addHiddenInput('prompt', 'yes')
->addCancelButton('/w/')
->addSubmitButton(pht('Edit Document'));
-
- return id(new AphrontDialogResponse())->setDialog($dialog);
}
$uri = '/phriction/edit/?slug='.$slug;
@@ -46,8 +44,7 @@
->setValue($slug)
->setName('slug'));
- $dialog = id(new AphrontDialogView())
- ->setUser($viewer)
+ return $this->newDialog()
->setTitle(pht('New Document'))
->setSubmitURI('/phriction/new/')
->appendChild(phutil_tag('p',
@@ -57,7 +54,6 @@
->addSubmitButton(pht('Create'))
->addCancelButton('/w/');
- return id(new AphrontDialogResponse())->setDialog($dialog);
}
}

File Metadata

Mime Type
text/plain
Expires
Thu, Mar 6, 11:11 PM (2 w, 5 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7309412
Default Alt Text
D15572.diff (8 KB)

Event Timeline