Correct a parameter order swap in "diffusion.historyquery" for Mercurial
[phabricator.git] / src / applications / guides / module / PhabricatorGuideQuickStartModule.php
blob65b07ffe2cf214dcf8085e9b1833a37982f41206
1 <?php
3 final class PhabricatorGuideQuickStartModule extends PhabricatorGuideModule {
5 public function getModuleKey() {
6 return 'quickstart';
9 public function getModuleName() {
10 return pht('Quick Start');
13 public function getModulePosition() {
14 return 30;
17 public function getIsModuleEnabled() {
18 return true;
21 public function renderModuleStatus(AphrontRequest $request) {
22 $viewer = $request->getViewer();
23 $instance = PhabricatorEnv::getEnvConfig('cluster.instance');
25 $guide_items = new PhabricatorGuideListView();
27 $title = pht('Create a Repository');
28 $repository_check = id(new PhabricatorRepositoryQuery())
29 ->setViewer($viewer)
30 ->execute();
31 $href = PhabricatorEnv::getURI('/diffusion/');
32 if ($repository_check) {
33 $icon = 'fa-check';
34 $icon_bg = 'bg-green';
35 $description = pht(
36 "You've created at least one repository.");
37 } else {
38 $icon = 'fa-code';
39 $icon_bg = 'bg-sky';
40 $description =
41 pht('If you are here for code review, let\'s set up your first '.
42 'repository.');
45 $item = id(new PhabricatorGuideItemView())
46 ->setTitle($title)
47 ->setHref($href)
48 ->setIcon($icon)
49 ->setIconBackground($icon_bg)
50 ->setDescription($description);
51 $guide_items->addItem($item);
54 $title = pht('Create a Project');
55 $project_check = id(new PhabricatorProjectQuery())
56 ->setViewer($viewer)
57 ->execute();
58 $href = PhabricatorEnv::getURI('/project/');
59 if ($project_check) {
60 $icon = 'fa-check';
61 $icon_bg = 'bg-green';
62 $description = pht(
63 "You've created at least one project.");
64 } else {
65 $icon = 'fa-briefcase';
66 $icon_bg = 'bg-sky';
67 $description =
68 pht('Project tags define everything. Create them for teams, tags, '.
69 'or actual projects.');
72 $item = id(new PhabricatorGuideItemView())
73 ->setTitle($title)
74 ->setHref($href)
75 ->setIcon($icon)
76 ->setIconBackground($icon_bg)
77 ->setDescription($description);
78 $guide_items->addItem($item);
81 $title = pht('Create a Task');
82 $task_check = id(new ManiphestTaskQuery())
83 ->setViewer($viewer)
84 ->execute();
85 $href = PhabricatorEnv::getURI('/maniphest/');
86 if ($task_check) {
87 $icon = 'fa-check';
88 $icon_bg = 'bg-green';
89 $description = pht(
90 "You've created at least one task.");
91 } else {
92 $icon = 'fa-anchor';
93 $icon_bg = 'bg-sky';
94 $description =
95 pht('Create some work for the interns in Maniphest.');
98 $item = id(new PhabricatorGuideItemView())
99 ->setTitle($title)
100 ->setHref($href)
101 ->setIcon($icon)
102 ->setIconBackground($icon_bg)
103 ->setDescription($description);
104 $guide_items->addItem($item);
106 $title = pht('Personalize your Install');
107 $wordmark = PhabricatorEnv::getEnvConfig('ui.logo');
108 $href = PhabricatorEnv::getURI('/config/edit/ui.logo/');
109 if ($wordmark) {
110 $icon = 'fa-check';
111 $icon_bg = 'bg-green';
112 $description = pht(
113 'It looks amazing, good work. Home Sweet Home.');
114 } else {
115 $icon = 'fa-home';
116 $icon_bg = 'bg-sky';
117 $description =
118 pht('Change the name and add your company logo, just to give it a '.
119 'little extra polish.');
122 $item = id(new PhabricatorGuideItemView())
123 ->setTitle($title)
124 ->setHref($href)
125 ->setIcon($icon)
126 ->setIconBackground($icon_bg)
127 ->setDescription($description);
128 $guide_items->addItem($item);
130 $title = pht('Explore Applications');
131 $href = PhabricatorEnv::getURI('/applications/');
132 $icon = 'fa-globe';
133 $icon_bg = 'bg-sky';
134 $description =
135 pht('See all the applications included in Phabricator.');
137 $item = id(new PhabricatorGuideItemView())
138 ->setTitle($title)
139 ->setHref($href)
140 ->setIcon($icon)
141 ->setIconBackground($icon_bg)
142 ->setDescription($description);
143 $guide_items->addItem($item);
145 if (!$instance) {
146 $title = pht('Invite Collaborators');
147 $people_check = id(new PhabricatorPeopleQuery())
148 ->setViewer($viewer)
149 ->execute();
150 $people = count($people_check);
151 $href = PhabricatorEnv::getURI('/people/invite/send/');
152 if ($people > 1) {
153 $icon = 'fa-check';
154 $icon_bg = 'bg-green';
155 $description = pht(
156 'Your invitations have been accepted. You will not be alone on '.
157 'this journey.');
158 } else {
159 $icon = 'fa-group';
160 $icon_bg = 'bg-sky';
161 $description =
162 pht('Invite the rest of your team to get started on Phabricator.');
165 $item = id(new PhabricatorGuideItemView())
166 ->setTitle($title)
167 ->setHref($href)
168 ->setIcon($icon)
169 ->setIconBackground($icon_bg)
170 ->setDescription($description);
171 $guide_items->addItem($item);
174 $intro = pht(
175 'If you\'re new to Phabricator, these optional steps can help you learn '.
176 'the basics. Conceptually, Phabricator is structured as a graph, and '.
177 'repositories, tasks, and projects are all independent from each other. '.
178 'Feel free to set up Phabricator for how you work best, and explore '.
179 'these features at your own pace.');
181 $intro = new PHUIRemarkupView($viewer, $intro);
182 $intro = id(new PHUIDocumentView())
183 ->appendChild($intro);
185 return array($intro, $guide_items);