From ea3c8e70fd9c99feb2333539f8744c7dea32abc2 Mon Sep 17 00:00:00 2001 From: Andrew Radev Date: Sat, 30 May 2015 16:26:48 +0300 Subject: [PATCH] User#show --- app/assets/stylesheets/management/_users.scss | 24 +++++++++++ .../stylesheets/management/application.scss | 1 + app/views/management/users/edit.html.slim | 4 +- app/views/management/users/show.html.slim | 40 +++++++++++++++---- 4 files changed, 61 insertions(+), 8 deletions(-) create mode 100644 app/assets/stylesheets/management/_users.scss diff --git a/app/assets/stylesheets/management/_users.scss b/app/assets/stylesheets/management/_users.scss new file mode 100644 index 0000000..41d9204 --- /dev/null +++ b/app/assets/stylesheets/management/_users.scss @@ -0,0 +1,24 @@ +.speaker-profile { + @extend .col-sm-offset-2; + @extend .col-sm-8; + + .center { + text-align: center; + } + + .profile-image { + @extend .img-thumbnail; + max-width: 171px; + max-height: 180px; + } + + .social { + @extend .btn-group; + margin-top: 10px; + + a { + @extend .btn; + @extend .btn-default; + } + } +} diff --git a/app/assets/stylesheets/management/application.scss b/app/assets/stylesheets/management/application.scss index 1a229ce..a102dcc 100644 --- a/app/assets/stylesheets/management/application.scss +++ b/app/assets/stylesheets/management/application.scss @@ -8,6 +8,7 @@ @import "morris"; +@import "users"; @import "colors"; @import "layout"; @import "forms"; diff --git a/app/views/management/users/edit.html.slim b/app/views/management/users/edit.html.slim index cefddf4..73fce02 100644 --- a/app/views/management/users/edit.html.slim +++ b/app/views/management/users/edit.html.slim @@ -7,7 +7,9 @@ = simple_nested_form_for [:management, @user], wrapper: :horizontal_form, html: { class: 'form-horizontal' } do |f| .panel.panel-primary .panel-heading - h1.panel-title = t 'views.user.info' + h1.panel-title + = t 'views.user.info' + = link_to icon(:eye), [:management, @user], class: 'btn btn-xs btn-info pull-right' .panel-body .row diff --git a/app/views/management/users/show.html.slim b/app/views/management/users/show.html.slim index fa7ee84..016cedd 100644 --- a/app/views/management/users/show.html.slim +++ b/app/views/management/users/show.html.slim @@ -2,12 +2,38 @@ = @user.name .row - .col-lg-2 - = image_tag(@user.profile_picture.medium.url) + .speaker-profile + .panel.panel-default + .panel-heading + h1.panel-title + = @user.name + = link_to icon(:edit), edit_management_user_path(@user), class: 'btn btn-xs btn-danger pull-right' + .panel-body + .center + = image_tag @user.speaker_profile.picture.medium.url, class: "profile-image" + - if @user.speaker_profile.organisation.present? + div + => icon :briefcase + = @user.speaker_profile.organisation + div.social + = link_to "mailto://#{@user.email}" + = icon :envelope + - if @user.speaker_profile.github.present? + = link_to "https://github.com/#{@user.speaker_profile.github}" + = icon :github + - if @user.speaker_profile.twitter.present? + = link_to "https://twitter.com/#{@user.speaker_profile.twitter}" + = icon :twitter - .col-lg-10 - h1.page-header - = @user.name + hr - - if @profile.present? - p.biography= simple_format @profile.biography + h4 = SpeakerProfile.human_attribute_name(:biography) + = simple_format @user.speaker_profile.biography + + h4 = t :contacts + - if @user.speaker_profile.twitter.present? + p #{icon :twitter} @#{@user.speaker_profile.twitter} + - if @user.speaker_profile.public_email.present? + p #{icon :envelope} #{@user.speaker_profile.public_email} (#{t(:public)}) + p #{icon :envelope} #{@user.email} (#{t(:private)}) + p #{glyph :phone} #{Phony.format(@user.speaker_profile.mobile_phone, format: :international)}