Skip to content

Commit 3e5fb09

Browse files
Afaque Hussainepriestley
authored andcommitted
More information on Applications
Summary: More Information on Applications on Applications List View. Also, added tags in Applications Details view to show their status. Test Plan: Manual Checking Reviewers: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D4759
1 parent c1e9b20 commit 3e5fb09

File tree

2 files changed

+49
-23
lines changed

2 files changed

+49
-23
lines changed

src/applications/meta/controller/PhabricatorApplicationDetailViewController.php

Lines changed: 40 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -27,36 +27,53 @@ public function processRequest() {
2727
->setName(pht('Applications'))
2828
->setHref($this->getApplicationURI()));
2929

30-
$properties = $this->buildPropertyView($selected);
31-
$actions = $this->buildActionView($user, $selected);
32-
33-
return $this->buildApplicationPage(
34-
array(
35-
$crumbs,
36-
id(new PhabricatorHeaderView())->setHeader($title),
37-
$actions,
38-
$properties,
39-
),
40-
array(
41-
'title' => $title,
42-
'device' => true,
43-
));
44-
}
30+
$header = id(new PhabricatorHeaderView())
31+
->setHeader($title);
4532

46-
private function buildPropertyView(PhabricatorApplication $selected) {
47-
$properties = new PhabricatorPropertyListView();
33+
$status_tag = id(new PhabricatorTagView())
34+
->setType(PhabricatorTagView::TYPE_STATE);
4835

4936
if ($selected->isInstalled()) {
50-
$properties->addProperty(
51-
pht('Status'), pht('Installed'));
37+
$status_tag->setName(pht('Installed'));
38+
$status_tag->setBackgroundColor(PhabricatorTagView::COLOR_GREEN);
5239

5340
} else {
54-
$properties->addProperty(
55-
pht('Status'), pht('Uninstalled'));
41+
$status_tag->setName(pht('Uninstalled'));
42+
$status_tag->setBackgroundColor(PhabricatorTagView::COLOR_RED);
5643
}
5744

58-
$properties->addProperty(
59-
pht('Description'), $selected->getShortDescription());
45+
if ($selected->isBeta()) {
46+
$beta_tag = id(new PhabricatorTagView())
47+
->setType(PhabricatorTagView::TYPE_STATE)
48+
->setName(pht('Beta'))
49+
->setBackgroundColor(PhabricatorTagView::COLOR_GREY);
50+
$header->addTag($beta_tag);
51+
}
52+
53+
54+
$header->addTag($status_tag);
55+
56+
$properties = $this->buildPropertyView($selected);
57+
$actions = $this->buildActionView($user, $selected);
58+
59+
return $this->buildApplicationPage(
60+
array(
61+
$crumbs,
62+
$header,
63+
$actions,
64+
$properties,
65+
),
66+
array(
67+
'title' => $title,
68+
'device' => true,
69+
));
70+
}
71+
72+
private function buildPropertyView(PhabricatorApplication $selected) {
73+
$properties = id(new PhabricatorPropertyListView())
74+
->addProperty(
75+
pht('Description'), $selected->getShortDescription()
76+
);
6077

6178
return $properties;
6279
}

src/applications/meta/controller/PhabricatorApplicationsListController.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,16 @@ private function buildInstalledApplicationsList(array $applications) {
5353
->setHref('/applications/view/'.get_class($application).'/')
5454
->addAttribute(
5555
phutil_escape_html($application->getShortDescription()));
56+
57+
if (!$application->isInstalled()) {
58+
$item->addIcon('delete', pht('Uninstalled'));
59+
}
60+
61+
if ($application->isBeta()) {
62+
$item->addIcon('lint-warning', pht('Beta'));
63+
}
5664
$list->addItem($item);
65+
5766
}
5867
return $list;
5968
}

0 commit comments

Comments
 (0)