Second part of admin-namespace-reorder. Also renamed OrderGroup into Ordergroup. More view-sharing between groups is neccessary.

This commit is contained in:
Benjamin Meichsner 2009-01-14 12:46:01 +01:00
parent 2d5dc03b90
commit fadc951208
83 changed files with 410 additions and 518 deletions

View file

@ -1,27 +0,0 @@
%p
%table{:style => "width:100%"}
%tr
%td
= pagination_links_remote @groups
%td{:style => "text-align:right"}
- if @total > 20
= items_per_page
%table.list
%thead
%tr
%th Name
%th Typ
%th Mitglieder
%th
%tbody
- for group in @groups
%tr{:class => cycle('even','odd', :name => 'groups')}
%td= link_to group.name, :action => 'showGroup', :id => group
%td= group.is_a?(OrderGroup) ? 'Bestellgruppe' : 'Gruppe'
%td= group.users.size
%td
= link_to image_tag('b_users.png', :size => '16x16', :border => "0", :alt => 'Mitlglieder bearbeiten'), :action => 'members', :id => group
= link_to(image_tag('b_edit.png', :size => "16x16", :border => "0", :alt => 'Gruppe bearbeiten'), :action => 'editGroup', :id => group)
= link_to(image_tag('b_drop.png', :size => "16x16", :border => "0", :alt => 'Gruppe löschen'), {:action => 'destroyGroup', :id => group}, |
:confirm => 'Willst du ' + group.name + ' wirklich löschen?', |
:method => "post") |

View file

@ -37,14 +37,14 @@
<% for group in @groups %>
<tr class="<%= cycle('even','odd', :name => 'groups') %>">
<td><%= link_to group.name, :action => 'showGroup', :id => group %></td>
<td><%= group.is_a?(OrderGroup) ? 'Bestellgruppe' : 'Gruppe' %></td>
<td><%= group.is_a?(Ordergroup) ? 'Bestellgruppe' : 'Gruppe' %></td>
<td><%= group.users.size %></td>
</tr>
<% end %>
</table>
<br />
<%= link_to 'Alle Gruppen', :action => 'listGroups' %> |
<%= link_to "Neue Bestellgruppe", :action => "newOrderGroup" %> |
<%= link_to "Neue Bestellgruppe", :action => "newOrdergroup" %> |
<%= link_to "Neue Gruppe", :action => "newGroup" %>
</div>
</div>

View file

@ -1,2 +0,0 @@
<%= render :partial => 'groups/edit_members' %>
<p style="clear:both"><%= link_to 'Gruppenübersicht', :action => 'listGroups' %></p>

View file

@ -1,8 +0,0 @@
<h1>Neue <%= @group.is_a?(OrderGroup) ? 'Bestellgruppe' : 'Gruppe' %></h1>
<div class="edit_form" style="width:50em">
<% form_tag(:action => (@group.is_a?(OrderGroup) ? 'createOrderGroup' : 'createGroup')) do %>
<%= render :partial => 'groups/form' %>
<br style="clear:both" />
<%= submit_tag "Speichern" %> | <%= link_to "Abbrechen", :action => "listGroups" %>
<% end %>
</div>

View file

@ -0,0 +1,45 @@
- form_for [:admin, @ordergroup] do |@form|
= @form.error_messages
%div{:style => "float:left;width:55%;"}
%p
= @form.label :name
%br/
= @form.text_field :name, :size => 20
%p
= @form.label :description
%br/
= @form.text_field :description, :size => 40
%p
= @form.label :actual_size, "Aktuelle Gruppengröße"
%br/
= @form.text_field :actual_size, :size => 3
%div{:style => "float:right;width:40%"}
%h3 Gruppe hat Zugriff auf
%table
%tr
%td
= @form.label :role_admin, "Administration"
%td= @form.check_box :role_admin
%tr
%td
= @form.label :role_finance, "Finanzen"
%td= @form.check_box :role_finance
%tr
%td
= @form.label :role_suppliers, "Lieferantenverwaltung"
%td= @form.check_box :role_suppliers
%tr
%td
= @form.label :role_article_meta, "Artikelverwaltung"
%td= @form.check_box :role_article_meta
%tr
%td
= @form.label :role_orders, "Bestellungsverwaltung"
%td= @form.check_box :role_orders
%br{ :style => "clear:both" }
= submit_tag "Speichern"
|
= link_to "Abbrechen", admin_ordergroups_path

View file

@ -0,0 +1,24 @@
%p
%table{:style => "width:100%"}
%tr
%td
= pagination_links_remote @ordergroups, { :update => "ordergroups" }
%td{:style => "text-align:right"}
- if @total > 20
= items_per_page :update => "ordergroups"
%table.list
%thead
%tr
%th Name
%th Mitglieder
%th
%tbody
- for ordergroup in @ordergroups
%tr{:class => cycle('even','odd', :name => 'groups')}
%td= link_to ordergroup.name, [:admin, ordergroup]
%td= ordergroup.users.size
%td
= link_to image_tag('b_users.png', :size => '16x16', :border => "0", :alt => 'Mitlglieder bearbeiten'), memberships_admin_ordergroup_path(ordergroup)
= link_to(image_tag('b_edit.png', :size => "16x16", :border => "0", :alt => 'Gruppe bearbeiten'), edit_admin_ordergroup_path(ordergroup))
= link_to(image_tag('b_drop.png', :size => "16x16", :border => "0", :alt => 'Gruppe löschen'), [:admin, ordergroup], |
:confirm => 'Willst du ' + ordergroup.name + ' wirklich löschen?', :method => :delete) |

View file

@ -0,0 +1,4 @@
- title "Bestellgruppe bearbeiten"
.edit_form{:style => "width:50em"}
= render :partial => 'form'

View file

@ -1,14 +1,17 @@
%h1=_ 'Groups'
- title "Bestellgruppen"
%p
%i
Hier kannst du
= link_to 'neue Gruppen', :action => 'newGroup'
und
= link_to 'neue Bestellgruppen', :action => 'newOrderGroup'
= link_to 'neue Bestellgruppen', new_admin_ordergroup_path
anlegen, Gruppen bearbeiten und löschen.
%p
Beachte dabei den <em>Unterschied zwischen Gruppe und Bestellgruppe</em>:
Eine <em>Bestellgruppe</em> hat ein Konto und kann Essen bestellen, eine <em>Gruppe</em> ist eine Arbeitsgruppe wie z.B. die "Sortiergruppe".
Eine Bestellgruppe hat ein Konto und kann Essen bestellen. In einer
%em= link_to 'Arbeisgruppe', admin_workgroups_path
(z.b. 'Soritiergruppe')
koordinieren sich die Mitglieder mittels Aufgaben und Nachrichten.
Nutzer_innen können immer nur einer Bestellgruppe, aber beliebig vielen anderen Gruppen angehören.
.left_column{:style => "width:100%"}
.box_title
@ -16,17 +19,16 @@
.column_content
#group_filter
%form{:name=>"sform", :action=>"", :style=>"display:inline;"}
%label{:for => 'article_name'} Suche in Name :
%label{:for => 'ordergroup_name'} Suche in Name :
= text_field_tag("query", params['query'], :size => 10 )
= observe_field 'query', :frequency => 2, |
:before => "Element.show('loader')", |
:success => "Element.hide('loader')", |
:url => {:action => 'listGroups'}, |
:with => 'query' |
#table
= render :partial => "listGroups"
- if @current_user.role_admin?
= link_to 'Neue Gruppe', :action => 'newGroup'
|
= link_to 'Neue Bestellgruppe', :action => 'newOrderGroup'
:update => "ordergroups", |
:url => admin_ordergroups_path, |
:with => 'query', |
:method => :get |
#ordergroups
= render :partial => "ordergroups"
= link_to 'Neue Arbeits', new_admin_ordergroup_path

View file

@ -0,0 +1,3 @@
= render :partial => 'admin/memberships/edit_members'
%p{ :style => "clear:both" }
= link_to 'Gruppenübersicht', admin_ordergroups_path

View file

@ -0,0 +1,4 @@
- title "Bestellgruppe anlegen"
.edit_form{:style => "width:50em"}
= render :partial => 'form'

View file

@ -0,0 +1,42 @@
- title "Arbeitsgruppe #{@ordergroup.name}"
.left_column{:style => "width:45em"}
.box_title
%h2 Übersicht
.column_content
%p
%b Beschreibung:
=h @ordergroup.description
%p
%b Gruppe hat Zugriff auf:
- roles = Array.new
- roles << 'Administration' if @ordergroup.role_admin?
- roles << 'Finanzen' if @ordergroup.role_finance?
- roles << 'Lieferanten' if @ordergroup.role_suppliers?
- roles << 'Artikel' if @ordergroup.role_article_meta?
- roles << 'Bestellungsverwaltung' if @ordergroup.role_orders?
=h roles.join(', ')
%p
- if @ordergroup.weekly_task
%b wöchentlicher Job:
=h @ordergroup.task_name
am
= weekday(@ordergroup.weekday)
- else
kein wöchentlicher Job definiert
= link_to 'Gruppe bearbeiten', edit_admin_ordergroup_path(@ordergroup)
|
= link_to 'Löschen', [:admin, @ordergroup], :confirm => 'Bist Du sicher?', :method => :delete
|
= link_to 'Nachricht senden', :controller => 'messages', :action => 'group', :id => @ordergroup
.box_title
%h2 Mitglieder
.column_content
- if @ordergroup.memberships.empty?
%i Diese Gruppe hat derzeit keine Mitglieder
- else
%ul{:style => "list-style-type:decimal;"}
- for membership in @ordergroup.memberships
%li= link_to membership.user.nick, [:admin, membership.user]
%p= link_to 'Mitglieder bearbeiten', memberships_admin_ordergroup_path(@ordergroup)
%p{:style => "clear:both"}= link_to "Gruppenübersicht", admin_ordergroups_path

View file

@ -1,54 +0,0 @@
%h1
= @group.is_a?(OrderGroup) ? "Bestellgruppe:" : "Gruppe:"
=h @group.name
.left_column{:style => "width:45em"}
.box_title
%h2 Übersicht
.column_content
%p
%b Beschreibung:
=h @group.description
- if @group.is_a?(OrderGroup)
%p
%b Gruppengröße:
= @group.actual_size
%p
%b Kontostand:
= @group.account_balance
%p
%b Kontostand aktualisiert:
= @group.account_updated
%p
%b Gruppe hat Zugriff auf:
- roles = Array.new
- roles << 'Administration' if @group.role_admin?
- roles << 'Finanzen' if @group.role_finance?
- roles << 'Lieferanten' if @group.role_suppliers?
- roles << 'Artikel' if @group.role_article_meta?
- roles << 'Bestellungsverwaltung' if @group.role_orders?
=h roles.join(', ')
%p
- if @group.weekly_task
%b wöchentlicher Job:
=h @group.task_name
am
= weekday(@group.weekday)
- else
kein wöchentlicher Job definiert
= link_to 'Gruppe bearbeiten', :action => 'editGroup', :id => @group
|
= link_to 'Löschen', { :action => 'destroyGroup', :id => @group }, :confirm => 'Bist Du sicher?', :method => "post"
|
= link_to 'Nachricht senden', :controller => 'messages', :action => 'group', :id => @group
.box_title
%h2 Mitglieder
.column_content
- if @group.memberships.empty?
%i Diese Gruppe hat derzeit keine Mitglieder
- else
%ul{:style => "list-style-type:decimal;"}
- for membership in @group.memberships
%li= link_to membership.user.nick, :action => 'showUser', :id => membership.user
%p= link_to 'Mitglieder bearbeiten', :action => 'members', :id => @group
%p{:style => "clear:both"}= link_to "Gruppenübersicht", :action => "listGroups"

View file

@ -2,10 +2,10 @@
%table{:style => "width:100%"}
%tr
%td
= pagination_links_remote @workgroups
= pagination_links_remote @workgroups, { :update => "workgroups" }
%td{:style => "text-align:right"}
- if @workgroups.size > 20
= items_per_page
- if @total.size > 20
= items_per_page :update => "workgroups"
%table.list
%thead
%tr