Skip to content

Commit f871885

Browse files
committed
Style public profile
1 parent 60aa468 commit f871885

File tree

2 files changed

+36
-14
lines changed

2 files changed

+36
-14
lines changed

warehouse/static/sass/blocks/_author-profile.scss

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,26 +25,36 @@
2525
// Meta
2626
</p>
2727
</div>
28+
<a class="author-profile__edit-button">Edit Profile</a>
2829
</div>
2930
*/
3031

3132
.author-profile {
32-
padding-right: $spacing-unit;
33+
padding-bottom: $spacing-unit;
3334

34-
@media only screen and (max-width: $desktop){
35+
@media only screen and (max-width: $desktop) and (min-width: $mobile) {
3536
padding: 0 0 ($spacing-unit * 1.5) 0;
37+
display: flex;
38+
align-items: center;
3639

37-
img {
40+
img {
41+
height: 175px;
42+
margin-right: $spacing-unit;
43+
}
44+
}
45+
46+
@media only screen and (max-width: $mobile) {
47+
img {
3848
display: none;
49+
margin-right: 0;
3950
}
4051
}
4152

4253
h1.author-profile__name {
43-
padding: 10px 0;
44-
border-top: 2px solid $border-color;
45-
border-bottom: 2px solid $border-color;
46-
margin: 20px 0;
47-
word-break: break-all;
54+
@include h2;
55+
overflow: hidden;
56+
text-overflow: ellipsis;
57+
padding: $spacing-unit 0 $spacing-unit / 2;
4858

4959
@media only screen and (max-width: $desktop){
5060
border-top: 0;
@@ -56,4 +66,10 @@
5666
&__meta {
5767
font-style: italic;
5868
}
69+
70+
&__edit-button {
71+
margin-top: $spacing-unit;
72+
width: 100%;
73+
text-align: center;
74+
}
5975
}

warehouse/templates/accounts/profile.html

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,18 @@
2222
<div class="author-profile">
2323
{% set alt = "Avatar for {} from gravatar.com".format(user.name|default(user.username, true)) %}
2424
<img src="{{ gravatar(user.email, size=225) }}" alt="{{ alt }}" title="{{ alt }}">
25-
<h1 class="author-profile__name">{{ user.name|default(user.username, true) }}</h1>
26-
<div class="author-profile__meta">
27-
<p><i class="fa fa-user-circle" aria-hidden="true"></i>&nbsp;&nbsp;{{ user.username }}</p>
28-
{% if user.date_joined %}
29-
<p><i class="fa fa-calendar-o" aria-hidden="true"></i>&nbsp;&nbsp;Joined on {{ user.date_joined|format_date() }}</p>
30-
{% endif %}
25+
<div>
26+
<h1 class="author-profile__name">{{ user.name|default(user.username, true) }}</h1>
27+
<div class="author-profile__meta">
28+
<p><i class="fa fa-user-circle" aria-hidden="true"></i>&nbsp;&nbsp;{{ user.username }}</p>
29+
{% if user.date_joined %}
30+
<p><i class="fa fa-calendar-o" aria-hidden="true"></i>&nbsp;&nbsp;Joined on {{ user.date_joined|format_date() }}</p>
31+
{% endif %}
32+
</div>
33+
34+
<!-- if this user is logged in -->
35+
<a href="{{ request.route_path('manage.profile') }}" class="button button--primary author-profile__edit-button">Edit Profile</a>
36+
<!-- endif -->
3137
</div>
3238
</div>
3339
</div>

0 commit comments

Comments
 (0)