summaryrefslogtreecommitdiff
path: root/app/views/intruders/_index_core.html.haml
blob: 1fca601678ccc7db002ff13332efeb22b48fd584 (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
41
42
43
44
45
46
%table.table.table-striped
  %tr
    %th
    %th= t('intruders.index.contact_ip')
    %th= t('intruders.index.points')
    %th= t('intruders.index.ban_last')
    %th= t('intruders.index.contact_count')
    %th= t('intruders.index.contact_last')
    %th= t('intruders.index.contacts_per_second')
    %th= t('intruders.index.user_agent')
    %th= t('intruders.index.to_user')
    %th

  
  - for intruder in intruders
    - if intruder.list_type == 'whitelist'
      - entry_class = 'success'
    - elsif intruder.bans.to_i > 0
      - entry_class = 'error'
    - elsif intruder.points.to_i > 0
      - entry_class = 'warn'
    - else
      - entry_class = ''
    %tr{:class => "table #{entry_class}"}
      %td
        - if entry_class == 'success'
          %i.icon-ok
        - elsif entry_class == 'error'
          %i.icon-fire
        - elsif entry_class == 'warn'
          %i.icon-warning-sign

      %td= intruder.contact_ip
      %td= intruder.points
      %td 
        - if intruder.ban_last
          = l intruder.ban_last, :format => :short

      %td= intruder.contact_count
      %td
        - if intruder.contact_last
          = l intruder.contact_last, :format => :short
      %td= intruder.contacts_per_second
      %td= intruder.user_agent
      %td= intruder.to_user
      =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:child => intruder}