summaryrefslogtreecommitdiff
path: root/app/views/users/_index_core.html.haml
blob: 70384576dccc8943425bc530ae2428a284c3f862 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
- cache(['user_table_row_inner_td', I18n.locale, current_user, users.reorder(:updated_at).last, users.first, users.last, GsParameter.get('NUMBER_OF_SHOWN_ITEMS')]) do

  - if defined?(users.total_pages)
    = will_paginate users, :renderer => BootstrapPagination::Rails, :previous_label => raw('<i class = "icon-chevron-left"></i>'), :next_label => raw('<i class = "icon-chevron-right"></i>')
    
  %table.table.table-striped
    %thead
      %tr
        %th
        %th= sortable :user_name, t('users.index.user_name')
        %th
          %span.hidden-phone
            = sortable :email, t('users.index.email')
        %th
          %span.hidden-phone
            = sortable :first_name, t('users.index.first_name')
        %th= sortable :last_name, t('users.index.last_name')

    %tbody
      - for user in users
        - cache(['user_table_row', I18n.locale, current_user, user]) do
          %tr
            %td
              - if user.image?
                =image_tag(user.image_url(:mini).to_s, :class => 'img-rounded')
              - else
                - if user.male?
                  = image_tag 'icons/user-male-16x.png', :class => 'img-rounded'
                - else
                  = image_tag 'icons/user-female-16x.png', :class => 'img-rounded'
            %td= user.user_name
            %td
              - if !user.email.blank?
                %span.hidden-phone
                  = mail_to user.email, (Haml::Engine.new("%i.icon-envelope").render + ' ' + user.email)
            %td
              %span.hidden-phone
                = user.first_name
            %td= user.last_name
            =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:parent => @tenant, :child => user}