Overhaul PersonalProfile details view

This commit is contained in:
Petko Bordjukov 2019-04-29 21:34:03 +03:00
parent 2d19046d35
commit 7bb4ba478c
2 changed files with 52 additions and 58 deletions

View File

@ -1,24 +1,8 @@
.speaker-profile { .panel .panel-image img {
@extend .col-sm-offset-2; display: block;
@extend .col-sm-8; max-width: 100%;
height: auto;
.center { margin-right: auto;
text-align: center; margin-left: auto;
} width: 100%;
.profile-image {
@extend .img-thumbnail;
max-width: 171px;
max-height: 180px;
}
.social {
@extend .btn-group;
margin-top: 10px;
a {
@extend .btn;
@extend .btn-default;
}
}
} }

View File

@ -5,65 +5,75 @@
.col-lg-12 .col-lg-12
h1.page-header h1.page-header
= PersonalProfile.model_name.human.mb_chars.capitalize = PersonalProfile.model_name.human.mb_chars.capitalize
.row
.col-sm-5.col-md-4
.panel.panel-default .panel.panel-default
.panel-image
= image_tag @profile.picture.url
.panel-body .panel-body
.media .media
.media-left.hidden-sm.hidden-xs
= image_tag @profile.picture.medium.url, class: "profile-image"
.media-body .media-body
.text-center.visible-sm.visible-xs
= image_tag @profile.picture.medium.url, class: "profile-image img-thumbnail"
h4.media-heading h4.media-heading
= @profile.name = @profile.name
hr hr
h4 = PersonalProfile.human_attribute_name(:biography)
= simple_format @profile.biography = simple_format @profile.biography
h4 = t '.contacts' ul.list-group
- if @profile.organisation.present? - if @profile.organisation.present?
p = icon :briefcase, @profile.organisation li.list-group-item
h5.list-group-item-heading = PersonalProfile.human_attribute_name :organisation
p.list-group-item-text = @profile.organisation
- if @profile.twitter.present? - if @profile.twitter.present?
p = icon :twitter, "@#{@profile.twitter}" li.list-group-item
h5.list-group-item-heading = PersonalProfile.human_attribute_name :twitter
p.list-group-item-text
= link_to "@#{@profile.twitter}", "https://twitter.com/#{@profile.twitter}", target: '_blank'
- if @profile.github.present? - if @profile.github.present?
p = icon :github, @profile.github li.list-group-item
h5.list-group-item-heading = PersonalProfile.human_attribute_name :github
p.list-group-item-text
= link_to @profile.github, "https://github.com/#{@profile.github}", target: '_blank'
- if @profile.public_email.present? - if @profile.public_email.present?
p = icon :envelope, "#{@profile.public_email} (#{PersonalProfile.human_attribute_name(:public_email).mb_chars.downcase})" li.list-group-item
p = icon :envelope, "#{@user.email} (#{User.human_attribute_name(:email).mb_chars.downcase})" h5.list-group-item-heading = PersonalProfile.human_attribute_name :public_email
p.list-group-item-text = @profile.public_email
li.list-group-item
h5.list-group-item-heading = t '.private_email'
p.list-group-item-text = @user.email
.panel-footer
.text-right
.btn-group.btn-group-sm
= action_buttons @conference, @profile, [:edit, :destroy]
.col-sm-7.col-md-8
h2 = t '.talk_history'
.panel.panel-default
- if @user.events_participated_in.any? - if @user.events_participated_in.any?
h4 = t '.event_propositions'
table.table.table-striped.table-hover.record-table table.table.table-striped.table-hover.record-table
thead thead
tr tr
th th
= Event.human_attribute_name :title = Event.human_attribute_name :title
th.text-center th.text-center.hidden-md.hidden-sm.hidden-xs
= Event.human_attribute_name :rank = Event.human_attribute_name :rank
th th.hidden-md.hidden-sm.hidden-xs
= Event.human_attribute_name :conference = Event.human_attribute_name :conference
th th.hidden-md.hidden-sm.hidden-xs
= Event.human_attribute_name :status = Event.human_attribute_name :status
th th
tbody tbody
- @user.events_participated_in.order(created_at: :desc).each do |event| - @user.events_participated_in.order(created_at: :desc).each do |event|
tr tr
td = event.title td = event.title
td.text-center td.text-center.hidden-md.hidden-sm.hidden-xs
- if event.ranked? - if event.ranked?
.large .large
.label.label-info = event.rank .label.label-info = event.rank
td = event.conference.title td.hidden-md.hidden-sm.hidden-xs
td = event.conference.title
td.hidden-md.hidden-sm.hidden-xs
span class="label label-lg label-#{proposition_status_class(event.status)}" span class="label label-lg label-#{proposition_status_class(event.status)}"
= icon(proposition_status_glyph(event.status), t("activerecord.attributes.proposition.statuses.#{event.status}")) = icon(proposition_status_glyph(event.status), t("activerecord.attributes.proposition.statuses.#{event.status}"))
td.actions td.actions
.btn-group.btn-group-sm .btn-group.btn-group-sm
= action_buttons event.conference, event, [:show] = action_buttons event.conference, event, [:show]
.panel-footer
.text-right
.btn-group.btn-group-sm
= action_buttons @conference, @profile, [:edit, :destroy]