Page MenuHomePhabricator

D8408.id19964.diff
No OneTemporary

D8408.id19964.diff

diff --git a/src/applications/diviner/controller/DivinerBookController.php b/src/applications/diviner/controller/DivinerBookController.php
--- a/src/applications/diviner/controller/DivinerBookController.php
+++ b/src/applications/diviner/controller/DivinerBookController.php
@@ -95,6 +95,9 @@
pht('Updated'),
phabricator_datetime($book->getDateModified(), $user));
+ $view->addTextContent(
+ 'derp derp');
+
return $view;
}
diff --git a/src/applications/diviner/controller/DivinerFindController.php b/src/applications/diviner/controller/DivinerFindController.php
--- a/src/applications/diviner/controller/DivinerFindController.php
+++ b/src/applications/diviner/controller/DivinerFindController.php
@@ -11,6 +11,7 @@
$viewer = $request->getUser();
$book_name = $request->getStr('book');
+ $query_text = $request->getStr('name');
$book = null;
if ($book_name) {
@@ -44,22 +45,33 @@
$name_query->withNames(
array(
- $request->getStr('name'),
+ $query_text,
// TODO: This could probably be more smartly normalized in the DB,
// but just fake it for now.
- phutil_utf8_strtolower($request->getStr('name')),
+ phutil_utf8_strtolower($query_text),
));
$atoms = $name_query->execute();
if (!$atoms) {
$title_query = clone $query;
- $title_query->withTitles(array($request->getStr('name')));
+ $title_query->withTitles(array($query_text));
$atoms = $title_query->execute();
}
+ $not_found_uri = $this->getApplicationURI();
+
if (!$atoms) {
- return new Aphront404Response();
+ $dialog = id(new AphrontDialogView())
+ ->setUser($viewer)
+ ->setTitle(pht('Documentation Not Found'))
+ ->appendChild(
+ pht(
+ 'Unable to find the specified documentation. You may have '.
+ 'followed a bad or outdated link.'))
+ ->addCancelButton($not_found_uri, pht('Read More Documentation'));
+
+ return id(new AphrontDialogResponse())->setDialog($dialog);
}
if (count($atoms) == 1 && $request->getBool('jump')) {
@@ -72,7 +84,7 @@
return $this->buildApplicationPage(
$list,
array(
- 'title' => 'derp',
+ 'title' => array(pht('Find'), pht('"%s"', $query_text)),
'device' => true,
));
}
diff --git a/src/applications/diviner/storage/DivinerLiveBook.php b/src/applications/diviner/storage/DivinerLiveBook.php
--- a/src/applications/diviner/storage/DivinerLiveBook.php
+++ b/src/applications/diviner/storage/DivinerLiveBook.php
@@ -38,6 +38,10 @@
return $this->getConfig('short', $this->getTitle());
}
+ public function getPreface() {
+ return $this->getConfig('preface');
+ }
+
public function getGroupName($group) {
$groups = $this->getConfig('groups');
$spec = idx($groups, $group, array());

File Metadata

Mime Type
text/plain
Expires
Tue, Mar 18, 8:04 PM (4 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7710325
Default Alt Text
D8408.id19964.diff (2 KB)

Event Timeline