aboutsummaryrefslogtreecommitdiff
path: root/app/views/admin/ressources/list.html.haml
blob: 77cf3362ced4bb675adc678b9470ae3507470ad2 (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
47
48
49
50
51
-#
  Copyright (C) 2007, 2013 Heiko Bernloehr (FreeIT.de).
  
  This file is part of ECS.
  
  ECS is free software: you can redistribute it and/or modify it
  under the terms of the GNU Affero General Public License as
  published by the Free Software Foundation, either version 3 of
  the License, or (at your option) any later version.
  
  ECS is distributed in the hope that it will be useful, but
  WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  Affero General Public License for more details.
  
  You should have received a copy of the GNU Affero General Public
  License along with ECS. If not, see <http://www.gnu.org/licenses/>.


%h1.box1 Listing Ressources (#{@list_ressources_count.to_s})

.text-link= link_to 'New resource', new_admin_ressource_path

%p
  %table.list
    %tr.table-resource-label
      %th.box2 &uarr; Namespace
      %th.box2 ID
      %th.box2 &uarr; Name
      %th.box2 Postrouted
      %th.box2 Events
      %th.box2(align="center") Operations:
    %tr

    - @ressources.group_by(&:namespace).sort{|x,y| x[0].downcase <=> y[0].downcase}.each do |ns, ressources|
      - ns_printed= false
      - ressources.sort{|x,y| x.ressource.downcase <=> y.ressource.downcase}.each do |ressource|
        %tr{:class => [cycle('list-line-odd', 'list-line-even')]}
          -if ns_printed
            %td.center "
          - else
            %td #{ns}
          %td.center= ressource.id
          %td= h ressource.ressource
          %td.center= check_box_tag "ressource[postroute]",1,ressource.postroute, :disabled => true
          %td.center= check_box_tag "ressource[events]",1,ressource.events, :disabled => true
          %td
            = link_to 'Show', admin_ressource_path(:id => ressource)
            = link_to 'Edit', edit_admin_ressource_path(:id => ressource)
            = link_to 'Destroy', admin_ressource_path(:id => ressource), :confirm => 'Are you sure?', :method => :delete
          - ns_printed= true