From 1a9660bc0598709ce14e4541de9b7936557d4eb0 Mon Sep 17 00:00:00 2001 From: pixeldesu Date: Fri, 24 Jul 2015 17:04:46 +0200 Subject: [PATCH] update userbox style with headers --- app/assets/stylesheets/scss/user.scss | 19 +++++++++++++++++++ app/views/moderation/_userbox.html.haml | 20 ++++++-------------- app/views/shared/_sidebar.html.haml | 23 +++++++++++------------ app/views/shared/_userbox.html.haml | 24 +++++++++++------------- app/views/user/show_follow.html.haml | 2 +- 5 files changed, 48 insertions(+), 40 deletions(-) diff --git a/app/assets/stylesheets/scss/user.scss b/app/assets/stylesheets/scss/user.scss index 527286c3..3751c95e 100644 --- a/app/assets/stylesheets/scss/user.scss +++ b/app/assets/stylesheets/scss/user.scss @@ -120,3 +120,22 @@ $colours: danger $brand-danger, margin-top: -30px; } } + +.userbox--header { + width: 100%; + height: auto; +} + +.userbox--avatar { + display: block; + margin-left: auto; + margin-right: auto; + margin-top: -60px; + border-radius: 5px; +} + +.userbox--username { + text-align: center; + margin-top: 10px; + margin-bottom: 5px; +} diff --git a/app/views/moderation/_userbox.html.haml b/app/views/moderation/_userbox.html.haml index 42b71cee..2ef0d465 100644 --- a/app/views/moderation/_userbox.html.haml +++ b/app/views/moderation/_userbox.html.haml @@ -1,22 +1,14 @@ .panel.panel-default + %img.userbox--header{src: user.profile_header.url(:mobile)} .panel-body - .media - .pull-left - %img.img-rounded.profile--img{src: gravatar_url(user)} - .media-body - - if user.display_name.blank? - %h2 - %a{href: show_user_profile_path(user.screen_name)} - = user.screen_name - - else - %h2.profile--displayname - %a{href: show_user_profile_path(user.screen_name)} - = user.display_name - %h4.text-muted.profile--username= user.screen_name + %img.userbox--avatar{src: user.profile_picture.url(:small)} + %p.userbox--username + %a.profile--displayname{href: show_user_profile_path(user.screen_name)} + = user.screen_name .row .col-md-12.col-sm-12.col-xs-12 - unless count.nil? - %h4.entry-text#asked-count + %h4.entry-text.text-center#asked-count = count = 'Report'.pluralize(count) %br diff --git a/app/views/shared/_sidebar.html.haml b/app/views/shared/_sidebar.html.haml index c9c49b44..16d06cd0 100644 --- a/app/views/shared/_sidebar.html.haml +++ b/app/views/shared/_sidebar.html.haml @@ -1,17 +1,16 @@ .panel.panel-default.hidden-xs + %img.userbox--header{src: current_user.profile_header.url(:mobile)} .panel-body - .media - .pull-left - %img.answerbox--img{src: current_user.profile_picture.url(:small)} - .media-body - - if current_user.display_name.blank? - .profile--displayname - = current_user.screen_name - - else - .profile--displayname - = current_user.display_name - .profile--username - = current_user.screen_name + %img.userbox--avatar{src: current_user.profile_picture.url(:small)} + %p.userbox--username + - if current_user.display_name.blank? + %span.profile--displayname + = current_user.screen_name + - else + %span.profile--displayname + = current_user.display_name + %span.profile--username + = current_user.screen_name .row %a{href: show_user_followers_path(current_user.screen_name)} .col-md-6.col-sm-6.col-xs-6 diff --git a/app/views/shared/_userbox.html.haml b/app/views/shared/_userbox.html.haml index 2c5e5e67..f252123c 100644 --- a/app/views/shared/_userbox.html.haml +++ b/app/views/shared/_userbox.html.haml @@ -1,20 +1,18 @@ / TODO: pixeldesu pls - type ||= @type || :nil .panel.panel-default + %img.userbox--header{src: user.profile_header.url(:mobile)} .panel-body - .media - .pull-left - %img.img-rounded.profile--img{src: gravatar_url(user)} - .media-body - - if user.display_name.blank? - %h2 - %a{href: show_user_profile_path(user.screen_name)} - = user.screen_name - - else - %h2.profile--displayname - %a{href: show_user_profile_path(user.screen_name)} - = user.display_name - %h4.text-muted.profile--username= user.screen_name + %img.userbox--avatar{src: user.profile_picture.url(:small)} + %p.userbox--username + - if user.display_name.blank? + %a.profile--displayname{href: show_user_profile_path(user.screen_name)} + = user.screen_name + - else + %a.profile--displayname{href: show_user_profile_path(user.screen_name)} + = user.display_name + %span.profile--username + = user.screen_name .row .col-md-6.col-sm-6.col-xs-6 %h4.entry-text#asked-count= user.asked_count diff --git a/app/views/user/show_follow.html.haml b/app/views/user/show_follow.html.haml index 9c410115..0b5f1479 100644 --- a/app/views/user/show_follow.html.haml +++ b/app/views/user/show_follow.html.haml @@ -9,7 +9,7 @@ %h1.visible-xs= @title #users - @users.each do |user| - .col-sm-6 + .col-md-4.col-sm-6.col-xs-12 = render 'shared/userbox', user: user #pagination= will_paginate @users, renderer: BootstrapPagination::Rails, page_links: false