Initial views.
[ecs.git] / app / views / admin / ressources / list.html.haml
blob77cf3362ced4bb675adc678b9470ae3507470ad2
1 -#
2   Copyright (C) 2007, 2013 Heiko Bernloehr (FreeIT.de).
3   
4   This file is part of ECS.
5   
6   ECS is free software: you can redistribute it and/or modify it
7   under the terms of the GNU Affero General Public License as
8   published by the Free Software Foundation, either version 3 of
9   the License, or (at your option) any later version.
10   
11   ECS is distributed in the hope that it will be useful, but
12   WITHOUT ANY WARRANTY; without even the implied warranty of
13   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14   Affero General Public License for more details.
15   
16   You should have received a copy of the GNU Affero General Public
17   License along with ECS. If not, see <http://www.gnu.org/licenses/>.
20 %h1.box1 Listing Ressources (#{@list_ressources_count.to_s})
22 .text-link= link_to 'New resource', new_admin_ressource_path
25   %table.list
26     %tr.table-resource-label
27       %th.box2 &uarr; Namespace
28       %th.box2 ID
29       %th.box2 &uarr; Name
30       %th.box2 Postrouted
31       %th.box2 Events
32       %th.box2(align="center") Operations:
33     %tr
35     - @ressources.group_by(&:namespace).sort{|x,y| x[0].downcase <=> y[0].downcase}.each do |ns, ressources|
36       - ns_printed= false
37       - ressources.sort{|x,y| x.ressource.downcase <=> y.ressource.downcase}.each do |ressource|
38         %tr{:class => [cycle('list-line-odd', 'list-line-even')]}
39           -if ns_printed
40             %td.center "
41           - else
42             %td #{ns}
43           %td.center= ressource.id
44           %td= h ressource.ressource
45           %td.center= check_box_tag "ressource[postroute]",1,ressource.postroute, :disabled => true
46           %td.center= check_box_tag "ressource[events]",1,ressource.events, :disabled => true
47           %td
48             = link_to 'Show', admin_ressource_path(:id => ressource)
49             = link_to 'Edit', edit_admin_ressource_path(:id => ressource)
50             = link_to 'Destroy', admin_ressource_path(:id => ressource), :confirm => 'Are you sure?', :method => :delete
51           - ns_printed= true