Admin interface #6

Merged
ignisf merged 23 commits from admin-interface into master 2014-10-06 12:33:26 +03:00
3 changed files with 21 additions and 8 deletions
Showing only changes of commit 2d285b5cc9 - Show all commits

View File

@ -5,6 +5,19 @@
vertical-align: middle !important;
}
th.picture, td.picture {
text-align: center;
width: 60px;
}
th.admin, td.admin {
width: 60px;
}
th.actions, td.actions {
width: 120px;
}
.picture-placeholder {
@extend .img-thumbnail;
@ -16,7 +29,7 @@
}
}
.actions {
.actions div {
@extend .pull-right;
@extend .btn-group;
white-space: nowrap;

View File

@ -1,5 +1,5 @@
tr id="user-#{user.id}"
td
td.picture
- if user.speaker_profile.present?
= image_tag user.speaker_profile.picture.thumb.url, class: 'img-thumbnail'
- else
@ -8,15 +8,15 @@ tr id="user-#{user.id}"
td = user.email
td = user.speaker_profile.try(:first_name) or '-'
td = user.speaker_profile.try(:last_name) or '-'
td
td.admin
- if user.admin?
span.toggle
= link_to glyph(:check), toggle_admin_management_user_path(user), remote: true, method: :post, data: {confirm: t(:are_you_sure)}, class: 'checked'
- else
span.toggle
= link_to glyph(:unchecked), toggle_admin_management_user_path(user), remote: true, method: :post, data: {confirm: t(:are_you_sure)}, class: 'unchecked'
td
.actions
td.actions
div
= link_to management_user_path(user), title: t(:view), remote: true, disabled: user.speaker_profile.blank?
= glyph(:share)
= link_to edit_management_user_path(user), title: t(:edit)

View File

@ -5,11 +5,11 @@
table.record-table
thead
tr
th = SpeakerProfile.human_attribute_name(:picture)
th.picture = SpeakerProfile.human_attribute_name(:picture)
th = User.human_attribute_name(:email)
th = SpeakerProfile.human_attribute_name(:first_name)
th = SpeakerProfile.human_attribute_name(:last_name)
th = SpeakerProfile.human_attribute_name(:admin)
th
th.admin = SpeakerProfile.human_attribute_name(:admin)
th.actions
tbody
= render @users