Initial commit of foodsoft 2

This commit is contained in:
Benjamin Meichsner 2009-01-06 11:49:19 +01:00
commit 5b9a7e05df
657 changed files with 70444 additions and 0 deletions

View file

@ -0,0 +1,27 @@
%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

@ -0,0 +1,39 @@
%p
%table{:style => "width:100%"}
%tr
%td
= pagination_links_remote @users
%td{:style => "text-align:right"}
- if @total > 20
= items_per_page
%table.list
%thead
%tr
%th= _('Username')
%th= _('First name')
%th= _('Last name')
%th= _('Email')
%th= _('Roles')
%th= _('Last Login')
%th{:style => "width:3em"}
%tbody
- for user in @users
- roles = Array.new
- roles << 'Admin' if user.role_admin?
- roles << 'Finanzen' if user.role_finance?
- roles << 'Lieferanten' if user.role_suppliers?
- roles << 'Artikel' if user.role_article_meta?
- roles << 'Bestellung' if user.role_orders?
%tr{:class => cycle('even','odd', :name => 'users')}
%td= link_to user.nick, :action => 'showUser', :id => user
%td=h user.first_name
%td=h user.last_name
%td=h user.email
%td=h roles.join(', ')
%td=h FoodSoft::format_date_time(user.last_login)
%td
= link_to(image_tag('b_edit.png', :size => "16x16", :border => "0", :alt => 'Benutzer_in bearbeiten', :title => 'Benutzer_in bearbeiten'), :action => 'editUser', :id => user)
= link_to(image_tag('b_drop.png', :size => "16x16", :border => "0", :alt => 'Benutzer_in löschen', :title => 'Benutzer_in löschen'), |
{:action => 'destroyUser', :id => user}, |
:confirm => 'Willst du ' + user.first_name + ' wirklich löschen?', |
:method => "post") |

View file

@ -0,0 +1,5 @@
<% form_tag(:action => 'createUser') do %>
<%= render :partial => 'users/form' %>
<p style="clear:both;">
<%= submit_tag "Speichern" %> | <%= link_to_function('Abbrechen', 'Element.hide("newUser")')%></p>
<% end %>

View file

@ -0,0 +1,12 @@
<h1>Benutzer bearbeiten</h1>
<div id="newUser" style="width:65em">
<div class="box_title"><h2>Benutzer_in bearbeiten</h2></div>
<div class="column_content" id="userForm">
<% form_tag(:action => 'updateUser', :id => @user) do %>
<%= render :partial => 'users/form' %>
<br style="clear:both" />
<p>
<%= submit_tag 'Speichern' %> | <%= link_to 'Abbrechen', :action => 'listUsers' %></p>
<% end %>
</div>
</div>

View file

@ -0,0 +1,51 @@
<h1>Administration</h1>
<p><i>Hier kannst Du die Gruppen und Benutzer der Foodsoft verwalten.</i></p>
<div class="left_column" style="width:48%">
<div class="box_title"><h2>Neuste Benutzer</h2></div>
<div class="column_content">
<table>
<tr>
<th>Nick</th>
<th>Name</th>
<th>Erstellt am</th>
</tr>
<% for user in @users %>
<tr class="<%= cycle('even','odd', :name => 'users') %>">
<td><%= link_to user.nick, :action => 'showUser', :id => user.id %></td>
<td><%= user.first_name %> <%= user.last_name %></td>
<td><%= format_date(user.created_on) %></td>
</tr>
<% end %>
</table>
<br />
<%= link_to 'Alle Benutzerinnen', :action => 'listUsers' %> |
<%= link_to "Neue Benutzerin", :action => "newUser" %>
</div>
</div>
<div class="right_column" style="width:48%">
<div class="box_title"><h2>Neuste Gruppen</h2></div>
<div class="column_content">
<table>
<tr>
<th>Name</th>
<th>Typ</th>
<th>Mitglieder</th>
</tr>
<% 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.users.size %></td>
</tr>
<% end %>
</table>
<br />
<%= link_to 'Alle Gruppen', :action => 'listGroups' %> |
<%= link_to "Neue Bestellgruppe", :action => "newOrderGroup" %> |
<%= link_to "Neue Gruppe", :action => "newGroup" %>
</div>
</div>

View file

@ -0,0 +1,32 @@
%h1=_ 'Groups'
%p
%i
Hier kannst du
= link_to 'neue Gruppen', :action => 'newGroup'
und
= link_to 'neue Bestellgruppen', :action => 'newOrderGroup'
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".
Nutzer_innen können immer nur einer Bestellgruppe, aber beliebig vielen anderen Gruppen angehören.
.left_column{:style => "width:100%"}
.box_title
%h2 Gruppenübersicht
.column_content
#group_filter
%form{:name=>"sform", :action=>"", :style=>"display:inline;"}
%label{:for => 'article_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'

View file

@ -0,0 +1,28 @@
%h1 Admin/Benutzerinnen
%p
%i
Hier kannst du Benutzer_innen
= link_to_remote 'neu Anlegen', :url => {:action => 'newUser'}
, bearbeiten und natürlich auch löschen.
#newUser{:style => "display:none;"}
.box_title
%h2 Neue Benutzerinn
.column_content#userForm
.left_column{:style => "width:100%"}
.box_title
%h2 Benutzerinnenübersicht
.column_content
#user_filter
%form{:name=>"sform", :action=>"", :style=>"display:inline;"}
%label{:for => 'article_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 => 'listUsers'}, |
:with => 'query' |
#table
= render :partial => "listUsers"
- if @current_user.role_admin?
%p= link_to 'Neue Benutzer_in', :action => 'newUser'

View file

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

View file

@ -0,0 +1,8 @@
<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,13 @@
<h1>Neuer Benutzer</h1>
<div id="newUser">
<div class="box_title"><h2>Neue_r Benutzer_in</h2></div>
<div class="column_content" id="userForm">
<% form_tag(:action => 'createUser') do %>
<%= render :partial => 'users/form' %>
<p style="clear:both;">
<%= submit_tag "Speichern" %> | <%= link_to('Abbrechen', :action => 'listUsers')%></p>
<% end %>
</div>
</div>
<p><%= link_to 'Benutzer_innenübersicht', :action => 'listUsers' %></p>

View file

@ -0,0 +1,54 @@
%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

@ -0,0 +1,17 @@
<h1><%=h @user.nick %></h1>
<div class="left_column" style="width:100%">
<div class="box_title"><h2>Übersicht</h2></div>
<div class="column_content">
<%= render :partial => 'users/show'%>
<p style="clear:both">
<%= link_to 'Bearbeiten', :action => 'editUser', :id => @user %>
| <%= link_to 'Löschen', { :action => 'destroyUser', :id => @user }, :confirm => 'Willst du ' + @user.first_name + ' wirklich rausschmeißen?', :method => "post" %>
| <%= link_to 'Nachricht senden', :controller => 'messages', :action => 'user', :id => @user %>
</p>
</div>
<div class="box_title"><h2>Gruppenabos</h2></div>
<div class="column_content">
<%= render :partial => 'users/memberships'%>
<p><%= link_to 'Gruppenübersicht', :action => 'listGroups' %></p>
</div>
</div>