mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-22 23:02:42 +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' =>
|
||||
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',
|
||||
'requires' =>
|
||||
array(
|
||||
|
|
|
@ -108,11 +108,33 @@ abstract class PhabricatorApplication {
|
|||
/* -( 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) {
|
||||
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.
|
||||
*
|
||||
|
@ -120,7 +142,7 @@ abstract class PhabricatorApplication {
|
|||
* @param AphrontController The current controller. May be null for special
|
||||
* pages like 404, exception handlers, etc.
|
||||
* @return list<PhabricatorMainMenuIconView> List of menu items.
|
||||
* @task UI
|
||||
* @task ui
|
||||
*/
|
||||
public function buildMainMenuItems(
|
||||
PhabricatorUser $user,
|
||||
|
|
|
@ -34,6 +34,10 @@ final class PhabricatorApplicationCountdown extends PhabricatorApplication {
|
|||
return "\xE2\x9A\xB2";
|
||||
}
|
||||
|
||||
public function getFlavorText() {
|
||||
return pht('Utilize the full capabilities of your ALU.');
|
||||
}
|
||||
|
||||
public function getRoutes() {
|
||||
return array(
|
||||
'/countdown/' => array(
|
||||
|
|
|
@ -34,6 +34,10 @@ final class PhabricatorApplicationFiles extends PhabricatorApplication {
|
|||
return "\xE2\x87\xAA";
|
||||
}
|
||||
|
||||
public function getFlavorText() {
|
||||
return pht('Blob store for Pokemon pictures.');
|
||||
}
|
||||
|
||||
public function getRoutes() {
|
||||
return array(
|
||||
'/F(?P<id>\d+)' => 'PhabricatorFileShortcutController',
|
||||
|
|
|
@ -38,6 +38,10 @@ final class PhabricatorApplicationHerald extends PhabricatorApplication {
|
|||
return PhabricatorEnv::getDoclink('article/Herald_User_Guide.html');
|
||||
}
|
||||
|
||||
public function getFlavorText() {
|
||||
return pht('Watch for danger!');
|
||||
}
|
||||
|
||||
public function getRoutes() {
|
||||
return array(
|
||||
'/herald/' => array(
|
||||
|
|
|
@ -58,14 +58,26 @@ final class PhabricatorApplicationLaunchView extends AphrontView {
|
|||
|
||||
|
||||
$count = 0;
|
||||
if ($this->status) {
|
||||
$content[] = '<span class="phabricator-application-status-block">';
|
||||
|
||||
if ($this->status) {
|
||||
foreach ($this->status as $status) {
|
||||
$count += $status->getCount();
|
||||
$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) {
|
||||
$content[] = phutil_render_tag(
|
||||
|
@ -76,7 +88,6 @@ final class PhabricatorApplicationLaunchView extends AphrontView {
|
|||
phutil_escape_html($count));
|
||||
}
|
||||
|
||||
|
||||
$classes = array();
|
||||
$classes[] = 'phabricator-application-launch-icon';
|
||||
$styles = array();
|
||||
|
|
|
@ -30,6 +30,10 @@ final class PhabricatorApplicationMetaMTA extends PhabricatorApplication {
|
|||
return 'mail';
|
||||
}
|
||||
|
||||
public function getFlavorText() {
|
||||
return pht('Yo dawg, we heard you like MTAs.');
|
||||
}
|
||||
|
||||
public function getRoutes() {
|
||||
return array(
|
||||
$this->getBaseURI() => array(
|
||||
|
|
|
@ -38,6 +38,10 @@ final class PhabricatorApplicationOwners extends PhabricatorApplication {
|
|||
return PhabricatorEnv::getDoclink('article/Owners_Tool_User_Guide.html');
|
||||
}
|
||||
|
||||
public function getFlavorText() {
|
||||
return pht('Adopt today!');
|
||||
}
|
||||
|
||||
public function getRoutes() {
|
||||
return array(
|
||||
'/owners/' => array(
|
||||
|
|
|
@ -34,6 +34,10 @@ final class PhabricatorApplicationPeople extends PhabricatorApplication {
|
|||
return 'people';
|
||||
}
|
||||
|
||||
public function getFlavorText() {
|
||||
return pht('Sort of a social utility.');
|
||||
}
|
||||
|
||||
public function getRoutes() {
|
||||
return array(
|
||||
'/people/' => array(
|
||||
|
|
|
@ -34,6 +34,10 @@ final class PhabricatorApplicationProject extends PhabricatorApplication {
|
|||
return 'projects';
|
||||
}
|
||||
|
||||
public function getFlavorText() {
|
||||
return pht('Group stuff into big piles.');
|
||||
}
|
||||
|
||||
public function getRoutes() {
|
||||
return array(
|
||||
'/project/' => array(
|
||||
|
|
|
@ -38,6 +38,9 @@ final class PhabricatorApplicationSlowvote extends PhabricatorApplication {
|
|||
return PhabricatorEnv::getDoclink('article/Slowvote_User_Guide.html');
|
||||
}
|
||||
|
||||
public function getFlavorText() {
|
||||
return pht('Design by committee.');
|
||||
}
|
||||
|
||||
public function getRoutes() {
|
||||
return array(
|
||||
|
|
|
@ -34,6 +34,10 @@ final class PhabricatorApplicationUIExamples extends PhabricatorApplication {
|
|||
return "\xE2\x8F\x9A";
|
||||
}
|
||||
|
||||
public function getFlavorText() {
|
||||
return pht('A gallery of modern art.');
|
||||
}
|
||||
|
||||
public function getRoutes() {
|
||||
return array(
|
||||
'/uiexample/' => array(
|
||||
|
|
|
@ -30,9 +30,9 @@
|
|||
|
||||
a.phabricator-application-launch-container {
|
||||
display: inline-block;
|
||||
width: 210px;
|
||||
width: 200px;
|
||||
min-height: 90px;
|
||||
padding: 5px 15px 5px 80px;
|
||||
padding: 5px 15px 5px 90px;
|
||||
margin: 3px 6px;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
|
@ -107,14 +107,18 @@ a.phabricator-application-launch-container:hover {
|
|||
display: block;
|
||||
}
|
||||
|
||||
.phabricator-application-flavor-text,
|
||||
.phabricator-application-status {
|
||||
float: left;
|
||||
display: block;
|
||||
position: relative;
|
||||
font-size: 11px;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.phabricator-application-status {
|
||||
height: 20px;
|
||||
padding-left: 22px;
|
||||
color: #666666;
|
||||
|
||||
background-repeat: no-repeat;
|
||||
background-size: 16px auto;
|
||||
|
|
Loading…
Reference in a new issue