@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Minor improvements to Diviner layout

Summary:
- Render functions as `func()` for consistency/clarity.
- Sort articles first.
- Sort case insensitively.
- Label the "no group" symbols.

Test Plan: Regenerated and examined docs.

Reviewers: btrahan, chad

Reviewed By: chad

CC: aran

Differential Revision: https://secure.phabricator.com/D8480

+22 -3
+5 -1
src/applications/diviner/controller/DivinerBookController.php
··· 46 46 ->setViewer($viewer) 47 47 ->withBookPHIDs(array($book->getPHID())) 48 48 ->execute(); 49 + 49 50 $atoms = msort($atoms, 'getSortKey'); 50 51 51 52 $group_spec = $book->getConfig('groups'); ··· 64 65 $out = array(); 65 66 foreach ($groups as $group => $atoms) { 66 67 $group_name = $book->getGroupName($group); 68 + if (!strlen($group_name)) { 69 + $group_name = pht('Free Radicals'); 70 + } 67 71 $section = id(new DivinerSectionView()) 68 - ->setHeader($group_name); 72 + ->setHeader($group_name); 69 73 $section->addContent($this->renderAtomList($atoms)); 70 74 $out[] = $section; 71 75 }
+11 -1
src/applications/diviner/controller/DivinerController.php
··· 29 29 30 30 $list = array(); 31 31 foreach ($symbols as $symbol) { 32 + 33 + switch ($symbol->getType()) { 34 + case DivinerAtom::TYPE_FUNCTION: 35 + $title = $symbol->getTitle().'()'; 36 + break; 37 + default: 38 + $title = $symbol->getTitle(); 39 + break; 40 + } 41 + 32 42 $item = id(new DivinerBookItemView()) 33 - ->setTitle($symbol->getTitle()) 43 + ->setTitle($title) 34 44 ->setHref($symbol->getURI()) 35 45 ->setSubtitle($symbol->getSummary()) 36 46 ->setType(DivinerAtom::getAtomTypeNameString(
+6 -1
src/applications/diviner/storage/DivinerLiveSymbol.php
··· 74 74 } 75 75 76 76 public function getSortKey() { 77 - return $this->getTitle(); 77 + // Sort articles before other types of content. Then, sort atoms in a 78 + // case-insensitive way. 79 + return sprintf( 80 + '%c:%s', 81 + ($this->getType() == DivinerAtom::TYPE_ARTICLE ? '0' : '1'), 82 + phutil_utf8_strtolower($this->getTitle())); 78 83 } 79 84 80 85 public function save() {