mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-23 07:12:41 +01:00
Restore flavor text to applications
Summary: D3581 removed some flavor text. Allow applications to provide flavor text instead of status information if they so desire. Test Plan: {F20325} Reviewers: vrana, btrahan Reviewed By: btrahan CC: aran, chad Differential Revision: https://secure.phabricator.com/D3608
This commit is contained in:
parent
6ee5370a95
commit
270256d336
13 changed files with 80 additions and 8 deletions
|
@ -2298,7 +2298,7 @@ celerity_register_resource_map(array(
|
||||||
),
|
),
|
||||||
'phabricator-application-launch-view-css' =>
|
'phabricator-application-launch-view-css' =>
|
||||||
array(
|
array(
|
||||||
'uri' => '/res/effb87ee/rsrc/css/application/base/phabricator-application-launch-view.css',
|
'uri' => '/res/51aa93f4/rsrc/css/application/base/phabricator-application-launch-view.css',
|
||||||
'type' => 'css',
|
'type' => 'css',
|
||||||
'requires' =>
|
'requires' =>
|
||||||
array(
|
array(
|
||||||
|
|
|
@ -108,11 +108,33 @@ abstract class PhabricatorApplication {
|
||||||
/* -( UI Integration )----------------------------------------------------- */
|
/* -( UI Integration )----------------------------------------------------- */
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Render status elements (like "3 Waiting Reviews") for application list
|
||||||
|
* views. These provide a way to alert users to new or pending action items
|
||||||
|
* in applications.
|
||||||
|
*
|
||||||
|
* @param PhabricatorUser Viewing user.
|
||||||
|
* @return list<PhabricatorApplicationStatusView> Application status elements.
|
||||||
|
* @task ui
|
||||||
|
*/
|
||||||
public function loadStatus(PhabricatorUser $user) {
|
public function loadStatus(PhabricatorUser $user) {
|
||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* You can provide an optional piece of flavor text for the application. This
|
||||||
|
* is currently rendered in application launch views if the application has no
|
||||||
|
* status elements.
|
||||||
|
*
|
||||||
|
* @return string|null Flavor text.
|
||||||
|
* @task ui
|
||||||
|
*/
|
||||||
|
public function getFlavorText() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Build items for the main menu.
|
* Build items for the main menu.
|
||||||
*
|
*
|
||||||
|
@ -120,7 +142,7 @@ abstract class PhabricatorApplication {
|
||||||
* @param AphrontController The current controller. May be null for special
|
* @param AphrontController The current controller. May be null for special
|
||||||
* pages like 404, exception handlers, etc.
|
* pages like 404, exception handlers, etc.
|
||||||
* @return list<PhabricatorMainMenuIconView> List of menu items.
|
* @return list<PhabricatorMainMenuIconView> List of menu items.
|
||||||
* @task UI
|
* @task ui
|
||||||
*/
|
*/
|
||||||
public function buildMainMenuItems(
|
public function buildMainMenuItems(
|
||||||
PhabricatorUser $user,
|
PhabricatorUser $user,
|
||||||
|
|
|
@ -34,6 +34,10 @@ final class PhabricatorApplicationCountdown extends PhabricatorApplication {
|
||||||
return "\xE2\x9A\xB2";
|
return "\xE2\x9A\xB2";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getFlavorText() {
|
||||||
|
return pht('Utilize the full capabilities of your ALU.');
|
||||||
|
}
|
||||||
|
|
||||||
public function getRoutes() {
|
public function getRoutes() {
|
||||||
return array(
|
return array(
|
||||||
'/countdown/' => array(
|
'/countdown/' => array(
|
||||||
|
|
|
@ -34,6 +34,10 @@ final class PhabricatorApplicationFiles extends PhabricatorApplication {
|
||||||
return "\xE2\x87\xAA";
|
return "\xE2\x87\xAA";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getFlavorText() {
|
||||||
|
return pht('Blob store for Pokemon pictures.');
|
||||||
|
}
|
||||||
|
|
||||||
public function getRoutes() {
|
public function getRoutes() {
|
||||||
return array(
|
return array(
|
||||||
'/F(?P<id>\d+)' => 'PhabricatorFileShortcutController',
|
'/F(?P<id>\d+)' => 'PhabricatorFileShortcutController',
|
||||||
|
|
|
@ -38,6 +38,10 @@ final class PhabricatorApplicationHerald extends PhabricatorApplication {
|
||||||
return PhabricatorEnv::getDoclink('article/Herald_User_Guide.html');
|
return PhabricatorEnv::getDoclink('article/Herald_User_Guide.html');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getFlavorText() {
|
||||||
|
return pht('Watch for danger!');
|
||||||
|
}
|
||||||
|
|
||||||
public function getRoutes() {
|
public function getRoutes() {
|
||||||
return array(
|
return array(
|
||||||
'/herald/' => array(
|
'/herald/' => array(
|
||||||
|
|
|
@ -58,14 +58,26 @@ final class PhabricatorApplicationLaunchView extends AphrontView {
|
||||||
|
|
||||||
|
|
||||||
$count = 0;
|
$count = 0;
|
||||||
if ($this->status) {
|
|
||||||
$content[] = '<span class="phabricator-application-status-block">';
|
$content[] = '<span class="phabricator-application-status-block">';
|
||||||
|
|
||||||
|
if ($this->status) {
|
||||||
foreach ($this->status as $status) {
|
foreach ($this->status as $status) {
|
||||||
$count += $status->getCount();
|
$count += $status->getCount();
|
||||||
$content[] = $status;
|
$content[] = $status;
|
||||||
}
|
}
|
||||||
$content[] = '</span>';
|
} else {
|
||||||
|
$flavor = $application->getFlavorText();
|
||||||
|
if ($flavor !== null) {
|
||||||
|
$content[] = phutil_render_tag(
|
||||||
|
'span',
|
||||||
|
array(
|
||||||
|
'class' => 'phabricator-application-flavor-text',
|
||||||
|
),
|
||||||
|
phutil_escape_html($flavor));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$content[] = '</span>';
|
||||||
|
|
||||||
if ($count) {
|
if ($count) {
|
||||||
$content[] = phutil_render_tag(
|
$content[] = phutil_render_tag(
|
||||||
|
@ -76,7 +88,6 @@ final class PhabricatorApplicationLaunchView extends AphrontView {
|
||||||
phutil_escape_html($count));
|
phutil_escape_html($count));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$classes = array();
|
$classes = array();
|
||||||
$classes[] = 'phabricator-application-launch-icon';
|
$classes[] = 'phabricator-application-launch-icon';
|
||||||
$styles = array();
|
$styles = array();
|
||||||
|
|
|
@ -30,6 +30,10 @@ final class PhabricatorApplicationMetaMTA extends PhabricatorApplication {
|
||||||
return 'mail';
|
return 'mail';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getFlavorText() {
|
||||||
|
return pht('Yo dawg, we heard you like MTAs.');
|
||||||
|
}
|
||||||
|
|
||||||
public function getRoutes() {
|
public function getRoutes() {
|
||||||
return array(
|
return array(
|
||||||
$this->getBaseURI() => array(
|
$this->getBaseURI() => array(
|
||||||
|
|
|
@ -38,6 +38,10 @@ final class PhabricatorApplicationOwners extends PhabricatorApplication {
|
||||||
return PhabricatorEnv::getDoclink('article/Owners_Tool_User_Guide.html');
|
return PhabricatorEnv::getDoclink('article/Owners_Tool_User_Guide.html');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getFlavorText() {
|
||||||
|
return pht('Adopt today!');
|
||||||
|
}
|
||||||
|
|
||||||
public function getRoutes() {
|
public function getRoutes() {
|
||||||
return array(
|
return array(
|
||||||
'/owners/' => array(
|
'/owners/' => array(
|
||||||
|
|
|
@ -34,6 +34,10 @@ final class PhabricatorApplicationPeople extends PhabricatorApplication {
|
||||||
return 'people';
|
return 'people';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getFlavorText() {
|
||||||
|
return pht('Sort of a social utility.');
|
||||||
|
}
|
||||||
|
|
||||||
public function getRoutes() {
|
public function getRoutes() {
|
||||||
return array(
|
return array(
|
||||||
'/people/' => array(
|
'/people/' => array(
|
||||||
|
|
|
@ -34,6 +34,10 @@ final class PhabricatorApplicationProject extends PhabricatorApplication {
|
||||||
return 'projects';
|
return 'projects';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getFlavorText() {
|
||||||
|
return pht('Group stuff into big piles.');
|
||||||
|
}
|
||||||
|
|
||||||
public function getRoutes() {
|
public function getRoutes() {
|
||||||
return array(
|
return array(
|
||||||
'/project/' => array(
|
'/project/' => array(
|
||||||
|
|
|
@ -38,6 +38,9 @@ final class PhabricatorApplicationSlowvote extends PhabricatorApplication {
|
||||||
return PhabricatorEnv::getDoclink('article/Slowvote_User_Guide.html');
|
return PhabricatorEnv::getDoclink('article/Slowvote_User_Guide.html');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getFlavorText() {
|
||||||
|
return pht('Design by committee.');
|
||||||
|
}
|
||||||
|
|
||||||
public function getRoutes() {
|
public function getRoutes() {
|
||||||
return array(
|
return array(
|
||||||
|
|
|
@ -34,6 +34,10 @@ final class PhabricatorApplicationUIExamples extends PhabricatorApplication {
|
||||||
return "\xE2\x8F\x9A";
|
return "\xE2\x8F\x9A";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getFlavorText() {
|
||||||
|
return pht('A gallery of modern art.');
|
||||||
|
}
|
||||||
|
|
||||||
public function getRoutes() {
|
public function getRoutes() {
|
||||||
return array(
|
return array(
|
||||||
'/uiexample/' => array(
|
'/uiexample/' => array(
|
||||||
|
|
|
@ -30,9 +30,9 @@
|
||||||
|
|
||||||
a.phabricator-application-launch-container {
|
a.phabricator-application-launch-container {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 210px;
|
width: 200px;
|
||||||
min-height: 90px;
|
min-height: 90px;
|
||||||
padding: 5px 15px 5px 80px;
|
padding: 5px 15px 5px 90px;
|
||||||
margin: 3px 6px;
|
margin: 3px 6px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
@ -107,14 +107,18 @@ a.phabricator-application-launch-container:hover {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.phabricator-application-flavor-text,
|
||||||
.phabricator-application-status {
|
.phabricator-application-status {
|
||||||
float: left;
|
float: left;
|
||||||
display: block;
|
display: block;
|
||||||
position: relative;
|
position: relative;
|
||||||
font-size: 11px;
|
font-size: 11px;
|
||||||
|
color: #666666;
|
||||||
|
}
|
||||||
|
|
||||||
|
.phabricator-application-status {
|
||||||
height: 20px;
|
height: 20px;
|
||||||
padding-left: 22px;
|
padding-left: 22px;
|
||||||
color: #666666;
|
|
||||||
|
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-size: 16px auto;
|
background-size: 16px auto;
|
||||||
|
|
Loading…
Reference in a new issue