2014-01-21 04:51:49 +00:00
|
|
|
|
= form_tag remove_members_path, id: 'members_form', method: :post do
|
|
|
|
|
%table.tablesorter{cellpadding: "0", cellspacing: "0"}
|
2012-09-11 17:02:09 +01:00
|
|
|
|
%thead
|
|
|
|
|
%tr
|
|
|
|
|
- if can? :remove_members, editable_object
|
|
|
|
|
%th
|
|
|
|
|
\
|
|
|
|
|
%th
|
|
|
|
|
= t("layout.collaborators.members")
|
|
|
|
|
- if can? :remove_member, editable_object
|
|
|
|
|
%th.buttons
|
|
|
|
|
= t("layout.remove")
|
|
|
|
|
%tbody
|
|
|
|
|
- members.each_with_index do |user, num|
|
2014-01-21 04:51:49 +00:00
|
|
|
|
%tr{id: "admin-table-members-row#{num}", class: cycle(:odd, :even)}
|
2012-09-11 17:02:09 +01:00
|
|
|
|
- if can? :remove_members, editable_object
|
|
|
|
|
%td
|
2014-01-21 04:51:49 +00:00
|
|
|
|
%span.niceCheck-main{id: "niceCheckbox#{num}", style: "background-position: 0px 0px; "}
|
2012-09-11 17:02:09 +01:00
|
|
|
|
= check_box_tag "user_remove[#{user.id}][]"
|
|
|
|
|
%td
|
|
|
|
|
.img
|
|
|
|
|
= image_tag avatar_url(user)
|
|
|
|
|
.forimg= link_to user.fullname, user_path(user)
|
|
|
|
|
- if can? :remove_member, editable_object
|
|
|
|
|
%td.buttons
|
2014-01-21 04:51:49 +00:00
|
|
|
|
= link_to "#{remove_member_path}?member_id=#{user.id}", method: :delete, confirm: t("layout.confirm") do
|
2012-09-11 17:02:09 +01:00
|
|
|
|
%span.delete
|
2013-07-24 21:31:49 +01:00
|
|
|
|
- if can? :remove_members, editable_object
|
2014-01-21 04:51:49 +00:00
|
|
|
|
= submit_tag t("layout.delete"), class: 'button', data: {'disable-with' => t('layout.processing')}
|
2012-09-11 17:02:09 +01:00
|
|
|
|
.both
|
|
|
|
|
|
|
|
|
|
- if can? :add_member, editable_object
|
|
|
|
|
.hr.top
|
|
|
|
|
= form_tag add_member_path do
|
|
|
|
|
.admin-search
|
2014-01-21 04:51:49 +00:00
|
|
|
|
= autocomplete_field_tag 'member_id', params[:member_id], autocomplete_user_uname_autocompletes_path, id_element: '#member_id_field'
|
|
|
|
|
= hidden_field_tag 'member_id', nil, id: 'member_id_field'
|
|
|
|
|
= submit_tag t('layout.add'), class: 'button', data: {'disable-with' => t('layout.processing')}
|
2012-09-11 17:02:09 +01:00
|
|
|
|
.both
|