Skip to content

Commit a056f71

Browse files
committed
Fix account badges alignment for different device view
1 parent aac97b1 commit a056f71

File tree

5 files changed

+12
-14
lines changed

5 files changed

+12
-14
lines changed

app/assets/stylesheets/accounts/show.sass

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@
4747
.btn-info
4848
font-size: 10px !important
4949
#account_name_header
50-
margin-top: -134px
51-
margin-left: 64px
50+
margin-top: 10px
5251
h1
5352
font-size: 14px !important
5453
width: auto

app/assets/stylesheets/badges.sass

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
&.last
8888
:margin-right 0
8989

90-
#account_header
90+
.account_header
9191
.mini-badges-section
9292
position: relative
9393
margin: 27px 4px 0 0
@@ -98,9 +98,10 @@
9898
&.last
9999
margin-right: 0
100100
@media only all and (min-width: 320px) and (max-width: 480px)
101-
#account_header
101+
.account_header
102102
.mini-badges-section
103-
margin: 5px 43px 0 0
103+
margin: 0 0 15px
104+
display: flex
104105
.account-badge
105106
margin: 0 20px 20px 0
106107

app/views/accounts/_badges_row.html.haml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
- hide_foss_logo ||= false
33

44
- badges.each_with_index do |badge, index|
5-
- if header == :large && index == 4
6-
%br.clear
75
- if !hide_foss_logo
86
- css_class = badge.css_class(badges.length, header, index)
97
= link_to blog_url_for(:badges), class: "pull-left account-badge #{css_class}",

app/views/accounts/_mini_header.html.haml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
- lang = @account.most_experienced_language
22
.account_header{ style: 'margin-top: 5px' }
3-
.col-xs-2.col-sm-2.col-md-2#account_icon
3+
.col-xs-4.col-sm-2.col-md-2#account_icon
44
= link_to account_path(@account) do
55
= image_tag avatar_img_path(@account, 62), size: '128x128', itemprop: 'image'
66
- if lang
77
- bg_color = language_color(lang.name)
88
- text_color = language_text_color(lang.name)
99
= link_to '', '#', style: "background-color: ##{bg_color}; color: ##{text_color};",
1010
title: t('accounts.mini_header.title'), class: 'center primary_language_bg'
11-
.col-xs-10.col-sm-10.col-md-10#account_header
11+
.col-xs-8.col-sm-10.col-md-10#account_header
1212
.info.pull-left
1313
%h1{ itemprop: 'name' }
1414
= link_to h(@account.name), account_path(@account)

app/views/accounts/show/_header.html.haml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.account_header{ style: 'margin-top: 10px' }
2-
.col-xs-2.col-sm-2.col-md-2#account_icon
2+
.col-xs-4.col-sm-3.col-md-2#account_icon
33
= image_tag avatar_img_path(@account, 128), size: '128x128', itemprop: 'image'
44
- lang = @account.most_experienced_language
55
- if lang
@@ -8,7 +8,7 @@
88
= lang.nice_name
99
- else
1010
 
11-
.col-xs-10.col-sm-10.col-md-10#account_header
11+
.col-xs-7.col-sm-4.col-md-7#account_header
1212
.pull-left#account_name_header
1313
%h1{ itemprop: 'name' }= h(@account.name)
1414
.info
@@ -38,9 +38,9 @@
3838
rel: 'popup', title: "Follow @#{@account.twitter_account}" do
3939
%i.icon-twitter
4040
= render partial: 'accounts/show/header/kudo_button', locals: { css: 'btn-mini btn-info' }
41-
.mini-badges-section.pull-right
42-
- badges = @account.badges.map { |badge| BadgeDecorator.new(badge) }
43-
= render partial: 'badges_row', locals: { badges: badges, header: :large }
41+
.col-xs-12.col-sm-5.col-md-3.mini-badges-section
42+
- badges = @account.badges.map { |badge| BadgeDecorator.new(badge) }
43+
= render partial: 'badges_row', locals: { badges: badges }
4444

4545
.clearfix  
4646
.col-xs-12.col-sm-12.col-md-12

0 commit comments

Comments
 (0)