diff options
author | Heiko Bernloehr <Heiko.Bernloehr@FreeIT.de> | 2013-01-11 03:59:38 +0100 |
---|---|---|
committer | Heiko Bernloehr <Heiko.Bernloehr@FreeIT.de> | 2013-01-11 04:03:30 +0100 |
commit | 9d5150d60babc1ae951d51bbc1d46a1551151a8c (patch) | |
tree | d612c90252d015e5b39499fc1b7908d04e46bd0f /app | |
parent | 285eb3ce0c7ab487db6a7b6ee813576414fad465 (diff) | |
download | ecs2-9d5150d60babc1ae951d51bbc1d46a1551151a8c.tar.gz ecs2-9d5150d60babc1ae951d51bbc1d46a1551151a8c.zip |
Ordering admin views.
List views of communities, organizations, participants and ressources
are now ordered.
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/admin/communities_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/admin/organizations_controller.rb | 2 | ||||
-rw-r--r-- | app/views/admin/communities/list.html.erb | 4 | ||||
-rw-r--r-- | app/views/admin/organizations/list.html.erb | 6 | ||||
-rw-r--r-- | app/views/admin/participants/list.html.haml | 8 | ||||
-rw-r--r-- | app/views/admin/ressources/list.html.haml | 6 |
6 files changed, 14 insertions, 14 deletions
diff --git a/app/controllers/admin/communities_controller.rb b/app/controllers/admin/communities_controller.rb index a9cfbed..3d15e0c 100644 --- a/app/controllers/admin/communities_controller.rb +++ b/app/controllers/admin/communities_controller.rb @@ -31,7 +31,7 @@ class Admin::CommunitiesController < ApplicationController end def list - @communities=Community.find(:all).uniq.sort{|x,y| x.id <=> y.id } + @communities=Community.find(:all).uniq end def show diff --git a/app/controllers/admin/organizations_controller.rb b/app/controllers/admin/organizations_controller.rb index 9dca590..d16d07d 100644 --- a/app/controllers/admin/organizations_controller.rb +++ b/app/controllers/admin/organizations_controller.rb @@ -31,7 +31,7 @@ class Admin::OrganizationsController < ApplicationController end def list - @organizations=Organization.find(:all).uniq.sort{|x,y| x.id <=> y.id } + @organizations=Organization.find(:all).uniq end def show diff --git a/app/views/admin/communities/list.html.erb b/app/views/admin/communities/list.html.erb index ed07ff5..eb77997 100644 --- a/app/views/admin/communities/list.html.erb +++ b/app/views/admin/communities/list.html.erb @@ -28,13 +28,13 @@ License along with ECS. If not, see <http://www.gnu.org/licenses/>. <TR class="table-resource-label"> <TH class="box2">Id</TH> - <TH class="box2">Name</TH> + <TH class="box2">↑ Name</TH> <TH class="box2">Description (optional)</TH> <TH class="box2" align="center">Operations</TH> </TR> <tr></tr> - <% for community in @communities %> + <% for community in @communities.sort_by(&:name) %> <tr valign="top" class="<%= cycle('list-line-odd', 'list-line-even') %>"> <TD> <%= community.id %></TD> <TD> <%= h community.name %> </TD> diff --git a/app/views/admin/organizations/list.html.erb b/app/views/admin/organizations/list.html.erb index 360d008..e53610b 100644 --- a/app/views/admin/organizations/list.html.erb +++ b/app/views/admin/organizations/list.html.erb @@ -27,15 +27,15 @@ License along with ECS. If not, see <http://www.gnu.org/licenses/>. <table class="list"> <TR class="table-resource-label"> - <TH class="box2">Id</TH> - <TH class="box2">Name</TH> + <TH class="box2">ID</TH> + <TH class="box2">↑ Name</TH> <TH class="box2">Abreviation</TH> <TH class="box2">Description</TH> <TH class="box2" align="center">Operations</TH> </TR> <tr></tr> - <% for organization in @organizations %> + <% for organization in @organizations.sort_by(&:name) %> <tr valign="top" class="<%= cycle('list-line-odd', 'list-line-even') %>"> <TD> <%= organization.id %></TD> <TD> <%= h organization.name %> </TD> diff --git a/app/views/admin/participants/list.html.haml b/app/views/admin/participants/list.html.haml index f4a5640..766d163 100644 --- a/app/views/admin/participants/list.html.haml +++ b/app/views/admin/participants/list.html.haml @@ -28,17 +28,17 @@ %p %table.list %tr.table-resource-label - %th.box2 Organi-<br/>zation: + %th.box2 ↑ OrgAbrev: %th.box2 ID: - %th.box2 Name: + %th.box2 ↑ Name: %th.box2 Description (optional): %th.box2 Self-<br/>routing: %th.box2(align="center") Operations: %tr - - @participants.group_by(&:organization_id).each do |orgid,participants| + - @participants.group_by(&:organization_id).sort{|x,y| Organization.find(x[0]).abrev.downcase <=> Organization.find(y[0]).abrev.downcase}.each do |orgid,participants| - org_printed= false - - participants.each do |participant| + - participants.sort_by(&:name).each do |participant| %tr{:class => [cycle('list-line-odd', 'list-line-even')]} - if org_printed %td.center " diff --git a/app/views/admin/ressources/list.html.haml b/app/views/admin/ressources/list.html.haml index ca6889f..d438fd0 100644 --- a/app/views/admin/ressources/list.html.haml +++ b/app/views/admin/ressources/list.html.haml @@ -24,9 +24,9 @@ %p %table.list %tr.table-resource-label - %th.box2 Namespace + %th.box2 ↑ Namespace %th.box2 ID - %th.box2 Name + %th.box2 ↑ Name %th.box2 Postrouted %th.box2 Events %th.box2(align="center") Operations: @@ -34,7 +34,7 @@ - @ressources.group_by(&:namespace).each do |ns, ressources| - ns_printed= false - - ressources.each do |ressource| + - ressources.sort_by(&:ressource).each do |ressource| %tr{:class => [cycle('list-line-odd', 'list-line-even')]} -if ns_printed %td.center " |