@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.

Basic NUX blank states

Summary: Implement in Badges

Test Plan:
Test with nux=true.

{F1033431}

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: johnny-bit, Korvin

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

+150 -8
+2
resources/celerity/map.php
··· 123 123 'rsrc/css/phui/phui-action-list.css' => 'c5eba19d', 124 124 'rsrc/css/phui/phui-action-panel.css' => '91c7b835', 125 125 'rsrc/css/phui/phui-badge.css' => 'f25c3476', 126 + 'rsrc/css/phui/phui-big-info-view.css' => '86cf0dd3', 126 127 'rsrc/css/phui/phui-box.css' => 'a5bb366d', 127 128 'rsrc/css/phui/phui-button.css' => '16020a60', 128 129 'rsrc/css/phui/phui-crumbs-view.css' => '414406b5', ··· 791 792 'phriction-document-css' => 'd1861e06', 792 793 'phui-action-panel-css' => '91c7b835', 793 794 'phui-badge-view-css' => 'f25c3476', 795 + 'phui-big-info-view-css' => '86cf0dd3', 794 796 'phui-box-css' => 'a5bb366d', 795 797 'phui-button-css' => '16020a60', 796 798 'phui-calendar-css' => 'ccabe893',
+2
src/__phutil_library_map__.php
··· 1444 1444 'PHUIBadgeExample' => 'applications/uiexample/examples/PHUIBadgeExample.php', 1445 1445 'PHUIBadgeMiniView' => 'view/phui/PHUIBadgeMiniView.php', 1446 1446 'PHUIBadgeView' => 'view/phui/PHUIBadgeView.php', 1447 + 'PHUIBigInfoView' => 'view/phui/PHUIBigInfoView.php', 1447 1448 'PHUIBoxExample' => 'applications/uiexample/examples/PHUIBoxExample.php', 1448 1449 'PHUIBoxView' => 'view/phui/PHUIBoxView.php', 1449 1450 'PHUIButtonBarExample' => 'applications/uiexample/examples/PHUIButtonBarExample.php', ··· 5503 5504 'PHUIBadgeExample' => 'PhabricatorUIExample', 5504 5505 'PHUIBadgeMiniView' => 'AphrontTagView', 5505 5506 'PHUIBadgeView' => 'AphrontTagView', 5507 + 'PHUIBigInfoView' => 'AphrontTagView', 5506 5508 'PHUIBoxExample' => 'PhabricatorUIExample', 5507 5509 'PHUIBoxView' => 'AphrontTagView', 5508 5510 'PHUIButtonBarExample' => 'PhabricatorUIExample',
+20
src/applications/badges/query/PhabricatorBadgesSearchEngine.php
··· 140 140 141 141 } 142 142 143 + protected function getNewUserBody() { 144 + $create_button = id(new PHUIButtonView()) 145 + ->setTag('a') 146 + ->setText(pht('Create a Badge')) 147 + ->setHref('/badges/create/') 148 + ->setColor(PHUIButtonView::GREEN); 149 + 150 + $icon = $this->getApplication()->getFontIcon(); 151 + $app_name = $this->getApplication()->getName(); 152 + $view = id(new PHUIBigInfoView()) 153 + ->setIcon($icon) 154 + ->setTitle(pht('Welcome to %s', $app_name)) 155 + ->setDescription( 156 + pht('Badges let you award and distinguish special users '. 157 + 'throughout your instance.')) 158 + ->addAction($create_button); 159 + 160 + return $view; 161 + } 162 + 143 163 }
+2 -8
src/applications/search/engine/PhabricatorApplicationSearchEngine.php
··· 1355 1355 } 1356 1356 1357 1357 final public function renderNewUserView() { 1358 - $head = $this->getNewUserHeader(); 1359 1358 $body = $this->getNewUserBody(); 1360 1359 1361 - if (!strlen($head) && !strlen($body)) { 1360 + if (!$body) { 1362 1361 return null; 1363 1362 } 1364 1363 1365 - $viewer = $this->requireViewer(); 1366 - 1367 - return id(new PHUIBoxView()) 1368 - ->addMargin(PHUI::MARGIN_LARGE) 1369 - ->appendChild($head) 1370 - ->appendChild(new PHUIRemarkupView($viewer, $body)); 1364 + return $body; 1371 1365 } 1372 1366 1373 1367 protected function getNewUserHeader() {
+95
src/view/phui/PHUIBigInfoView.php
··· 1 + <?php 2 + 3 + final class PHUIBigInfoView extends AphrontTagView { 4 + 5 + private $icon; 6 + private $title; 7 + private $description; 8 + private $actions = array(); 9 + 10 + public function setIcon($icon) { 11 + $this->icon = $icon; 12 + return $this; 13 + } 14 + 15 + public function setTitle($title) { 16 + $this->title = $title; 17 + return $this; 18 + } 19 + 20 + public function setDescription($description) { 21 + $this->description = $description; 22 + return $this; 23 + } 24 + 25 + public function addAction(PHUIButtonView $button) { 26 + $this->actions[] = $button; 27 + return $this; 28 + } 29 + 30 + protected function getTagName() { 31 + return 'div'; 32 + } 33 + 34 + protected function getTagAttributes() { 35 + $classes = array(); 36 + $classes[] = 'phui-big-info-view'; 37 + 38 + return array( 39 + 'class' => implode(' ', $classes), 40 + ); 41 + } 42 + 43 + protected function getTagContent() { 44 + require_celerity_resource('phui-big-info-view-css'); 45 + 46 + $icon = id(new PHUIIconView()) 47 + ->setIconFont($this->icon) 48 + ->addClass('phui-big-info-icon'); 49 + 50 + $icon = phutil_tag( 51 + 'div', 52 + array( 53 + 'class' => 'phui-big-info-icon-container', 54 + ), 55 + $icon); 56 + 57 + $title = phutil_tag( 58 + 'div', 59 + array( 60 + 'class' => 'phui-big-info-title', 61 + ), 62 + $this->title); 63 + 64 + $description = phutil_tag( 65 + 'div', 66 + array( 67 + 'class' => 'phui-big-info-description', 68 + ), 69 + $this->description); 70 + 71 + $buttons = array(); 72 + foreach ($this->actions as $button) { 73 + $buttons[] = phutil_tag( 74 + 'div', 75 + array( 76 + 'class' => 'phui-big-info-button', 77 + ), 78 + $button); 79 + } 80 + 81 + $actions = null; 82 + if ($buttons) { 83 + $actions = phutil_tag( 84 + 'div', 85 + array( 86 + 'class' => 'phui-big-info-actions', 87 + ), 88 + $buttons); 89 + } 90 + 91 + return array($icon, $title, $description, $actions); 92 + 93 + } 94 + 95 + }
+29
webroot/rsrc/css/phui/phui-big-info-view.css
··· 1 + /** 2 + * @provides phui-big-info-view-css 3 + */ 4 + 5 + .phui-big-info-view { 6 + padding: 64px 32px; 7 + margin: 16px 4px; 8 + background-color: {$sh-greybackground}; 9 + text-align: center; 10 + } 11 + 12 + .phui-big-info-icon { 13 + font-size: 48px; 14 + } 15 + 16 + .phui-big-info-title { 17 + font-size: 18px; 18 + padding: 4px; 19 + font-weight: bold; 20 + } 21 + 22 + .phui-big-info-description { 23 + font-size: {$biggerfontsize}; 24 + padding: 4px; 25 + } 26 + 27 + .phui-big-info-actions { 28 + padding: 24px 0 0; 29 + }