Reimplement the personal profile UI

This commit is contained in:
Petko Bordjukov 2016-10-09 05:20:46 +03:00
parent 74e778860a
commit de5795910f
3 changed files with 65 additions and 32 deletions

View File

@ -41,7 +41,7 @@
hr hr
p p
= t('.no_profile') = t('.no_profile')
=< link_to icon(:plus, t('.create_profile')), new_management_conference_personal_profile_path(conference_id: @conference.id, user_id: speaker.id), class: ['btn', 'btn-primary', 'btn-xs'] =< link_to icon('user-plus', t('.create_profile')), new_management_conference_personal_profile_path(conference_id: @conference.id, user_id: speaker.id), class: ['btn', 'btn-primary', 'btn-xs']
- if speaker.events_participated_in.where.not(id: @event.id).any? - if speaker.events_participated_in.where.not(id: @event.id).any?
h4 = t '.previous_event_propositions' h4 = t '.previous_event_propositions'
@ -74,4 +74,10 @@
.panel-footer .panel-footer
.text-right .text-right
.btn-group.btn-group-sm .btn-group.btn-group-sm
= action_buttons @conference, personal_profile, [:show, :edit] - if personal_profile.conference == @conference
= action_buttons @conference, personal_profile, [:show, :edit]
- else
= link_to [:management, @conference, :personal_profiles, {personal_profile: {user_id: speaker.id}}], class: ['btn', 'btn-primary'], title: t('actions.clone.title', model: PersonalProfile.model_name.human), method: :post do
=> icon('clone')
= link_to [:new, :management, @conference, :personal_profile, {user_id: speaker.id}], class: ['btn', 'btn-primary'], title: t('actions.create.title', model: PersonalProfile.model_name.human) do
=> icon('user-plus')

View File

@ -2,38 +2,62 @@
= @profile.name = @profile.name
.row .row
.speaker-profile .col-lg-12
.panel.panel-default h1.page-header
.panel-heading = PersonalProfile.model_name.human.mb_chars.capitalize
h1.panel-title
= @profile.name .panel.panel-default
= link_to icon(:edit), [:edit, :management, @conference, @profile], class: 'btn btn-xs btn-danger pull-right' .panel-body
.panel-body .media
.center .media-left.hidden-sm.hidden-xs
= image_tag @profile.picture.medium.url, class: "profile-image" = image_tag @profile.picture.medium.url, class: "profile-image"
- if @profile.organisation.present? .media-body
div .text-center.visible-sm.visible-xs
=> icon :briefcase = image_tag @profile.picture.medium.url, class: "profile-image img-thumbnail"
= @profile.organisation h4.media-heading
div.social = @profile.name
= link_to "mailto://#{@user.email}" hr
= icon :envelope
- if @profile.github.present?
= link_to "https://github.com/#{@profile.github}"
= icon :github
- if @profile.twitter.present?
= link_to "https://twitter.com/#{@profile.twitter}"
= icon :twitter
hr
h4 = PersonalProfile.human_attribute_name(:biography) h4 = PersonalProfile.human_attribute_name(:biography)
= simple_format @profile.biography = simple_format @profile.biography
h4 = t '.contacts'
h4 = t :contacts - if @profile.organisation.present?
p = icon :briefcase, @profile.organisation
- if @profile.twitter.present? - if @profile.twitter.present?
p #{icon :twitter} @#{@profile.twitter} p = icon :twitter, "@#{@profile.twitter}"
- if @profile.github.present?
p = icon :github, @profile.github
- if @profile.public_email.present? - if @profile.public_email.present?
p #{icon :envelope} #{@profile.public_email} (#{t(:public)}) p = icon :envelope, "#{@profile.public_email} (#{PersonalProfile.human_attribute_name(:public_email).mb_chars.downcase})"
p #{icon :envelope} #{@user.email} (#{t(:private)}) p = icon :envelope, "#{@user.email} (#{User.human_attribute_name(:email).mb_chars.downcase})"
p #{glyph :phone} #{Phony.format(@profile.mobile_phone, format: :international)}
- if @user.events_participated_in.any?
h4 = t '.event_propositions'
table.table.table-striped.table-hover.record-table
thead
tr
th
= Event.human_attribute_name :title
th
= Event.human_attribute_name :conference
th
= Event.human_attribute_name :status
th
tbody
- @user.events_participated_in.order(created_at: :desc).each do |event|
tr
td = event.title
td = event.conference.title
td
span class="label label-lg label-#{proposition_status_class(event.status)}"
= icon(proposition_status_glyph(event.status), t("activerecord.attributes.proposition.statuses.#{event.status}"))
td.actions
.btn-group.btn-group-sm
= action_buttons event.conference, event, [:show]
.panel-footer
.text-right
.btn-group.btn-group-sm
= action_buttons @conference, @profile, [:edit, :destroy]

View File

@ -6,6 +6,9 @@ bg:
total: "%{current} от общо %{total}" total: "%{current} от общо %{total}"
create: create:
successfully_created: "Профилът беше създаден успешно." successfully_created: "Профилът беше създаден успешно."
show:
contacts: "Данни за контакт"
event_propositions: "Предложения за събития"
conferences: conferences:
show: show:
summary: 'Обобщение' summary: 'Обобщение'