clarion/app/views/management/personal_profiles/index.html.slim

60 lines
2.7 KiB
Plaintext
Raw Normal View History

2016-10-09 03:56:41 +03:00
- content_for :title
= Conference.human_attribute_name(:participants).mb_chars.capitalize
.row
.col-lg-12
h1.page-header
= Conference.human_attribute_name(:participants).mb_chars.capitalize
small<
| (
= t '.total', current: @users.count, total: current_conference.participants.count
=< User.model_name.human(count: current_conference.participants.count).mb_chars.downcase
| )
2015-05-10 13:36:29 +03:00
.row
.col-lg-12
.panel.panel-default
2016-10-09 03:56:41 +03:00
table.table.table-striped.table-hover.record-table#profiles
thead
tr
th = PersonalProfile.model_name.human
th.actions
tbody
- @users.each do |user|
- profile = user.personal_profile(@conference)
2016-10-09 04:04:05 +03:00
= content_tag :tr, class: profile.present? ? nil : 'warning'
2016-10-09 03:56:41 +03:00
td
.media
.media-left
- if profile.present?
= image_tag(profile.picture.variant(resize_to_fill: [50, 50]))
2016-10-09 03:56:41 +03:00
- else
= image_tag('avatar-placeholder')
2016-10-09 03:56:41 +03:00
.media-body
h4.media-heading
- if profile.try(:name).present?
= profile.name
2015-07-30 21:19:03 +03:00
- else
2016-10-09 03:56:41 +03:00
= user.email
p
- if profile.present?
- if profile.public_email.present?
= icon :envelope, "#{profile.public_email} (#{PersonalProfile.human_attribute_name(:public_email).mb_chars.downcase})"
br
= icon :envelope, "#{user.email} (#{User.human_attribute_name(:email).mb_chars.downcase})"
- else
= t '.no_profile'
td.actions
div.btn-group.btn-group-sm
- if profile.present?
= action_buttons(@conference, profile, [:show, :edit, :destroy])
- else
2016-10-09 04:45:01 +03:00
- if user.personal_profiles.any?
= link_to [:management, @conference, :personal_profiles, {personal_profile: {user_id: user.id}}], class: ['btn', 'btn-primary'], title: t('actions.clone.title', model: PersonalProfile.model_name.human), method: :post do
=> icon('clone')
2016-10-09 03:56:41 +03:00
= link_to [:new, :management, @conference, :personal_profile, {user_id: user.id}], class: ['btn', 'btn-primary'], title: t('actions.create.title', model: PersonalProfile.model_name.human) do
=> icon('user-plus')
.panel-footer.text-right
= link_to management_conference_personal_profiles_path(current_conference, format: 'csv'), class: 'btn btn-info'
= icon :download, t('.export')