diff --git a/app/controllers/admin/ordergroups_controller.rb b/app/controllers/admin/ordergroups_controller.rb index f7f1524e..4613ccae 100644 --- a/app/controllers/admin/ordergroups_controller.rb +++ b/app/controllers/admin/ordergroups_controller.rb @@ -35,7 +35,7 @@ class Admin::OrdergroupsController < ApplicationController end def create - @ordergroup = Ordergroup.new(params[:Ordergroup]) + @ordergroup = Ordergroup.new(params[:ordergroup]) if @ordergroup.save flash[:notice] = 'Ordergroup was successfully created.' @@ -48,7 +48,7 @@ class Admin::OrdergroupsController < ApplicationController def update @ordergroup = Ordergroup.find(params[:id]) - if @ordergroup.update_attributes(params[:Ordergroup]) + if @ordergroup.update_attributes(params[:ordergroup]) flash[:notice] = 'Ordergroup was successfully updated.' redirect_to([:admin, @ordergroup]) else diff --git a/app/models/ordergroup.rb b/app/models/ordergroup.rb index 9a975820..edcdef41 100644 --- a/app/models/ordergroup.rb +++ b/app/models/ordergroup.rb @@ -41,8 +41,6 @@ class Ordergroup < Group validates_inclusion_of :actual_size, :in => 1..99 validates_numericality_of :account_balance, :message => 'ist keine gültige Zahl' - attr_accessible :actual_size, :account_updated - def non_members User.all(:order => 'nick').reject { |u| (users.include?(u) || u.ordergroup) } end diff --git a/app/views/admin/index.html.haml b/app/views/admin/index.html.haml new file mode 100644 index 00000000..a4342a37 --- /dev/null +++ b/app/views/admin/index.html.haml @@ -0,0 +1,45 @@ +- title "Administration" + +%p + %i Hier kannst Du die Gruppen und Benutzer der Foodsoft verwalten. +.left_column{:style => "width:48%"} + .box_title + %h2 Neuste Benutzer + .column_content + %table + %tr + %th Nick + %th Name + %th Erstellt am + - for user in @users + %tr{:class => cycle('even','odd', :name => 'users')} + %td= link_to user.nick, [:admin, user] + %td= [user.first_name, user.last_name].join(", ") + %td= format_date(user.created_on) + %br/ + = link_to 'Alle Benutzerinnen', admin_users_path + | + = link_to "Neue Benutzerin", new_admin_user_path + +.right_column{:style => "width:48%"} + .box_title + %h2 Neuste Gruppen + .column_content + %table + %tr + %th Name + %th Typ + %th Mitglieder + - for group in @groups + %tr{:class => cycle('even','odd', :name => 'groups')} + %td= link_to group.name, [:admin, group] + %td= group.class.human_name + %td= group.users.size + %br/ + = link_to 'Alle Bestellgruppen', admin_ordergroups_path + | + = link_to "Neue Bestellgruppe", new_admin_ordergroup_path + | + = link_to 'Alle Arbeitsgruppen', admin_workgroups_path + | + = link_to "Neue Arbeitsgruppe", new_admin_workgroup_path diff --git a/app/views/admin/index.rhtml b/app/views/admin/index.rhtml deleted file mode 100644 index 8e16c6fc..00000000 --- a/app/views/admin/index.rhtml +++ /dev/null @@ -1,51 +0,0 @@ -

Administration

- -

Hier kannst Du die Gruppen und Benutzer der Foodsoft verwalten.

-
-

Neuste Benutzer

-
- - - - - - - - <% for user in @users %> - - - - - - <% end %> -
NickNameErstellt am
<%= link_to user.nick, [:admin, user] %><%= user.first_name %> <%= user.last_name %><%= format_date(user.created_on) %>
-
- <%= link_to 'Alle Benutzerinnen', :action => 'listUsers' %> | - <%= link_to "Neue Benutzerin", :action => "newUser" %> -
-
- -
-

Neuste Gruppen

-
- - - - - - - <% for group in @groups %> - - - - - - <% end %> -
NameTypMitglieder
<%= link_to group.name, [:admin, group] %><%= group.class.human_name %><%= group.users.size %>
-
- <%= link_to 'Alle Gruppen', :action => 'listGroups' %> | - <%= link_to "Neue Bestellgruppe", :action => "newOrdergroup" %> | - <%= link_to "Neue Gruppe", :action => "newGroup" %> -
-
- diff --git a/config/locales/de.yml b/config/locales/de.yml index cd123099..be6214a9 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -119,6 +119,9 @@ de: even: "muss gerade sein" models: article: Artikel + user: Benutzerinnen + workgroup: Arbeitsgruppe + ordergroup: Bestellgruppe attributes: article: price: Nettopreis