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

Add a meta-application

Summary:
- Adds a new "Applications" application.
- Builds an application list via application config instead of via hard-coding, so we can move toward better concepts of installing/uninstalling applications, etc.
- Applications indicate that they need attention with notice counts and brief status messages rathern than 50 giant tables of all sorts of app data.

I want to try replacing the home screen with this screen, pretty much. Not sure if this is totally crazy or not. What does everyone else think?

Test Plan: Will add screenshots.

Reviewers: btrahan, chad, vrana, alanh

Reviewed By: vrana

CC: aran, davidreuss, champo

Maniphest Tasks: T1569

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

+871 -5
+86
src/__celerity_resource_map__.php
··· 7 7 */ 8 8 9 9 celerity_register_resource_map(array( 10 + '/rsrc/image/app/app_audit.png' => 11 + array( 12 + 'hash' => '5f5b4a7c48fe921532bef4c986328bdc', 13 + 'uri' => '/res/5f5b4a7c/rsrc/image/app/app_audit.png', 14 + 'disk' => '/rsrc/image/app/app_audit.png', 15 + 'type' => 'png', 16 + ), 17 + '/rsrc/image/app/app_differential.png' => 18 + array( 19 + 'hash' => 'b2e42893b64791f8382f7f5a0350b44d', 20 + 'uri' => '/res/b2e42893/rsrc/image/app/app_differential.png', 21 + 'disk' => '/rsrc/image/app/app_differential.png', 22 + 'type' => 'png', 23 + ), 24 + '/rsrc/image/app/app_diffusion.png' => 25 + array( 26 + 'hash' => 'e9e4b1c380e19a2908730ad397ae5eca', 27 + 'uri' => '/res/e9e4b1c3/rsrc/image/app/app_diffusion.png', 28 + 'disk' => '/rsrc/image/app/app_diffusion.png', 29 + 'type' => 'png', 30 + ), 31 + '/rsrc/image/app/app_fact.png' => 32 + array( 33 + 'hash' => '8b4da94b07e2aad9f741beca9519df98', 34 + 'uri' => '/res/8b4da94b/rsrc/image/app/app_fact.png', 35 + 'disk' => '/rsrc/image/app/app_fact.png', 36 + 'type' => 'png', 37 + ), 38 + '/rsrc/image/app/app_flags.png' => 39 + array( 40 + 'hash' => 'e75e1047a6bc2ff428161d2130526367', 41 + 'uri' => '/res/e75e1047/rsrc/image/app/app_flags.png', 42 + 'disk' => '/rsrc/image/app/app_flags.png', 43 + 'type' => 'png', 44 + ), 45 + '/rsrc/image/app/app_maniphest.png' => 46 + array( 47 + 'hash' => '88b6a06029b1ce38d5e7a70c1d2ebd97', 48 + 'uri' => '/res/88b6a060/rsrc/image/app/app_maniphest.png', 49 + 'disk' => '/rsrc/image/app/app_maniphest.png', 50 + 'type' => 'png', 51 + ), 52 + '/rsrc/image/app/app_phriction.png' => 53 + array( 54 + 'hash' => '68f2387363a26c15653a39bd847157f3', 55 + 'uri' => '/res/68f23873/rsrc/image/app/app_phriction.png', 56 + 'disk' => '/rsrc/image/app/app_phriction.png', 57 + 'type' => 'png', 58 + ), 10 59 '/rsrc/image/apps.png' => 11 60 array( 12 61 'hash' => 'f7cb4abeb73245fea4098a02fd784653', 13 62 'uri' => '/res/f7cb4abe/rsrc/image/apps.png', 14 63 'disk' => '/rsrc/image/apps.png', 64 + 'type' => 'png', 65 + ), 66 + '/rsrc/image/appstatus_empty.png' => 67 + array( 68 + 'hash' => '2f8102e0a0f5a0980d87d4ab4ba8c8fd', 69 + 'uri' => '/res/2f8102e0/rsrc/image/appstatus_empty.png', 70 + 'disk' => '/rsrc/image/appstatus_empty.png', 71 + 'type' => 'png', 72 + ), 73 + '/rsrc/image/appstatus_info.png' => 74 + array( 75 + 'hash' => '407de6daf2edc4a8b68e2e369f4fc8cb', 76 + 'uri' => '/res/407de6da/rsrc/image/appstatus_info.png', 77 + 'disk' => '/rsrc/image/appstatus_info.png', 78 + 'type' => 'png', 79 + ), 80 + '/rsrc/image/appstatus_needs.png' => 81 + array( 82 + 'hash' => '2c1e193bc786ca4fca0b851ed9cd3d92', 83 + 'uri' => '/res/2c1e193b/rsrc/image/appstatus_needs.png', 84 + 'disk' => '/rsrc/image/appstatus_needs.png', 85 + 'type' => 'png', 86 + ), 87 + '/rsrc/image/appstatus_okay.png' => 88 + array( 89 + 'hash' => 'd00e683ee1c61d0ccced1200775cdbb5', 90 + 'uri' => '/res/d00e683e/rsrc/image/appstatus_okay.png', 91 + 'disk' => '/rsrc/image/appstatus_okay.png', 15 92 'type' => 'png', 16 93 ), 17 94 '/rsrc/image/avatar.png' => ··· 2141 2218 array( 2142 2219 ), 2143 2220 'disk' => '/rsrc/css/application/directory/phabricator-app-buttons.css', 2221 + ), 2222 + 'phabricator-application-launch-view-css' => 2223 + array( 2224 + 'uri' => '/res/e157830a/rsrc/css/application/base/phabricator-application-launch-view.css', 2225 + 'type' => 'css', 2226 + 'requires' => 2227 + array( 2228 + ), 2229 + 'disk' => '/rsrc/css/application/base/phabricator-application-launch-view.css', 2144 2230 ), 2145 2231 'phabricator-chatlog-css' => 2146 2232 array(
+18
src/__phutil_library_map__.php
··· 536 536 'Phabricator404Controller' => 'applications/base/controller/Phabricator404Controller.php', 537 537 'PhabricatorAccessLog' => 'infrastructure/PhabricatorAccessLog.php', 538 538 'PhabricatorApplication' => 'applications/base/PhabricatorApplication.php', 539 + 'PhabricatorApplicationApplications' => 'applications/meta/application/PhabricatorApplicationApplications.php', 540 + 'PhabricatorApplicationAudit' => 'applications/audit/application/PhabricatorApplicationAudit.php', 539 541 'PhabricatorApplicationDifferential' => 'applications/differential/application/PhabricatorApplicationDifferential.php', 542 + 'PhabricatorApplicationDiffusion' => 'applications/diffusion/application/PhabricatorApplicationDiffusion.php', 540 543 'PhabricatorApplicationFact' => 'applications/fact/application/PhabricatorApplicationFact.php', 544 + 'PhabricatorApplicationFlags' => 'applications/flag/application/PhabricatorApplicationFlags.php', 545 + 'PhabricatorApplicationLaunchView' => 'applications/meta/view/PhabricatorApplicationLaunchView.php', 541 546 'PhabricatorApplicationManiphest' => 'applications/maniphest/application/PhabricatorApplicationManiphest.php', 547 + 'PhabricatorApplicationPhriction' => 'applications/phriction/application/PhabricatorApplicationPhriction.php', 548 + 'PhabricatorApplicationStatusView' => 'applications/meta/view/PhabricatorApplicationStatusView.php', 549 + 'PhabricatorApplicationsController' => 'applications/meta/controller/PhabricatorApplicationsController.php', 550 + 'PhabricatorApplicationsListController' => 'applications/meta/controller/PhabricatorApplicationsListController.php', 542 551 'PhabricatorAuditActionConstants' => 'applications/audit/constants/PhabricatorAuditActionConstants.php', 543 552 'PhabricatorAuditAddCommentController' => 'applications/audit/controller/PhabricatorAuditAddCommentController.php', 544 553 'PhabricatorAuditComment' => 'applications/audit/storage/PhabricatorAuditComment.php', ··· 1602 1611 'PackageDeleteMail' => 'PackageMail', 1603 1612 'PackageModifyMail' => 'PackageMail', 1604 1613 'Phabricator404Controller' => 'PhabricatorController', 1614 + 'PhabricatorApplicationApplications' => 'PhabricatorApplication', 1615 + 'PhabricatorApplicationAudit' => 'PhabricatorApplication', 1605 1616 'PhabricatorApplicationDifferential' => 'PhabricatorApplication', 1617 + 'PhabricatorApplicationDiffusion' => 'PhabricatorApplication', 1606 1618 'PhabricatorApplicationFact' => 'PhabricatorApplication', 1619 + 'PhabricatorApplicationFlags' => 'PhabricatorApplication', 1620 + 'PhabricatorApplicationLaunchView' => 'AphrontView', 1607 1621 'PhabricatorApplicationManiphest' => 'PhabricatorApplication', 1622 + 'PhabricatorApplicationPhriction' => 'PhabricatorApplication', 1623 + 'PhabricatorApplicationStatusView' => 'AphrontView', 1624 + 'PhabricatorApplicationsController' => 'PhabricatorController', 1625 + 'PhabricatorApplicationsListController' => 'PhabricatorApplicationsController', 1608 1626 'PhabricatorAuditAddCommentController' => 'PhabricatorAuditController', 1609 1627 'PhabricatorAuditComment' => 'PhabricatorAuditDAO', 1610 1628 'PhabricatorAuditCommitListView' => 'AphrontView',
+73
src/applications/audit/application/PhabricatorApplicationAudit.php
··· 1 + <?php 2 + 3 + /* 4 + * Copyright 2012 Facebook, Inc. 5 + * 6 + * Licensed under the Apache License, Version 2.0 (the "License"); 7 + * you may not use this file except in compliance with the License. 8 + * You may obtain a copy of the License at 9 + * 10 + * http://www.apache.org/licenses/LICENSE-2.0 11 + * 12 + * Unless required by applicable law or agreed to in writing, software 13 + * distributed under the License is distributed on an "AS IS" BASIS, 14 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 + * See the License for the specific language governing permissions and 16 + * limitations under the License. 17 + */ 18 + 19 + final class PhabricatorApplicationAudit extends PhabricatorApplication { 20 + 21 + public function getShortDescription() { 22 + return 'Audit Code'; 23 + } 24 + 25 + public function getBaseURI() { 26 + return '/audit/'; 27 + } 28 + 29 + 30 + public function getIconURI() { 31 + return celerity_get_resource_uri('/rsrc/image/app/app_audit.png'); 32 + } 33 + 34 + public function loadStatus(PhabricatorUser $user) { 35 + $status = array(); 36 + 37 + $phids = PhabricatorAuditCommentEditor::loadAuditPHIDsForUser($user); 38 + 39 + $audits = id(new PhabricatorAuditQuery()) 40 + ->withAuditorPHIDs($phids) 41 + ->withStatus(PhabricatorAuditQuery::STATUS_OPEN) 42 + ->withAwaitingUser($user) 43 + ->execute(); 44 + 45 + $count = count($audits); 46 + $type = $count 47 + ? PhabricatorApplicationStatusView::TYPE_INFO 48 + : PhabricatorApplicationStatusView::TYPE_EMPTY; 49 + $status[] = id(new PhabricatorApplicationStatusView()) 50 + ->setType($type) 51 + ->setText(pht('%d Commit(s) Awaiting Audit', $count)) 52 + ->setCount($count); 53 + 54 + 55 + $commits = id(new PhabricatorAuditCommitQuery()) 56 + ->withAuthorPHIDs($phids) 57 + ->withStatus(PhabricatorAuditQuery::STATUS_OPEN) 58 + ->execute(); 59 + 60 + $count = count($commits); 61 + $type = $count 62 + ? PhabricatorApplicationStatusView::TYPE_NEEDS_ATTENTION 63 + : PhabricatorApplicationStatusView::TYPE_EMPTY; 64 + $status[] = id(new PhabricatorApplicationStatusView()) 65 + ->setType($type) 66 + ->setText(pht('%d Problem Commit(s)', $count)) 67 + ->setCount($count); 68 + 69 + return $status; 70 + } 71 + 72 + } 73 +
+12
src/applications/base/PhabricatorApplication.php
··· 57 57 return PhabricatorUser::getDefaultProfileImageURI(); 58 58 } 59 59 60 + public function shouldAppearInLaunchView() { 61 + return true; 62 + } 63 + 60 64 61 65 /* -( URI Routing )-------------------------------------------------------- */ 62 66 ··· 70 74 71 75 72 76 public function getFactObjectsForAnalysis() { 77 + return array(); 78 + } 79 + 80 + 81 + /* -( Launch Integration )------------------------------------------------- */ 82 + 83 + 84 + public function loadStatus(PhabricatorUser $user) { 73 85 return array(); 74 86 } 75 87
+41 -5
src/applications/differential/application/PhabricatorApplicationDifferential.php
··· 18 18 19 19 final class PhabricatorApplicationDifferential extends PhabricatorApplication { 20 20 21 + public function getBaseURI() { 22 + return '/differential/'; 23 + } 24 + 25 + public function getShortDescription() { 26 + return 'Review Code'; 27 + } 28 + 29 + public function getIconURI() { 30 + return celerity_get_resource_uri('/rsrc/image/app/app_differential.png'); 31 + } 32 + 21 33 public function getFactObjectsForAnalysis() { 22 34 return array( 23 35 new DifferentialRevision(), 24 36 ); 25 37 } 26 38 27 - public function getBaseURI() { 28 - return '/differential/'; 29 - } 39 + public function loadStatus(PhabricatorUser $user) { 40 + $revisions = id(new DifferentialRevisionQuery()) 41 + ->withResponsibleUsers(array($user->getPHID())) 42 + ->withStatus(DifferentialRevisionQuery::STATUS_OPEN) 43 + ->execute(); 30 44 31 - public function getShortDescription() { 32 - return 'Code Review Application'; 45 + list($active, $waiting) = DifferentialRevisionQuery::splitResponsible( 46 + $revisions, 47 + $user->getPHID()); 48 + 49 + $status = array(); 50 + 51 + $active = count($active); 52 + $type = $active 53 + ? PhabricatorApplicationStatusView::TYPE_NEEDS_ATTENTION 54 + : PhabricatorApplicationStatusView::TYPE_EMPTY; 55 + $status[] = id(new PhabricatorApplicationStatusView()) 56 + ->setType($type) 57 + ->setText(pht('%d Review(s) Need Attention', $active)) 58 + ->setCount($active); 59 + 60 + $waiting = count($waiting); 61 + $type = $waiting 62 + ? PhabricatorApplicationStatusView::TYPE_INFO 63 + : PhabricatorApplicationStatusView::TYPE_EMPTY; 64 + $status[] = id(new PhabricatorApplicationStatusView()) 65 + ->setType($type) 66 + ->setText(pht('%d Review(s) Waiting on Others', $waiting)); 67 + 68 + return $status; 33 69 } 34 70 35 71 }
+34
src/applications/diffusion/application/PhabricatorApplicationDiffusion.php
··· 1 + <?php 2 + 3 + /* 4 + * Copyright 2012 Facebook, Inc. 5 + * 6 + * Licensed under the Apache License, Version 2.0 (the "License"); 7 + * you may not use this file except in compliance with the License. 8 + * You may obtain a copy of the License at 9 + * 10 + * http://www.apache.org/licenses/LICENSE-2.0 11 + * 12 + * Unless required by applicable law or agreed to in writing, software 13 + * distributed under the License is distributed on an "AS IS" BASIS, 14 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 + * See the License for the specific language governing permissions and 16 + * limitations under the License. 17 + */ 18 + 19 + final class PhabricatorApplicationDiffusion extends PhabricatorApplication { 20 + 21 + public function getShortDescription() { 22 + return 'Repository Browser'; 23 + } 24 + 25 + public function getBaseURI() { 26 + return '/diffusion/'; 27 + } 28 + 29 + public function getIconURI() { 30 + return celerity_get_resource_uri('/rsrc/image/app/app_diffusion.png'); 31 + } 32 + 33 + } 34 +
+12
src/applications/fact/application/PhabricatorApplicationFact.php
··· 18 18 19 19 final class PhabricatorApplicationFact extends PhabricatorApplication { 20 20 21 + public function getShortDescription() { 22 + return 'Analyze Data'; 23 + } 24 + 25 + public function getBaseURI() { 26 + return '/fact/'; 27 + } 28 + 29 + public function getIconURI() { 30 + return celerity_get_resource_uri('/rsrc/image/app/app_fact.png'); 31 + } 32 + 21 33 public function getRoutes() { 22 34 return array( 23 35 '/fact/' => array(
+53
src/applications/flag/application/PhabricatorApplicationFlags.php
··· 1 + <?php 2 + 3 + /* 4 + * Copyright 2012 Facebook, Inc. 5 + * 6 + * Licensed under the Apache License, Version 2.0 (the "License"); 7 + * you may not use this file except in compliance with the License. 8 + * You may obtain a copy of the License at 9 + * 10 + * http://www.apache.org/licenses/LICENSE-2.0 11 + * 12 + * Unless required by applicable law or agreed to in writing, software 13 + * distributed under the License is distributed on an "AS IS" BASIS, 14 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 + * See the License for the specific language governing permissions and 16 + * limitations under the License. 17 + */ 18 + 19 + final class PhabricatorApplicationFlags extends PhabricatorApplication { 20 + 21 + public function getShortDescription() { 22 + return 'Reminders'; 23 + } 24 + 25 + public function getBaseURI() { 26 + return '/flag/'; 27 + } 28 + 29 + public function getIconURI() { 30 + return celerity_get_resource_uri('/rsrc/image/app/app_flags.png'); 31 + } 32 + 33 + public function loadStatus(PhabricatorUser $user) { 34 + $status = array(); 35 + 36 + $flags = id(new PhabricatorFlagQuery()) 37 + ->withOwnerPHIDs(array($user->getPHID())) 38 + ->execute(); 39 + 40 + $count = count($flags); 41 + $type = $count 42 + ? PhabricatorApplicationStatusView::TYPE_INFO 43 + : PhabricatorApplicationStatusView::TYPE_EMPTY; 44 + $status[] = id(new PhabricatorApplicationStatusView()) 45 + ->setType($type) 46 + ->setText(pht('%d Flagged Object(s)', $count)) 47 + ->setCount($count); 48 + 49 + return $status; 50 + } 51 + 52 + } 53 +
+49
src/applications/maniphest/application/PhabricatorApplicationManiphest.php
··· 18 18 19 19 final class PhabricatorApplicationManiphest extends PhabricatorApplication { 20 20 21 + public function getShortDescription() { 22 + return 'Tasks and Bugs'; 23 + } 24 + 25 + public function getBaseURI() { 26 + return '/maniphest/'; 27 + } 28 + 21 29 public function isEnabled() { 22 30 return PhabricatorEnv::getEnvConfig('maniphest.enabled'); 23 31 } 24 32 33 + public function getIconURI() { 34 + return celerity_get_resource_uri('/rsrc/image/app/app_maniphest.png'); 35 + } 36 + 25 37 public function getFactObjectsForAnalysis() { 26 38 return array( 27 39 new ManiphestTask(), 28 40 ); 41 + } 42 + 43 + public function loadStatus(PhabricatorUser $user) { 44 + $status = array(); 45 + 46 + $query = id(new ManiphestTaskQuery()) 47 + ->withStatus(ManiphestTaskQuery::STATUS_OPEN) 48 + ->withPriority(ManiphestTaskPriority::PRIORITY_UNBREAK_NOW) 49 + ->setLimit(1) 50 + ->setCalculateRows(true); 51 + $query->execute(); 52 + 53 + $count = $query->getRowCount(); 54 + $type = $count 55 + ? PhabricatorApplicationStatusView::TYPE_NEEDS_ATTENTION 56 + : PhabricatorApplicationStatusView::TYPE_EMPTY; 57 + $status[] = id(new PhabricatorApplicationStatusView()) 58 + ->setType($type) 59 + ->setText(pht('%d Unbreak Now Task(s)!', $count)) 60 + ->setCount($count); 61 + 62 + $query = id(new ManiphestTaskQuery()) 63 + ->withStatus(ManiphestTaskQuery::STATUS_OPEN) 64 + ->withOwners(array($user->getPHID())) 65 + ->setLimit(1) 66 + ->setCalculateRows(true); 67 + $query->execute(); 68 + 69 + $count = $query->getRowCount(); 70 + $type = $count 71 + ? PhabricatorApplicationStatusView::TYPE_INFO 72 + : PhabricatorApplicationStatusView::TYPE_EMPTY; 73 + $status[] = id(new PhabricatorApplicationStatusView()) 74 + ->setType($type) 75 + ->setText(pht('%d Assigned Task(s)', $count)); 76 + 77 + return $status; 29 78 } 30 79 31 80 }
+42
src/applications/meta/application/PhabricatorApplicationApplications.php
··· 1 + <?php 2 + 3 + /* 4 + * Copyright 2012 Facebook, Inc. 5 + * 6 + * Licensed under the Apache License, Version 2.0 (the "License"); 7 + * you may not use this file except in compliance with the License. 8 + * You may obtain a copy of the License at 9 + * 10 + * http://www.apache.org/licenses/LICENSE-2.0 11 + * 12 + * Unless required by applicable law or agreed to in writing, software 13 + * distributed under the License is distributed on an "AS IS" BASIS, 14 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 + * See the License for the specific language governing permissions and 16 + * limitations under the License. 17 + */ 18 + 19 + final class PhabricatorApplicationApplications extends PhabricatorApplication { 20 + 21 + public function getBaseURI() { 22 + return '/applications/'; 23 + } 24 + 25 + public function getShortDescription() { 26 + return 'Manage Applications'; 27 + } 28 + 29 + public function getRoutes() { 30 + return array( 31 + '/applications/' => array( 32 + '' => 'PhabricatorApplicationsListController' 33 + ), 34 + ); 35 + } 36 + 37 + public function shouldAppearInLaunchView() { 38 + return false; 39 + } 40 + 41 + } 42 +
+35
src/applications/meta/controller/PhabricatorApplicationsController.php
··· 1 + <?php 2 + 3 + /* 4 + * Copyright 2012 Facebook, Inc. 5 + * 6 + * Licensed under the Apache License, Version 2.0 (the "License"); 7 + * you may not use this file except in compliance with the License. 8 + * You may obtain a copy of the License at 9 + * 10 + * http://www.apache.org/licenses/LICENSE-2.0 11 + * 12 + * Unless required by applicable law or agreed to in writing, software 13 + * distributed under the License is distributed on an "AS IS" BASIS, 14 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 + * See the License for the specific language governing permissions and 16 + * limitations under the License. 17 + */ 18 + 19 + abstract class PhabricatorApplicationsController extends PhabricatorController { 20 + 21 + public function buildStandardPageResponse($view, array $data) { 22 + 23 + $page = $this->buildStandardPageView(); 24 + 25 + $page->setApplicationName('Applications'); 26 + $page->setBaseURI('/applications/'); 27 + $page->setTitle(idx($data, 'title')); 28 + $page->setGlyph("\xE0\xBC\x84"); 29 + $page->appendChild($view); 30 + 31 + $response = new AphrontWebpageResponse(); 32 + return $response->setContent($page->render()); 33 + 34 + } 35 + }
+63
src/applications/meta/controller/PhabricatorApplicationsListController.php
··· 1 + <?php 2 + 3 + /* 4 + * Copyright 2012 Facebook, Inc. 5 + * 6 + * Licensed under the Apache License, Version 2.0 (the "License"); 7 + * you may not use this file except in compliance with the License. 8 + * You may obtain a copy of the License at 9 + * 10 + * http://www.apache.org/licenses/LICENSE-2.0 11 + * 12 + * Unless required by applicable law or agreed to in writing, software 13 + * distributed under the License is distributed on an "AS IS" BASIS, 14 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 + * See the License for the specific language governing permissions and 16 + * limitations under the License. 17 + */ 18 + 19 + final class PhabricatorApplicationsListController 20 + extends PhabricatorApplicationsController { 21 + 22 + public function processRequest() { 23 + $request = $this->getRequest(); 24 + $user = $request->getUser(); 25 + 26 + $applications = PhabricatorApplication::getAllInstalledApplications(); 27 + $applications = msort($applications, 'getName'); 28 + 29 + foreach ($applications as $key => $application) { 30 + if (!$application->shouldAppearInLaunchView()) { 31 + unset($applications[$key]); 32 + } 33 + } 34 + 35 + $status = array(); 36 + foreach ($applications as $key => $application) { 37 + $status[$key] = $application->loadStatus($user); 38 + } 39 + 40 + $views = array(); 41 + foreach ($applications as $key => $application) { 42 + $views[] = id(new PhabricatorApplicationLaunchView()) 43 + ->setApplication($application) 44 + ->setApplicationStatus(idx($status, $key, array())) 45 + ->setUser($user); 46 + } 47 + 48 + $view = phutil_render_tag( 49 + 'div', 50 + array( 51 + 'class' => 'phabricator-application-list', 52 + ), 53 + id(new AphrontNullView())->appendChild($views)->render()); 54 + 55 + return $this->buildStandardPageResponse( 56 + $view, 57 + array( 58 + 'title' => 'Applications', 59 + )); 60 + } 61 + 62 + } 63 +
+88
src/applications/meta/view/PhabricatorApplicationLaunchView.php
··· 1 + <?php 2 + 3 + /* 4 + * Copyright 2012 Facebook, Inc. 5 + * 6 + * Licensed under the Apache License, Version 2.0 (the "License"); 7 + * you may not use this file except in compliance with the License. 8 + * You may obtain a copy of the License at 9 + * 10 + * http://www.apache.org/licenses/LICENSE-2.0 11 + * 12 + * Unless required by applicable law or agreed to in writing, software 13 + * distributed under the License is distributed on an "AS IS" BASIS, 14 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 + * See the License for the specific language governing permissions and 16 + * limitations under the License. 17 + */ 18 + 19 + final class PhabricatorApplicationLaunchView extends AphrontView { 20 + 21 + private $user; 22 + private $application; 23 + private $status; 24 + 25 + public function setApplication(PhabricatorApplication $application) { 26 + $this->application = $application; 27 + return $this; 28 + } 29 + 30 + public function setUser(PhabricatorUser $user) { 31 + $this->user = $user; 32 + return $this; 33 + } 34 + 35 + public function setApplicationStatus(array $status) { 36 + $this->status = $status; 37 + return $this; 38 + } 39 + 40 + public function render() { 41 + $application = $this->application; 42 + 43 + require_celerity_resource('phabricator-application-launch-view-css'); 44 + 45 + $content = array(); 46 + $content[] = phutil_render_tag( 47 + 'span', 48 + array( 49 + 'class' => 'phabricator-application-launch-name', 50 + ), 51 + phutil_escape_html($application->getName())); 52 + $content[] = phutil_render_tag( 53 + 'span', 54 + array( 55 + 'class' => 'phabricator-application-launch-description', 56 + ), 57 + phutil_escape_html($application->getShortDescription())); 58 + 59 + 60 + $count = 0; 61 + if ($this->status) { 62 + $content[] = '<span class="phabricator-application-status-block">'; 63 + foreach ($this->status as $status) { 64 + $count += $status->getCount(); 65 + $content[] = $status; 66 + } 67 + $content[] = '</span>'; 68 + } 69 + 70 + if ($count) { 71 + $content[] = phutil_render_tag( 72 + 'span', 73 + array( 74 + 'class' => 'phabricator-application-launch-attention', 75 + ), 76 + phutil_escape_html($count)); 77 + } 78 + 79 + return phutil_render_tag( 80 + 'a', 81 + array( 82 + 'class' => 'phabricator-application-launch-container', 83 + 'style' => 'background-image: url('.$application->getIconURI().')', 84 + 'href' => $application->getBaseURI(), 85 + ), 86 + $this->renderSingleView($content)); 87 + } 88 + }
+64
src/applications/meta/view/PhabricatorApplicationStatusView.php
··· 1 + <?php 2 + 3 + /* 4 + * Copyright 2012 Facebook, Inc. 5 + * 6 + * Licensed under the Apache License, Version 2.0 (the "License"); 7 + * you may not use this file except in compliance with the License. 8 + * You may obtain a copy of the License at 9 + * 10 + * http://www.apache.org/licenses/LICENSE-2.0 11 + * 12 + * Unless required by applicable law or agreed to in writing, software 13 + * distributed under the License is distributed on an "AS IS" BASIS, 14 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 + * See the License for the specific language governing permissions and 16 + * limitations under the License. 17 + */ 18 + 19 + final class PhabricatorApplicationStatusView extends AphrontView { 20 + 21 + private $count; 22 + private $text; 23 + private $type; 24 + 25 + const TYPE_NEEDS_ATTENTION = 'needs'; 26 + const TYPE_INFO = 'info'; 27 + const TYPE_OKAY = 'okay'; 28 + const TYPE_WARNING = 'warning'; 29 + const TYPE_EMPTY = 'empty'; 30 + 31 + public function setType($type) { 32 + $this->type = $type; 33 + return $this; 34 + } 35 + 36 + public function setText($text) { 37 + $this->text = $text; 38 + return $this; 39 + } 40 + 41 + public function setCount($count) { 42 + $this->count = $count; 43 + return $this; 44 + } 45 + 46 + public function getCount() { 47 + return $this->count; 48 + } 49 + 50 + public function render() { 51 + $classes = array( 52 + 'phabricator-application-status', 53 + 'phabricator-application-status-type-'.$this->type, 54 + ); 55 + 56 + return phutil_render_tag( 57 + 'span', 58 + array( 59 + 'class' => implode(' ', $classes), 60 + ), 61 + phutil_escape_html($this->text)); 62 + } 63 + 64 + }
+35
src/applications/phriction/application/PhabricatorApplicationPhriction.php
··· 1 + <?php 2 + 3 + /* 4 + * Copyright 2012 Facebook, Inc. 5 + * 6 + * Licensed under the Apache License, Version 2.0 (the "License"); 7 + * you may not use this file except in compliance with the License. 8 + * You may obtain a copy of the License at 9 + * 10 + * http://www.apache.org/licenses/LICENSE-2.0 11 + * 12 + * Unless required by applicable law or agreed to in writing, software 13 + * distributed under the License is distributed on an "AS IS" BASIS, 14 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 + * See the License for the specific language governing permissions and 16 + * limitations under the License. 17 + */ 18 + 19 + final class PhabricatorApplicationPhriction extends PhabricatorApplication { 20 + 21 + public function getShortDescription() { 22 + return 'Wiki'; 23 + } 24 + 25 + public function getBaseURI() { 26 + return '/w/'; 27 + } 28 + 29 + public function getIconURI() { 30 + return celerity_get_resource_uri('/rsrc/image/app/app_phriction.png'); 31 + } 32 + 33 + 34 + } 35 +
+35
src/infrastructure/internationalization/PhabricatorBaseEnglishTranslation.php
··· 131 131 'There are %d aggregate facts in storage.', 132 132 ), 133 133 134 + '%d Commit(s) Awaiting Audit' => array( 135 + '%d Commit Awaiting Audit', 136 + '%d Commits Awaiting Audit', 137 + ), 138 + 139 + '%d Problem Commit(s)' => array( 140 + '%d Problem Commit', 141 + '%d Problem Commits', 142 + ), 143 + 144 + '%d Review(s) Need Attention' => array( 145 + '%d Review Needs Attention', 146 + '%d Reviews Need Attention', 147 + ), 148 + 149 + '%d Review(s) Waiting on Others' => array( 150 + '%d Review Waiting on Others', 151 + '%d Reviews Waiting on Others', 152 + ), 153 + 154 + '%d Flagged Object(s)' => array( 155 + '%d Flagged Object', 156 + '%d Flagged Objects', 157 + ), 158 + 159 + '%d Unbreak Now Task(s)!' => array( 160 + '%d Unbreak Now Task!', 161 + '%d Unbreak Now Tasks!', 162 + ), 163 + 164 + '%d Assigned Task(s)' => array( 165 + '%d Assigned Task', 166 + '%d Assigned Tasks', 167 + ), 168 + 134 169 ); 135 170 } 136 171
+131
webroot/rsrc/css/application/base/phabricator-application-launch-view.css
··· 1 + /** 2 + * @provides phabricator-application-launch-view-css 3 + */ 4 + 5 + 6 + /* - Application List ---------------------------------------------------------- 7 + 8 + Spacing container for the list of large application buttons. 9 + 10 + */ 11 + 12 + /* On desktops, put some space around the whole grid. */ 13 + .device-desktop .phabricator-application-list { 14 + padding: .5em; 15 + } 16 + 17 + /* On tablets, show two columns in the center. */ 18 + .device-tablet .phabricator-application-list { 19 + width: 660px; 20 + margin: auto; 21 + padding: .5em 0; 22 + } 23 + 24 + 25 + /* - Application Launch Button ------------------------------------------------- 26 + 27 + Spacing container for the list of large application buttons. 28 + 29 + */ 30 + 31 + a.phabricator-application-launch-container { 32 + display: inline-block; 33 + width: 210px; 34 + min-height: 90px; 35 + background-repeat: no-repeat; 36 + padding: 5px 15px 5px 80px; 37 + background-position: 15px 10px; 38 + margin: 3px 6px; 39 + overflow: hidden; 40 + position: relative; 41 + 42 + text-decoration: none; 43 + border: 1px solid #737373; 44 + background-color: #f3f3f3; 45 + 46 + border-radius: 4px; 47 + box-shadow: 1px 1px 10px rgba(0, 0, 0, 0.10), 48 + inset -1px -1px 2px rgba(0, 0, 0, 0.15); 49 + } 50 + 51 + a.phabricator-application-launch-container:hover { 52 + text-decoration: none; 53 + } 54 + 55 + /* The hover effect looks awful on phones/tablets when scrolling. */ 56 + .device-desktop a.phabricator-application-launch-container:hover { 57 + background-color: #3875d7; 58 + border-color: #223366; 59 + color: #eeeeee; 60 + } 61 + 62 + .phabricator-application-launch-name, 63 + .phabricator-application-launch-description, 64 + .phabricator-application-launch-status { 65 + display: block; 66 + } 67 + 68 + .phabricator-application-launch-name { 69 + font-weight: bold; 70 + } 71 + 72 + .phabricator-application-launch-description { 73 + color: #666666; 74 + } 75 + 76 + .device-desktop a.phabricator-application-launch-container:hover 77 + .phabricator-application-launch-description { 78 + color: #dddddd; 79 + } 80 + 81 + .phabricator-application-launch-attention { 82 + position: absolute; 83 + left: 45px; 84 + top: 10px; 85 + background: red; 86 + border-radius: 10px; 87 + color: white; 88 + font-weight: normal; 89 + padding: 2px 6px; 90 + border: 1px solid #aa0000; 91 + box-shadow: 0px 0px 3px rgba(255, 255, 255, 0.5), 92 + inset 0 0 3px #aa0000; 93 + } 94 + 95 + .phabricator-application-status-block { 96 + margin-top: 0.5em; 97 + padding-top: 0.5em; 98 + border-top: 1px solid #dfdfdf; 99 + display: block; 100 + } 101 + 102 + .phabricator-application-status { 103 + float: left; 104 + display: block; 105 + position: relative; 106 + font-size: 11px; 107 + height: 20px; 108 + padding-left: 22px; 109 + color: #666666; 110 + 111 + background-repeat: no-repeat; 112 + background-size: 16px auto; 113 + padding-top: 1px; 114 + } 115 + 116 + .device-desktop a.phabricator-application-launch-container:hover 117 + .phabricator-application-status { 118 + color: #eeeeee; 119 + } 120 + 121 + .phabricator-application-status-type-needs { 122 + background-image: url(/rsrc/image/appstatus_needs.png); 123 + } 124 + 125 + .phabricator-application-status-type-empty { 126 + background-image: url(/rsrc/image/appstatus_empty.png); 127 + } 128 + 129 + .phabricator-application-status-type-info { 130 + background-image: url(/rsrc/image/appstatus_info.png); 131 + }
webroot/rsrc/image/app/app_audit.png

This is a binary file and will not be displayed.

webroot/rsrc/image/app/app_differential.png

This is a binary file and will not be displayed.

webroot/rsrc/image/app/app_diffusion.png

This is a binary file and will not be displayed.

webroot/rsrc/image/app/app_fact.png

This is a binary file and will not be displayed.

webroot/rsrc/image/app/app_flags.png

This is a binary file and will not be displayed.

webroot/rsrc/image/app/app_maniphest.png

This is a binary file and will not be displayed.

webroot/rsrc/image/app/app_phriction.png

This is a binary file and will not be displayed.

webroot/rsrc/image/appstatus_empty.png

This is a binary file and will not be displayed.

webroot/rsrc/image/appstatus_info.png

This is a binary file and will not be displayed.

webroot/rsrc/image/appstatus_needs.png

This is a binary file and will not be displayed.

webroot/rsrc/image/appstatus_okay.png

This is a binary file and will not be displayed.