Skip to content

Commit bba1411

Browse files
committed
Add setProfileHeader to PHUIHeaderView for reuse
Summary: Moves some profile css into PHUI, cleans up mobile view and desktop spacing. Test Plan: Test Project at desktop and mobile breakpoints. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D15106
1 parent 710fc0c commit bba1411

File tree

5 files changed

+58
-45
lines changed

5 files changed

+58
-45
lines changed

resources/celerity/map.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*/
88
return array(
99
'names' => array(
10-
'core.pkg.css' => '8c8210a3',
10+
'core.pkg.css' => '92f16374',
1111
'core.pkg.js' => '573e6664',
1212
'darkconsole.pkg.js' => 'e7393ebb',
1313
'differential.pkg.css' => '2de124c9',
@@ -93,7 +93,7 @@
9393
'rsrc/css/application/policy/policy-transaction-detail.css' => '82100a43',
9494
'rsrc/css/application/policy/policy.css' => '957ea14c',
9595
'rsrc/css/application/ponder/ponder-view.css' => '7b0df4da',
96-
'rsrc/css/application/project/project-view.css' => 'efd02445',
96+
'rsrc/css/application/project/project-view.css' => 'ea27bd1f',
9797
'rsrc/css/application/releeph/releeph-core.css' => '9b3c5733',
9898
'rsrc/css/application/releeph/releeph-preview-branch.css' => 'b7a6f4a5',
9999
'rsrc/css/application/releeph/releeph-request-differential-create-dialog.css' => '8d8b92cd',
@@ -133,7 +133,7 @@
133133
'rsrc/css/phui/phui-fontkit.css' => '9cda225e',
134134
'rsrc/css/phui/phui-form-view.css' => '4a1a0f5e',
135135
'rsrc/css/phui/phui-form.css' => '0b98e572',
136-
'rsrc/css/phui/phui-header-view.css' => '55bb32dd',
136+
'rsrc/css/phui/phui-header-view.css' => '235f0d7d',
137137
'rsrc/css/phui/phui-icon-set-selector.css' => '1ab67aad',
138138
'rsrc/css/phui/phui-icon.css' => '3f33ab57',
139139
'rsrc/css/phui/phui-image-mask.css' => '5a8b09c8',
@@ -808,7 +808,7 @@
808808
'phui-fontkit-css' => '9cda225e',
809809
'phui-form-css' => '0b98e572',
810810
'phui-form-view-css' => '4a1a0f5e',
811-
'phui-header-view-css' => '55bb32dd',
811+
'phui-header-view-css' => '235f0d7d',
812812
'phui-icon-set-selector-css' => '1ab67aad',
813813
'phui-icon-view-css' => '3f33ab57',
814814
'phui-image-mask-css' => '5a8b09c8',
@@ -842,7 +842,7 @@
842842
'policy-edit-css' => '815c66f7',
843843
'policy-transaction-detail-css' => '82100a43',
844844
'ponder-view-css' => '7b0df4da',
845-
'project-view-css' => 'efd02445',
845+
'project-view-css' => 'ea27bd1f',
846846
'raphael-core' => '51ee6b43',
847847
'raphael-g' => '40dde778',
848848
'raphael-g-line' => '40da039e',

src/applications/project/controller/PhabricatorProjectProfileController.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ public function handleRequest(AphrontRequest $request) {
2222
->setHeader($project->getName())
2323
->setUser($viewer)
2424
->setPolicyObject($project)
25-
->setImage($picture);
25+
->setImage($picture)
26+
->setProfileHeader(true);
2627

2728
if ($project->getStatus() == PhabricatorProjectStatus::STATUS_ACTIVE) {
2829
$header->setStatus('fa-check', 'bluegrey', pht('Active'));
@@ -77,13 +78,6 @@ public function handleRequest(AphrontRequest $request) {
7778
$crumbs = $this->buildApplicationCrumbs();
7879
$crumbs->setBorder(true);
7980

80-
$header = phutil_tag(
81-
'div',
82-
array(
83-
'class' => 'project-view-header',
84-
),
85-
$header);
86-
8781
require_celerity_resource('project-view-css');
8882
$home = phutil_tag(
8983
'div',

src/view/phui/PHUIHeaderView.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ final class PHUIHeaderView extends AphrontTagView {
1212
private $headerIcon;
1313
private $noBackground;
1414
private $bleedHeader;
15+
private $profileHeader;
1516
private $tall;
1617
private $properties = array();
1718
private $actionLinks = array();
@@ -66,6 +67,11 @@ public function setBleedHeader($bleed) {
6667
return $this;
6768
}
6869

70+
public function setProfileHeader($bighead) {
71+
$this->profileHeader = $bighead;
72+
return $this;
73+
}
74+
6975
public function setHeaderIcon($icon) {
7076
$this->headerIcon = $icon;
7177
return $this;
@@ -153,6 +159,10 @@ protected function getTagAttributes() {
153159
$classes[] = 'phui-bleed-header';
154160
}
155161

162+
if ($this->profileHeader) {
163+
$classes[] = 'phui-profile-header';
164+
}
165+
156166
if ($this->properties || $this->policyObject ||
157167
$this->subheader || $this->tall) {
158168
$classes[] = 'phui-header-tall';

webroot/rsrc/css/application/project/project-view.css

Lines changed: 4 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -6,43 +6,15 @@
66
background: #fff;
77
}
88

9-
.project-view-header {
10-
padding: 32px 24px 32px;
11-
}
12-
13-
.project-view-header .phui-header-shell {
14-
margin: 0;
15-
padding: 0;
16-
border: none;
17-
}
18-
19-
.project-view-header .phui-header-image {
20-
height: 80px;
21-
width: 80px;
22-
}
23-
24-
.project-view-header .phui-header-col1 {
25-
width: 96px;
26-
}
27-
28-
.project-view-header .phui-header-subheader {
29-
margin-top: 12px;
30-
}
31-
32-
.project-view-header .phui-header-shell .phui-header-header {
33-
font-family: 'Aleo', {$fontfamily};
34-
font-size: 24px;
35-
}
36-
37-
.project-view-header .phui-header-col3 {
38-
vertical-align: top;
39-
}
40-
419
.phui-box.phui-box-grey.project-view-properties {
4210
margin: 0 16px 0 16px;
4311
padding: 4px 12px;
4412
}
4513

14+
.device-phone .phui-box.phui-box-grey.project-view-properties {
15+
margin: 0 12px 0 12px;
16+
}
17+
4618
.project-view-properties .phui-property-list-key {
4719
width: auto;
4820
margin-left: 4px;

webroot/rsrc/css/phui/phui-header-view.css

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,3 +253,40 @@ body .phui-header-shell.phui-bleed-header
253253
.phui-header-subheader .phui-badge-flex-view:after {
254254
display: inline;
255255
}
256+
257+
/*** Profile Header ***********************************************************/
258+
259+
.phui-profile-header {
260+
padding: 24px 20px 20px 24px;
261+
}
262+
263+
.device-phone .phui-profile-header {
264+
padding: 12px;
265+
}
266+
267+
.phui-profile-header.phui-header-shell {
268+
margin: 0;
269+
border: none;
270+
}
271+
272+
.phui-profile-header .phui-header-image {
273+
height: 80px;
274+
width: 80px;
275+
}
276+
277+
.phui-profile-header .phui-header-col1 {
278+
width: 96px;
279+
}
280+
281+
.phui-profile-header .phui-header-subheader {
282+
margin-top: 12px;
283+
}
284+
285+
.phui-profile-header.phui-header-shell .phui-header-header {
286+
font-family: 'Aleo', {$fontfamily};
287+
font-size: 24px;
288+
}
289+
290+
.phui-profile-header .phui-header-col3 {
291+
vertical-align: top;
292+
}

0 commit comments

Comments
 (0)