1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 08:52:39 +01:00

Add a "Diviner" application with documentation links

Summary:
See D3572.

  - Make "Diviner" show up on `/applications/`.
  - Give it a landing page with links to documentation.

I have a parital port of Diviner proper into Phabricator in a branch, but it's a big chunk of work away from being landable.

Test Plan: Viewed `/applications/`, saw Diviner, clicked it, got documentation links.

Reviewers: vrana, btrahan

Reviewed By: vrana

CC: aran

Differential Revision: https://secure.phabricator.com/D3580
This commit is contained in:
epriestley 2012-10-01 12:56:51 -07:00
parent f817d81b12
commit 60f7534e3e
3 changed files with 101 additions and 2 deletions

View file

@ -412,6 +412,7 @@ phutil_register_library_map(array(
'DiffusionTagListView' => 'applications/diffusion/view/DiffusionTagListView.php', 'DiffusionTagListView' => 'applications/diffusion/view/DiffusionTagListView.php',
'DiffusionURITestCase' => 'applications/diffusion/request/__tests__/DiffusionURITestCase.php', 'DiffusionURITestCase' => 'applications/diffusion/request/__tests__/DiffusionURITestCase.php',
'DiffusionView' => 'applications/diffusion/view/DiffusionView.php', 'DiffusionView' => 'applications/diffusion/view/DiffusionView.php',
'DivinerListController' => 'applications/diviner/controller/DivinerListController.php',
'DrydockAllocator' => 'applications/drydock/allocator/DrydockAllocator.php', 'DrydockAllocator' => 'applications/drydock/allocator/DrydockAllocator.php',
'DrydockAllocatorWorker' => 'applications/drydock/allocator/DrydockAllocatorWorker.php', 'DrydockAllocatorWorker' => 'applications/drydock/allocator/DrydockAllocatorWorker.php',
'DrydockApacheWebrootBlueprint' => 'applications/drydock/blueprint/webroot/DrydockApacheWebrootBlueprint.php', 'DrydockApacheWebrootBlueprint' => 'applications/drydock/blueprint/webroot/DrydockApacheWebrootBlueprint.php',
@ -1594,6 +1595,7 @@ phutil_register_library_map(array(
'DiffusionTagListView' => 'DiffusionView', 'DiffusionTagListView' => 'DiffusionView',
'DiffusionURITestCase' => 'ArcanistPhutilTestCase', 'DiffusionURITestCase' => 'ArcanistPhutilTestCase',
'DiffusionView' => 'AphrontView', 'DiffusionView' => 'AphrontView',
'DivinerListController' => 'PhabricatorController',
'DrydockAllocatorWorker' => 'PhabricatorWorker', 'DrydockAllocatorWorker' => 'PhabricatorWorker',
'DrydockApacheWebrootBlueprint' => 'DrydockBlueprint', 'DrydockApacheWebrootBlueprint' => 'DrydockBlueprint',
'DrydockApacheWebrootInterface' => 'DrydockWebrootInterface', 'DrydockApacheWebrootInterface' => 'DrydockWebrootInterface',

View file

@ -18,8 +18,26 @@
final class PhabricatorApplicationDiviner extends PhabricatorApplication { final class PhabricatorApplicationDiviner extends PhabricatorApplication {
public function shouldAppearInLaunchView() { public function getBaseURI() {
return false; return '/diviner/';
}
public function getAutospriteName() {
return 'diviner';
}
public function getShortDescription() {
return 'Documentation';
}
public function getTitleGlyph() {
return "\xE2\x97\x89";
}
public function getRoutes() {
return array(
'/diviner/' => 'DivinerListController',
);
} }
public function buildMainMenuItems( public function buildMainMenuItems(

View file

@ -0,0 +1,79 @@
<?php
/*
* Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
final class DivinerListController extends PhabricatorController {
public function processRequest() {
// TODO: Temporary implementation until Diviner is up and running inside
// Phabricator.
$links = array(
'http://www.phabricator.com/docs/phabricator/' => array(
'name' => 'Phabricator Ducks',
'flavor' => 'Oops, that should say "Docs".',
),
'http://www.phabricator.com/docs/arcanist/' => array(
'name' => 'Arcanist Docs',
'flavor' => 'Words have never been so finely crafted.',
),
'http://www.phabricator.com/docs/libphutil/' => array(
'name' => 'libphutil Docs',
'flavor' => 'Soothing prose; seductive poetry.',
),
'http://www.phabricator.com/docs/javelin/' => array(
'name' => 'Javelin Docs',
'flavor' => 'O, what noble scribe hath penned these words?',
),
);
require_celerity_resource('phabricator-directory-css');
$out = array();
foreach ($links as $href => $link) {
$name = $link['name'];
$flavor = $link['flavor'];
$link = phutil_render_tag(
'a',
array(
'href' => $href,
'target' => '_blank',
),
phutil_escape_html($name));
$out[] =
'<div class="aphront-directory-item">'.
'<h1>'.$link.'</h1>'.
'<p>'.phutil_escape_html($flavor).'</p>'.
'</div>';
}
$out =
'<div class="aphront-directory-list">'.
implode("\n", $out).
'</div>';
return $this->buildApplicationPage(
$out,
array(
'device' => true,
'title' => 'Documentation',
));
}
}