Initial commit of foodsoft 2
This commit is contained in:
commit
5b9a7e05df
657 changed files with 70444 additions and 0 deletions
27
app/views/admin/_listGroups.haml
Normal file
27
app/views/admin/_listGroups.haml
Normal 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") |
|
||||
39
app/views/admin/_listUsers.haml
Normal file
39
app/views/admin/_listUsers.haml
Normal 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") |
|
||||
5
app/views/admin/_newUser.rhtml
Normal file
5
app/views/admin/_newUser.rhtml
Normal 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 %>
|
||||
12
app/views/admin/editUser.rhtml
Normal file
12
app/views/admin/editUser.rhtml
Normal 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>
|
||||
51
app/views/admin/index.rhtml
Normal file
51
app/views/admin/index.rhtml
Normal 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>
|
||||
|
||||
32
app/views/admin/listGroups.haml
Normal file
32
app/views/admin/listGroups.haml
Normal 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'
|
||||
28
app/views/admin/listUsers.haml
Normal file
28
app/views/admin/listUsers.haml
Normal 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'
|
||||
2
app/views/admin/members.rhtml
Normal file
2
app/views/admin/members.rhtml
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
<%= render :partial => 'groups/edit_members' %>
|
||||
<p style="clear:both"><%= link_to 'Gruppenübersicht', :action => 'listGroups' %></p>
|
||||
8
app/views/admin/newGroup.rhtml
Normal file
8
app/views/admin/newGroup.rhtml
Normal 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>
|
||||
13
app/views/admin/newUser.rhtml
Normal file
13
app/views/admin/newUser.rhtml
Normal 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>
|
||||
|
||||
54
app/views/admin/showGroup.haml
Normal file
54
app/views/admin/showGroup.haml
Normal 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"
|
||||
17
app/views/admin/showUser.rhtml
Normal file
17
app/views/admin/showUser.rhtml
Normal 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>
|
||||
7
app/views/article_categories/_edit.rhtml
Normal file
7
app/views/article_categories/_edit.rhtml
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<% remote_form_for :article_category, :url => { :action => 'updateCategory', :id => @article_category },
|
||||
:before => "Element.show('loader')",
|
||||
:success => "Element.hide('loader')" do |@f| %>
|
||||
<%= render :partial => '/article_categories/form' %>
|
||||
<br />
|
||||
<%= submit_tag "Speichern" %> | <%= link_to_function("Abbrechen", "Element.hide('category_form')") %>
|
||||
<% end %>
|
||||
17
app/views/article_categories/_form.rhtml
Normal file
17
app/views/article_categories/_form.rhtml
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<%= error_messages_for 'article_category' %>
|
||||
|
||||
<!--[form:article_category]-->
|
||||
<table>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Beschreibung</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="article_category_name">
|
||||
<%= @f.text_field 'name', :size => 20 %></label></td>
|
||||
<td><label for="article_category_description">
|
||||
<%= @f.text_field 'description', :size => 30 %></label></td>
|
||||
</tr>
|
||||
</tabel>
|
||||
<!--[eoform:article_category]-->
|
||||
|
||||
22
app/views/article_categories/_list.rhtml
Normal file
22
app/views/article_categories/_list.rhtml
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
<table>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Beschreibung</th>
|
||||
<th colspan="2"></th>
|
||||
</tr>
|
||||
<% for article_category in ArticleCategory.find(:all) %>
|
||||
<tr class="<%= cycle("even","odd", :name => 'category') %>" id="category_<%= article_category.id %>">
|
||||
<td><%=h article_category.name %></td>
|
||||
<td><%=h article_category.description %></td>
|
||||
<td><%= link_to_remote(image_tag('b_edit.png', :size => "16x16", :border => "0", :alt => 'Katgerie bearbeiten'),
|
||||
:url => {:action => 'editCategory', :id => article_category},
|
||||
:before => "Element.show('loader')",
|
||||
:success => "Element.hide('loader')" ) %></td>
|
||||
<td><%= link_to_remote(image_tag('b_drop.png', :size => "16x16", :border => "0", :alt => 'Kategorie löschen'), :url => {:action => 'destroyCategory', :id => article_category }, :confirm => 'Are you sure?' )%></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
<br />
|
||||
<%= link_to_remote('Neue Kategorie', :url => {:action => :newCategory},
|
||||
:before => "Element.show('loader')",
|
||||
:success => "Element.hide('loader')") -%>
|
||||
7
app/views/article_categories/_new.rhtml
Normal file
7
app/views/article_categories/_new.rhtml
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<% remote_form_for :article_category, :url => { :action => 'createCategory', :id => @article_category },
|
||||
:before => "Element.show('loader')",
|
||||
:success => "Element.hide('loader')" do |@f| %>
|
||||
<%= render :partial => '/article_categories/form' %>
|
||||
<br />
|
||||
<%= submit_tag "Speichern" %> | <%= link_to_function("Abbrechen", "Element.hide('category_form')") %>
|
||||
<% end %>
|
||||
27
app/views/articles/_article_row.rhtml
Normal file
27
app/views/articles/_article_row.rhtml
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
<td>
|
||||
<%= check_box_tag 'selected_articles[]', @article.id.to_s, false, {:id => "checkbox_#{@article.id.to_s}", :onclick => "checkRow('#{@article.id.to_s}')"} %>
|
||||
</td>
|
||||
<td><%=h @article.name %></td>
|
||||
<td><%= @article.origin %></td>
|
||||
<td><%=h truncate(@article.article_category.name, 11) if @article.article_category%></td>
|
||||
<td><%=h @article.unit %></td>
|
||||
<td><%=h truncate(@article.note, 15) %></td>
|
||||
<td><%= @article.unit_quantity %></td>
|
||||
<td class="currency">
|
||||
<acronym title="zuletzt geändert: <%= format_date(@article.updated_at) %>
|
||||
| Brutto: <%= number_to_currency(@article.gross_price) %>">
|
||||
<%= number_to_currency(@article.net_price) %>
|
||||
</acronym>
|
||||
</td>
|
||||
<td><%= number_to_percentage(@article.tax) if @article.tax != 0 %></td>
|
||||
<td><%= number_to_currency(@article.deposit) if @article.deposit != 0 %></td>
|
||||
<td><%= link_to_remote(image_tag('b_edit.png', :size => "16x16", :border => 0, :alt => 'Artikel ändern', :onclick => "checkRow('#{@article.id.to_s}')"),
|
||||
:url => {:action => 'editArticle', :id => @article },
|
||||
:before => "Element.show('loader')",
|
||||
:success => "Element.hide('loader')") %>
|
||||
<%= link_to_remote(image_tag('b_drop.png', :size => "16x16", :border => 0, :alt => 'Artikel löschen', :onclick => "checkRow('#{@article.id.to_s}')"),
|
||||
:url => { :action => 'destroyArticle', :id => @article },
|
||||
:confirm => 'Bist du sicher?',
|
||||
:before => "Element.show('loader')",
|
||||
:success => "Element.hide('loader')")%></td>
|
||||
|
||||
9
app/views/articles/_destroyActiveArticle.haml
Normal file
9
app/views/articles/_destroyActiveArticle.haml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
%tr.edit_inline{:id=> "edit_"+@article.id.to_s}
|
||||
%td{:colspan=>"10"}
|
||||
=h @article.name
|
||||
wird in laufenden Bestellungen verwendet und kann nicht gelöscht werden.
|
||||
Bitte zuerst den Artikel aus den Bestellungen
|
||||
= link_to "entfernen", :controller => 'orders', :action => 'edit', :id => @order
|
||||
oder
|
||||
= link_to_function 'abbrechen', "Element.remove('edit_#{@article.id.to_s}')"
|
||||
|
||||
14
app/views/articles/_edit.haml
Normal file
14
app/views/articles/_edit.haml
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
%h2
|
||||
Bearbeiten von
|
||||
= @article.name
|
||||
zuletzt aktualisiert am:
|
||||
= format_time(@article.updated_at)
|
||||
|
||||
- form_remote_tag :url => { :action => 'updateArticle', :id => @article}, :html => {:id => "edit"}, |
|
||||
:before => "Element.show('loader')", :success => "Element.hide('loader')" do |form| |
|
||||
|
||||
= render :partial => "form"
|
||||
|
||||
= submit_tag "Speichern"
|
||||
|
|
||||
= link_to_function "Abbrechen", "Element.hide('edit_article')"
|
||||
69
app/views/articles/_form.rhtml
Normal file
69
app/views/articles/_form.rhtml
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
<%= error_messages_for 'article' %>
|
||||
<!--[form:article]-->
|
||||
<p>
|
||||
<b>Verfügbar?</b> <label for="article_availability"><%= check_box 'article', 'availability' %></label>
|
||||
</p>
|
||||
<table style="width: 20em">
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Herkunft</th>
|
||||
<th>Herstellerin</th>
|
||||
<th>Einheit</th>
|
||||
<th>Notiz</th>
|
||||
<th>Kategorie</th>
|
||||
</tr>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="article_name"><%= text_field 'article', 'name', :size => 15 %></label>
|
||||
</td>
|
||||
<td>
|
||||
<label for="article_origin"><%= text_field 'article', 'origin', :size => 5 %></label>
|
||||
</td>
|
||||
<td>
|
||||
<label for="article_manufacturer"><%= text_field 'article', 'manufacturer', :size => 8 %></label>
|
||||
</td>
|
||||
<td>
|
||||
<label for="article_unit"><%= text_field 'article', 'unit', :size => 5 %></label>
|
||||
</td>
|
||||
<td>
|
||||
<label for="article_note"><%= text_field 'article', 'note', :size => 15 %></label>
|
||||
</td>
|
||||
<td>
|
||||
<label for="article_article_category"><%= select('article', 'article_category_id', ArticleCategory.find(:all, :order => 'name').collect {|a| [ a.name, a.id ] }) %></label>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<br />
|
||||
|
||||
<table style="width:35em">
|
||||
<tr>
|
||||
<th>netto Preis</th>
|
||||
<th>Gebindegröße</th>
|
||||
<th>Artikelnummer</th>
|
||||
<th>Steuer</th>
|
||||
<th>Pfand</th>
|
||||
</tr>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><label for="article_net_price">
|
||||
<%= text_field 'article', 'net_price', :size => 5%></label></td>
|
||||
|
||||
<td><label for="article_unit_quantity">
|
||||
<%= text_field 'article', 'unit_quantity', :size => 5%></label></td>
|
||||
|
||||
<td><label for="article_order_number">
|
||||
<%= text_field 'article', 'order_number', :size => 10%></label></td>
|
||||
|
||||
<td><label for="article_tax">
|
||||
<%= text_field 'article', 'tax', :size => 5%></label></td>
|
||||
|
||||
<td><label for="article_deposit">
|
||||
<%= text_field 'article', 'deposit', :size => 5%></label></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<%= hidden_field 'article', 'shared_updated_on' %>
|
||||
<%= hidden_field 'article', 'supplier_id' %>
|
||||
<!--[eoform:article]-->
|
||||
24
app/views/articles/_import_search_results.haml
Normal file
24
app/views/articles/_import_search_results.haml
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
%p= pagination_links_remote @articles, 10, {:import_query => params[:import_query], :lists => params[:lists], :regional => params[:regional]}
|
||||
%table.list
|
||||
%thead
|
||||
%tr
|
||||
%th Name
|
||||
%th Herkunft
|
||||
%th Hersteller
|
||||
%th Notiz
|
||||
%th{:style => "width:4em"} Preis
|
||||
%th Einheit
|
||||
%th GebGröße
|
||||
%th
|
||||
%tbody
|
||||
- for article in @articles
|
||||
%tr{:class => cycle('even','odd', :name => 'import_search_results')}
|
||||
%td= highlight_phrase article.name, params[:import_query]
|
||||
%td= article.origin
|
||||
%td= article.manufacturer
|
||||
%td= article.note
|
||||
%td= number_to_currency(article.price)
|
||||
%td= article.unit
|
||||
%td= article.unit_quantity
|
||||
%td= link_to_remote 'importieren', :url => {:action => 'new_import', :id => article, :supplier_id => @supplier.id}
|
||||
|
||||
61
app/views/articles/_list.haml
Normal file
61
app/views/articles/_list.haml
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
%p
|
||||
=_ 'Number of found articles :'
|
||||
%b= @total
|
||||
|
||||
%p
|
||||
%table{:style => "width:100%"}
|
||||
%tr
|
||||
%td
|
||||
= pagination_links_remote @articles, @per_page, {:sort => params[:sort]}
|
||||
%td{:style => "text-align:right"}
|
||||
- if @total > 30
|
||||
= items_per_page([30, 100, 500])
|
||||
|
||||
%table#articles_table.list.articles
|
||||
%thead
|
||||
%tr
|
||||
%th
|
||||
%th[sort_td_class_helper "name"]
|
||||
= sort_link_helper _("Name"), "name", @supplier.id
|
||||
%th
|
||||
%th[sort_td_class_helper "category"]
|
||||
= sort_link_helper _("Category"), "category", @supplier.id
|
||||
%th[sort_td_class_helper "unit"]
|
||||
= sort_link_helper _("Unit"), "unit", @supplier.id
|
||||
%th[sort_td_class_helper "note"]
|
||||
= sort_link_helper _("Note"), "note", @supplier.id
|
||||
%th{:style => "width: 4em;"}=_ 'UnitQu'
|
||||
%th{:style => "width: 4em;"}=_ 'Price'
|
||||
%th{:style => "width: 3.5em;"}=_ 'Tax'
|
||||
%th{:style => "width: 4em;"}=_ 'Deposit'
|
||||
%th{:style => "width: 3em;"}
|
||||
|
||||
%tbody#listbody
|
||||
|
||||
- if @total > 0
|
||||
- for @article in @articles
|
||||
%tr{ :class => cycle('even','odd') + (!@article.availability ? ' unavailable' : '') + ((@article.recently_updated && @article.availability) ? " just_updated" : ""), |
|
||||
:id => @article.id, :onclick => "checkRow('#{@article.id.to_s}')"} |
|
||||
= render :partial => 'article_row'
|
||||
%tfoot
|
||||
%tr
|
||||
%td{:colspan => '10'}
|
||||
%input{:type => 'checkbox', :name => 'checkall', :onclick => 'checkUncheckAll(this)'}/
|
||||
%select{:name => "selected_action"}
|
||||
%option{:value => '', :selected => 'selected'} Aktion wählen ...
|
||||
%option{:value => "destroy", :onclick => "if (confirm('Willst Du wirklich alle gewählten Artikel löschen?')) { formSubmit(); }; return false;"} Artikel löschen
|
||||
%option{:value => "setNotAvailable", :onclick => 'formSubmit();'} Artikel sind nicht mehr verfügbar
|
||||
%option{:value => "setAvailable", :onclick => 'formSubmit();'} Artikel sind verfügbar
|
||||
|
||||
= hidden_field_tag 'supplier', @supplier.id
|
||||
%p
|
||||
= pagination_links_remote @articles, @per_page, {:sort => params[:sort]}
|
||||
|
||||
:plain
|
||||
<script type="text/javascript">
|
||||
function formSubmit() {
|
||||
$("articlesInListForm").submit()
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
5
app/views/articles/_new.haml
Normal file
5
app/views/articles/_new.haml
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
%h3 Neuer Artikel
|
||||
- form_remote_tag :url => { :action => 'createArticle'} do
|
||||
= render :partial => 'articles/form'
|
||||
= submit_tag "Speichern"
|
||||
= link_to_function('Abbrechen', 'Element.hide("edit_article")')
|
||||
2
app/views/articles/_new_article_row.haml
Normal file
2
app/views/articles/_new_article_row.haml
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
%tr{:class => cycle('even','odd'), :id => @article.id, :onclick => "checkRow('#{@article.id.to_s}')"}
|
||||
= render :partial => 'article_row'
|
||||
61
app/views/articles/edit_all.rhtml
Normal file
61
app/views/articles/edit_all.rhtml
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
<h1>Alle Artikel von <%= @supplier.name %> bearbeiten</h1>
|
||||
|
||||
<div class="single_column" style="width:100%">
|
||||
<div class="box_title">
|
||||
<h2>
|
||||
<div id="change_supplier">
|
||||
<% form_tag do -%>
|
||||
<select onchange="redirectTo(this)" style="font-size: 0.9em;margin-left:1em;">
|
||||
<%= options_for_select(Supplier.find(:all).collect {|s| [ s.name, url_for(:action => "edit_all", :id => s)] }, url_for(:action => "edit_all", :id => @supplier.id)) %>
|
||||
</select>
|
||||
<% end %>
|
||||
</div>
|
||||
</h2>
|
||||
</div>
|
||||
<div class="box column_content">
|
||||
<div id="links"><%= link_to 'zurück zur Liste', :action => 'list', :id => @supplier.id %></div>
|
||||
<p>
|
||||
<i>
|
||||
Pflichtfelder sind: Name, Einheit, (netto) Preis und Bestellnummer.
|
||||
</i>
|
||||
</p>
|
||||
<% form_tag(:action => 'update_all', :id => @supplier) do %>
|
||||
<table id="articles_table" class="list">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><acronym title="verfügbar">verf.</acronym></th>
|
||||
<th>Name</th>
|
||||
<th>Einheit</th>
|
||||
<th><acronym title="Netto!">Preis</acronym></th>
|
||||
<th><acronym title="Gebindegröße">GebGr</acronym></th>
|
||||
<th>Best.Nr.</th>
|
||||
<th>Notiz</th>
|
||||
<th>Kategorie</th>
|
||||
<th>MwSt.</th>
|
||||
<th>Pfand</th>
|
||||
</tr>
|
||||
<tbody>
|
||||
<% @supplier.articles.find(:all, :order => 'article_categories.name, articles.name', :include => [:article_category]).each do |@article| %>
|
||||
<tr class="<%= cycle('even', 'odd') %>"<%= ' style="background-color: yellow"' if @failedArticle == @article %>>
|
||||
<td colspan="2"><label for="article_availability"><%= check_box 'article[]', 'availability' %></label>
|
||||
<label for="article_name"><%= text_field( 'article[]', 'name', :size => 0) %></label></td>
|
||||
<td><label for="article_unit"><%= text_field 'article[]', 'unit', :size => 5 %></label></td>
|
||||
<td><label for="article_net_price"><%= text_field 'article[]', 'net_price', :size => 4 %></label></td>
|
||||
<td><label for="article_unit_quantity"><%= text_field 'article[]', 'unit_quantity', :size => 4 %></label></td>
|
||||
<td><label for="article_order_number"><%= text_field 'article[]', 'order_number', :size => 6 %></label></td>
|
||||
<td><label for="article_note"><%= text_field 'article[]', 'note', :size => 15 %></label></td>
|
||||
<td><label for="article_article_category"><%= select('article[]', 'article_category_id', ArticleCategory.find(:all).collect {|a| [ a.name, a.id ] }, { :include_blank => true })%></label></td>
|
||||
<td><label for="article_tax"><%= text_field 'article[]', 'tax', :size => 4 %></label></td>
|
||||
<td><label for="article_deposit"><%= text_field 'article[]', 'deposit', :size => 4 %></label></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<!--[eoform:article]-->
|
||||
</tbody>
|
||||
</table><br />
|
||||
<i>Achtung, alle Artikel werden aktualisiert!</i><br />
|
||||
<%= hidden_field 'supplier', 'id' %>
|
||||
<%= submit_tag 'Alle aktualisieren'%>
|
||||
| <%= link_to 'Abbrechen', :action => 'list', :id => @supplier.id %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
29
app/views/articles/index.haml
Normal file
29
app/views/articles/index.haml
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
%h1 Manage die Artikeldatenbank
|
||||
.left_column{:style => "width:44%"}
|
||||
.box_title
|
||||
%h2 Artikel anzeigen
|
||||
.column_content
|
||||
%p
|
||||
%i
|
||||
Hier kannst du Artikel anzeigen, ändern und neue erstellen
|
||||
%br/
|
||||
Wähle einen Lieferanten:
|
||||
%ul
|
||||
- @suppliers.each do |supplier|
|
||||
%li
|
||||
%b= link_to supplier.name, :action => "list", :id => supplier.id
|
||||
(
|
||||
= supplier.articles.count
|
||||
Artikel )
|
||||
%hr/
|
||||
%p
|
||||
%i
|
||||
hier kannst du neue Artikel aus einer csv-Datei in die Datenbank
|
||||
= link_to 'hochladen', :action => 'upload_articles'
|
||||
|
||||
.right_column{:style => "width:53%"}
|
||||
.box_title
|
||||
%h2 Artikelkategorien
|
||||
.column_content#categories
|
||||
#category_form.box.edit_form{:style => "display:none;margin-bottom:1em;"}
|
||||
#category_list= render :partial => 'article_categories/list'
|
||||
70
app/views/articles/list.haml
Normal file
70
app/views/articles/list.haml
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
%h1
|
||||
=_ 'Articles from'
|
||||
= @supplier.name
|
||||
|
||||
// import menu
|
||||
- unless @supplier.shared_supplier.nil?
|
||||
.menu{:style => 'width: 14em'}
|
||||
%ul
|
||||
%li
|
||||
=_ 'External database'
|
||||
%ul
|
||||
%li= link_to_function _('search/import'), "Element.toggle('import')"
|
||||
%li= link_to _('sync'), :action => 'sync_articles', :id => @supplier
|
||||
|
||||
|
||||
#change_supplier{:style => "padding:0 0 0.5em 0.7em;"}
|
||||
%span{:style => "float:left"}
|
||||
=_ 'Change supplier:'
|
||||
- form_tag do
|
||||
%select{:onchange => "redirectTo(this)", :style => "font-size: 0.9em;margin-left:1em;"}
|
||||
= options_for_select(@suppliers.collect {|s| [ s.name, url_for(:action => "list", :id => s)] }, url_for(:action => "list", :id => @supplier.id))
|
||||
|
||||
- unless @supplier.shared_supplier.nil?
|
||||
#import.single_column{:style => "display:none; clear:both"}
|
||||
.box_title
|
||||
%h2=_ 'Import articles'
|
||||
.column_content
|
||||
#search{:style => "padding-bottom:3em"}
|
||||
- form_remote_tag :url => {:action => "list_shared_articles", :id => @supplier}, :before => "Element.show('loader')", :success => "Element.hide('loader')" do
|
||||
= text_field_tag :import_query, params['import_query'], :size => 10
|
||||
= submit_tag _('Search articles')
|
||||
- if @supplier.shared_supplier.lists
|
||||
=_ "Search in following lists: "
|
||||
- @supplier.shared_supplier.lists.each do |token, name|
|
||||
= check_box_tag "lists[#{token}]", "1", true
|
||||
= name
|
||||
|
|
||||
=_ "only regional:"
|
||||
= check_box_tag "regional", "1", false
|
||||
#search_results
|
||||
// "import_search_results" will be rendered
|
||||
= link_to_function _('Close'), "Element.hide('import')"
|
||||
|
||||
.single_column{:style => 'width:100%; clear:both'}
|
||||
.box_title
|
||||
.column_content
|
||||
#links
|
||||
%b= link_to_remote( _('New article'), :url => {:action => 'newArticle', :supplier => @supplier}, :before => "Element.show('loader')", :success => "Element.hide('loader')")
|
||||
|
|
||||
= link_to _('Edit all'), :action => 'edit_all', :id => @supplier
|
||||
|
|
||||
= link_to _('Upload articles'), :action => 'upload_articles'
|
||||
|
|
||||
= link_to_if @current_user.role_orders?, _('Create order'), {:controller => 'orders', :action => 'new', :id => @supplier }
|
||||
|
||||
#article_filter
|
||||
#article_search_form{:style=>"display:inline;"}
|
||||
- form_remote_tag :url => {:action => "list", :id => @supplier}, :before => "Element.show('loader')", :success => "Element.hide('loader')" do
|
||||
%label{:for => 'article_name'}=_ "Search in article name: "
|
||||
= text_field_tag("query", params['query'], :size => 10 )
|
||||
= submit_tag _('Search')
|
||||
|
||||
%form{ :method => 'post', :action => url_for(:action => 'update_selected_articles', :only_path => true), :id => 'articlesInListForm'}
|
||||
#table
|
||||
= render :partial => 'list'
|
||||
%br/
|
||||
= link_to _('Back'), :action => 'index'
|
||||
#edit_article{:style => "display:none"}
|
||||
|
||||
|
||||
40
app/views/articles/parse_articles.haml
Normal file
40
app/views/articles/parse_articles.haml
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
%h1=_ "Upload Articles"
|
||||
%p
|
||||
%i
|
||||
=_ "Please check the parsed articles and choose a supplier at the end of page."
|
||||
%br/
|
||||
=_ "At the moment there is now checking of dublicate articles."
|
||||
|
||||
- form_tag(:action => 'create_articles_from_file') do
|
||||
%table.list
|
||||
%tr
|
||||
%th=_ "Number"
|
||||
%th=_ "Name"
|
||||
%th=_ "Note"
|
||||
%th=_ "Manufacturer"
|
||||
%th=_ "Origin"
|
||||
%th=_ "Unit"
|
||||
%th=_ "Net price"
|
||||
%th=_ "Tax"
|
||||
%th=_ "Deposit"
|
||||
%th=_ "Unit quantity"
|
||||
%th=_ "Category"
|
||||
- for @article in @articles
|
||||
%tr{:class => cycle('even', 'odd')}
|
||||
%td= text_field 'article[]', 'order_number', :size => 6
|
||||
%td= text_field 'article[]', 'name', :size => 0
|
||||
%td= text_field 'article[]', 'note', :size => 15
|
||||
%td= text_field 'article[]', 'manufacturer', :size => 6
|
||||
%td= text_field 'article[]', 'origin', :size => 6
|
||||
%td= text_field 'article[]', 'unit', :size => 5
|
||||
%td= text_field 'article[]', 'net_price', :size => 4
|
||||
%td= text_field 'article[]', 'tax', :size => 4
|
||||
%td= text_field 'article[]', 'deposit', :size => 4
|
||||
%td= text_field 'article[]', 'unit_quantity', :size => 4
|
||||
%td= select('article[]', 'article_category_id', ArticleCategory.find(:all).collect {|a| [ a.name, a.id ] })
|
||||
%p
|
||||
=_ "Choose a supplier:"
|
||||
= select('supplier', 'id', Supplier.find(:all).collect {|s| [ s.name, s.id ] }, :selected => nil)
|
||||
= submit_tag _("Save articles")
|
||||
%p= link_to _("Back"), :action => 'upload_articles'
|
||||
|
||||
70
app/views/articles/sync_articles.haml
Normal file
70
app/views/articles/sync_articles.haml
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
%h1 Artikel mit externer Datenbank synchronisieren
|
||||
|
||||
- form_tag :action => 'update_all', :id => @supplier, :sync => "1" do
|
||||
%h2 Auslisten ...
|
||||
%p
|
||||
- unless @outlisted_articles.empty?
|
||||
Folgende Artikel wurden ausgelistet und werden
|
||||
%b gelöscht:
|
||||
%ul
|
||||
- for article in @outlisted_articles
|
||||
%li
|
||||
= hidden_field_tag "outlisted_articles[#{article.id}]", '1'
|
||||
= article.name
|
||||
- else
|
||||
%i Es müssen keine Artikel gelöscht werden.
|
||||
%hr/
|
||||
%h2 Aktualisieren ...
|
||||
%p
|
||||
%i
|
||||
%b= @updated_articles.size
|
||||
Artikel müssen aktualisiert werden:
|
||||
%p
|
||||
%i
|
||||
Jeder Artikel wird doppelt angezeigt. Die alten Werte sind grau und die Textfelder sind mit den aktuellen
|
||||
Werten vorausgefüllt.
|
||||
%br/
|
||||
Abweichungen zu den alten Artikeln sind gelb markiert.
|
||||
%table
|
||||
%tr
|
||||
%th Name
|
||||
%th Notiz
|
||||
%th Hersteller
|
||||
%th Herkunft
|
||||
%th Einheit
|
||||
%th GebGr
|
||||
%th Preis
|
||||
%th MwSt.
|
||||
%th Pfand
|
||||
%th Kategorie
|
||||
- @updated_articles.each do |@article, unequal_attributes|
|
||||
- article = Article.find(@article.id)
|
||||
%tr{:style => 'color:grey'}
|
||||
%td= article.name
|
||||
%td= article.note
|
||||
%td= article.manufacturer
|
||||
%td= article.origin
|
||||
%td= article.unit
|
||||
%td= article.unit_quantity
|
||||
%td= article.net_price
|
||||
%td= article.tax
|
||||
%td= article.deposit
|
||||
%td= article.article_category.name if article.article_category
|
||||
%tr
|
||||
%td{:style => highlight_new(unequal_attributes, :name)}
|
||||
= text_field 'article[]', 'name', :size => 0
|
||||
= hidden_field 'article[]', 'shared_updated_on'
|
||||
%td{:style => highlight_new(unequal_attributes, :note)}= text_field 'article[]', 'note', :size => 15
|
||||
%td{:style => highlight_new(unequal_attributes, :manufacturer)}= text_field 'article[]', 'manufacturer', :size => 10
|
||||
%td{:style => highlight_new(unequal_attributes, :origin)}= text_field 'article[]', 'origin', :size => 5
|
||||
%td{:style => highlight_new(unequal_attributes, :unit)}= text_field 'article[]', 'unit', :size => 5
|
||||
%td{:style => highlight_new(unequal_attributes, :unit_quantity)}= text_field 'article[]', 'unit_quantity', :size => 5
|
||||
%td{:style => highlight_new(unequal_attributes, :net_price)}= text_field 'article[]', 'net_price', :size => 5
|
||||
%td{:style => highlight_new(unequal_attributes, :tax)}= text_field 'article[]', 'tax', :size => 4
|
||||
%td{:style => highlight_new(unequal_attributes, :deposit)}= text_field 'article[]', 'deposit', :size => 4
|
||||
%td= select 'article[]', 'article_category_id', ArticleCategory.find(:all).collect {|a| [ a.name, a.id ] }, { :include_blank => true }
|
||||
%hr/
|
||||
= hidden_field 'supplier', 'id'
|
||||
= submit_tag 'Alle löschen/aktualisieren'
|
||||
|
|
||||
= link_to 'Abbrechen', :action => 'list', :id => @supplier
|
||||
18
app/views/articles/upload_articles.haml
Normal file
18
app/views/articles/upload_articles.haml
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
%h1=_ "Upload articles"
|
||||
%p
|
||||
%i
|
||||
=_ 'The file-type must be "csv" (textfile). Use a semicolon (";") to seperate the fields and double quotes ("Bananas...") for the text.'
|
||||
%br/
|
||||
=_ 'The character-set has to be "UTF-8". The first row, maybe used for headers, will be ignored.'
|
||||
%p
|
||||
%i
|
||||
=_ "Correct order of the columns:"
|
||||
%br/
|
||||
= [_("Status (x=outlistet)"), _("Number"), _("Name"), _("Note"), _("Manufacturer"), _("Origin"), |
|
||||
_("Unit"), _("Net price"), _("Tax"), _("Deposit"), _("Unit quantity"), |
|
||||
_("Scale quantity"), _("Scale price"), _("Category")].join(" | ") |
|
||||
|
||||
#uploadArticles.uploadForm
|
||||
- form_for(:articles, :url => {:action => 'parse_articles'}, :html => { :multipart => true }) do |form|
|
||||
%p= form.file_field("file")
|
||||
%p= submit_tag _("Upload articles")
|
||||
21
app/views/finance/_articleResult.haml
Normal file
21
app/views/finance/_articleResult.haml
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
%td= @article.name
|
||||
%td= link_to_function image_tag("arrow_down_red.png", :size => "16x16", :border => 0), "Element.toggle('group_order_article_results_#{@article.id}')"
|
||||
%td= @article.order_number
|
||||
%td= @article.units_to_order
|
||||
%td= @article.unit_quantity.to_s + ' * ' + @article.unit.to_s
|
||||
%td= number_to_currency(@article.net_price)
|
||||
%td= number_to_currency(@article.gross_price)
|
||||
%td= @article.tax
|
||||
%td= @article.deposit
|
||||
%td
|
||||
= link_to_remote image_tag('b_edit.png', :size => "16x16", :border => 0, :alt => 'Artikel ändern'), |
|
||||
:url => {:action => 'editArticleResult', :id => @article}, |
|
||||
:before => "Element.show('loader')", |
|
||||
:success => "Element.hide('loader')" |
|
||||
%td
|
||||
= link_to_remote image_tag('b_drop.png', :size => "16x16", :border => 0, :alt => 'Artikel löschen'), |
|
||||
:url => {:action => 'destroyArticleResult', :id => @article}, |
|
||||
:confirm => 'Bist du sicher?', |
|
||||
:method => 'post', |
|
||||
:before => "Element.show('loader')", |
|
||||
:success => "Element.hide('loader')" |
|
||||
29
app/views/finance/_articleResultForm.haml
Normal file
29
app/views/finance/_articleResultForm.haml
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
= error_messages_for 'article'
|
||||
%p
|
||||
%b Notiz:
|
||||
= @form.text_field 'note', :size => 30
|
||||
%table
|
||||
%tr
|
||||
%th Name
|
||||
%th Nr.
|
||||
%th
|
||||
%abbr{:title=>"Anzahl gelieferter Gebinde"} Menge
|
||||
%th GebGr
|
||||
%th Einheit
|
||||
%th netto
|
||||
%th MwSt.
|
||||
%th Pfand
|
||||
%tr
|
||||
%td= @form.text_field 'name', :size => 20
|
||||
%td= @form.text_field 'order_number', :size => 3
|
||||
%td= @form.text_field 'units_to_order', :size => 5
|
||||
%td= @form.text_field 'unit_quantity', :size => 3
|
||||
%td= @form.text_field 'unit', :size => 5
|
||||
%td= @form.text_field 'net_price', :size => 3
|
||||
%td= @form.text_field 'tax', :size => 3
|
||||
%td= @form.text_field 'deposit', :size => 3
|
||||
= @form.hidden_field "order_id"
|
||||
%br/
|
||||
= submit_tag "Speichern"
|
||||
|
|
||||
= link_to_function 'Abbrechen', "Element.hide('edit_box')"
|
||||
5
app/views/finance/_articleResults.haml
Normal file
5
app/views/finance/_articleResults.haml
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
%tr{:class => cycle('even', 'odd', :name => 'articles')}[@article]
|
||||
= render :partial => 'articleResult'
|
||||
|
||||
%tr{:id => "group_order_article_results_#{@article.id}", :class => "results", :style => "display:none"}
|
||||
= render :partial => 'groupOrderArticleResults'
|
||||
17
app/views/finance/_articlesOverview.haml
Normal file
17
app/views/finance/_articlesOverview.haml
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
%p
|
||||
%b
|
||||
Gelieferte Artikel:
|
||||
= @order.order_article_results.size
|
||||
- for article in @order.order_article_results
|
||||
%table{:style=> "margin-bottom:1em; width:40em;"}[article]
|
||||
%thead
|
||||
%tr
|
||||
%th{:colspan => "3"}= article.name + " (" + article.unit + " | " + article.unit_quantity.to_s + " | " + article.gross_price.to_s + ")"
|
||||
%tbody
|
||||
- for result in article.group_order_article_results
|
||||
%tr{ :class => cycle('even', 'odd', :name => 'group')}
|
||||
%td{:style=>"width:70%"}= result.group_order_result.group_name
|
||||
%td= result.quantity
|
||||
%td= article.gross_price * result.quantity
|
||||
- reset_cycle("group")
|
||||
|
||||
8
app/views/finance/_editArticleResult.haml
Normal file
8
app/views/finance/_editArticleResult.haml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
%h2
|
||||
Bearbeiten von
|
||||
= @article.name
|
||||
|
||||
- remote_form_for 'order_article_result', @article, :url => {:action => 'updateArticleResult', :id => @article }, |
|
||||
:before => "Element.show('loader')", :success => "Element.hide('loader')" do |@form| |
|
||||
|
||||
= render :partial => "articleResultForm"
|
||||
20
app/views/finance/_editGroupResult.haml
Normal file
20
app/views/finance/_editGroupResult.haml
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
%h2 Mengenänderung
|
||||
%p
|
||||
= @result.group_order_result.group_name
|
||||
hat von
|
||||
= @result.order_article_result.name
|
||||
bekommen:
|
||||
|
||||
- remote_form_for 'group_order_article_result', @result, :url => {:action => 'updateGroupResult', :id => @result }, |
|
||||
:before => "Element.show('loader')", :success => "Element.hide('loader')" do |form| |
|
||||
|
||||
= error_messages_for 'group_order_article_result'
|
||||
%p
|
||||
%b Menge:
|
||||
(Einheit:
|
||||
= @result.order_article_result.unit
|
||||
)
|
||||
= form.text_field "quantity", :size => "6"
|
||||
= submit_tag "Speichern"
|
||||
|
|
||||
= link_to_function 'Abbrechen', "Element.hide('edit_box')"
|
||||
10
app/views/finance/_editNote.haml
Normal file
10
app/views/finance/_editNote.haml
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
%h2 Notiz bearbeiten
|
||||
- remote_form_for 'order', @order, :url => {:action => 'updateOrderNote', :id => @order}, |
|
||||
:before => "Element.show('loader')", :success => "Element.hide('loader')" do |form| |
|
||||
|
||||
%br/
|
||||
= form.text_area "note", :size => "60x20"
|
||||
%p
|
||||
= submit_tag "Speichern"
|
||||
|
|
||||
= link_to_remote 'Abbrechen', :update => 'results', :url => { :action => 'editOrder', :id => @order, :view => 'groupsOverview' }, :before => "Element.show('loader')", :success => "Element.hide('loader')"
|
||||
20
app/views/finance/_editResults.haml
Normal file
20
app/views/finance/_editResults.haml
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
%p{:style => "float:left"}
|
||||
%b Lieferung bearbeiten
|
||||
%p{:style => "float:right"}
|
||||
= link_to_remote "Artikel hinzufügen", :url => {:action => "newArticleResult", :id => @order}
|
||||
|
||||
%table{:class => "ordered_articles", :style => "clear:both"}
|
||||
%thead
|
||||
%tr
|
||||
%th{:colspan => "2"} Artikel
|
||||
%th Nr.
|
||||
%th Menge
|
||||
%th GebGr * Einheit
|
||||
%th netto
|
||||
%th brutto
|
||||
%th MwSt
|
||||
%th Pfand
|
||||
%th{:colspan => "2"}
|
||||
%tbody#result_table
|
||||
- for @article in @order.order_article_results
|
||||
= render :partial => "articleResults"
|
||||
27
app/views/finance/_editSummary.haml
Normal file
27
app/views/finance/_editSummary.haml
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
%h2 Bestelldaten ändern
|
||||
- remote_form_for 'order', @order, :url => {:action => 'updateOrderSummary', :id => @order}, |
|
||||
:before => "Element.show('loader')", :success => "Element.hide('loader')" do |form| |
|
||||
|
||||
= error_messages_for 'order'
|
||||
%table{:style => "width:10em"}
|
||||
%tr
|
||||
%td Rechnungsnummer:
|
||||
%td= form.text_field "invoice_number", :size => 10
|
||||
%tr
|
||||
%td Rechnungsdatum:
|
||||
%td= form.text_field "invoice_date", :size => 10
|
||||
%tr
|
||||
%td
|
||||
%abbr{:title => "(incl. Pfand/Gutschriften)"} Rechnungsbeitrag
|
||||
%td= form.text_field 'invoice_amount', :size => 10
|
||||
%tr
|
||||
%td
|
||||
%abbr{:title => "z.B Kistepfand"} extra Pfand
|
||||
%td= form.text_field 'deposit', :size => 10
|
||||
%tr
|
||||
%td Pfandgutschrift
|
||||
%td= form.text_field 'deposit_credit', :size => 10
|
||||
%p
|
||||
= submit_tag "Speichern"
|
||||
|
|
||||
= link_to_function 'Abbrechen', "Element.hide('edit_box')"
|
||||
25
app/views/finance/_groupOrderArticleResults.haml
Normal file
25
app/views/finance/_groupOrderArticleResults.haml
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
%td{:colspan => "7"}
|
||||
%p
|
||||
Notiz:
|
||||
= @article.note
|
||||
%table
|
||||
%thead
|
||||
%tr
|
||||
%td
|
||||
%td{:style => "width:8em"} Gruppe
|
||||
%td Einheiten
|
||||
%td Gesamtpreis
|
||||
%td{:colspan => "3",:style => "width:14em"}
|
||||
= link_to_remote '[Gruppe hinzufügen]', :url => {:action => "newGroupResult", :id => @article}, :before => "Element.show('loader')", :success => "Element.hide('loader')"
|
||||
%tbody{:id => "groups_results_#{@article.id}"}
|
||||
- for @result in @article.group_order_article_results
|
||||
= render :partial => "groupResults"
|
||||
%tfoot
|
||||
%tr{:class => cycle('even', 'odd', :name => 'results'), :id => "sum_of_article_#{@article.id}"}
|
||||
%td
|
||||
%td{:style => "width:8em"} Summe
|
||||
%td{:id => "totalArticleQuantity_#{@article.id}"}= @article.total[:quantity]
|
||||
%td{:id => "totalArticlePrice_#{@article.id}", :class => "currency"}
|
||||
= number_to_currency(@article.total[:price])
|
||||
%td{:colspan => "3"}
|
||||
- reset_cycle('results')
|
||||
17
app/views/finance/_groupResult.haml
Normal file
17
app/views/finance/_groupResult.haml
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
%td
|
||||
%td{:style=>"width:50%"}= @result.group_order_result.group_name
|
||||
%td{:id => "group_order_article_result_#{@result.id}_quantity"}= @result.quantity
|
||||
%td{:class => "currency"}= number_to_currency(@result.order_article_result.gross_price * @result.quantity)
|
||||
%td{:style=>"width:1em", :class => "actions"}
|
||||
= link_to_remote image_tag('b_edit.png', :size => "16x16", :border => 0, :alt => 'Menge ändern'), |
|
||||
:url => {:action => 'updateGroupResult', :id => @result}, |
|
||||
:before => "Element.show('loader')", |
|
||||
:success => "Element.hide('loader')" |
|
||||
%td{:style=>"width:1em", :class => "actions"}
|
||||
= link_to_remote image_tag('b_drop.png', :size => "16x16", :border => 0, :alt => 'Gruppenergebnis löschen'), |
|
||||
:url => {:action => 'destroyGroupResult', :id => @result}, |
|
||||
:confirm => 'Bist du sicher?', |
|
||||
:method => 'post', |
|
||||
:before => "Element.show('loader')", |
|
||||
:success => "Element.hide('loader')" |
|
||||
%td
|
||||
2
app/views/finance/_groupResults.haml
Normal file
2
app/views/finance/_groupResults.haml
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
%tr{:class => cycle('even', 'odd', :name => 'results')}[@result]
|
||||
= render :partial => "groupResult"
|
||||
30
app/views/finance/_groupsOverview.haml
Normal file
30
app/views/finance/_groupsOverview.haml
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
%p
|
||||
%b
|
||||
Gruppenbestellungen:
|
||||
= @order.group_order_results.size
|
||||
- for groupOrderResult in @order.group_order_results
|
||||
%p
|
||||
%table{:style => "width:40em"}[groupOrderResult]
|
||||
%thead
|
||||
%tr
|
||||
%th{:colspan => "6"}= groupOrderResult.group_name
|
||||
%tbody
|
||||
- total = 0
|
||||
- for result in groupOrderResult.group_order_article_results
|
||||
- price = result.order_article_result.gross_price
|
||||
- quantity = result.quantity
|
||||
- subTotal = price * quantity
|
||||
- total += subTotal
|
||||
%tr{:class => cycle('even', 'odd', :name => 'article')}
|
||||
%td= result.order_article_result.name
|
||||
%td= quantity
|
||||
%td{:class => "currency"}= number_to_currency(price)
|
||||
%td= result.order_article_result.unit_quantity
|
||||
%td= result.order_article_result.unit
|
||||
%td= number_to_currency(subTotal)
|
||||
%tfoot
|
||||
%tr{:class => cycle('even', 'odd', :name => 'article')}
|
||||
%td{:colspan => "5"} Summe
|
||||
%td
|
||||
%b= number_to_currency(total)
|
||||
- reset_cycle("article")
|
||||
28
app/views/finance/_listOrdergroups.haml
Normal file
28
app/views/finance/_listOrdergroups.haml
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
%p
|
||||
= _("Found") + ":"
|
||||
= @total
|
||||
%p
|
||||
%table{:style => "width:100%"}
|
||||
%tr
|
||||
%td
|
||||
= pagination_links_remote @groups, @per_page, {:sort => params[:sort]}
|
||||
%td{:style => "text-align:right"}
|
||||
- if @total > 20
|
||||
= items_per_page
|
||||
%table.list
|
||||
%thead
|
||||
%tr
|
||||
%th= sort_link_helper _("Name"), "name", @per_page
|
||||
%th= sort_link_helper _("Size of group"), "size", @per_page
|
||||
%th= sort_link_helper _("Account balance"), "account_balance", @per_page
|
||||
%th
|
||||
%tbody
|
||||
- for group in @groups
|
||||
%tr{:class => cycle('even','odd', :name => 'groups')}
|
||||
%td= @current_user.role_admin? ? link_to(group.name, {:controller => 'admin', :action => 'showGroup', :id => group}, {:title => _("Show ordergroup")}) : group.name
|
||||
%td= group.actual_size
|
||||
%td{:class => "currency", :style => "width:5em"}= number_to_currency(group.account_balance)
|
||||
%td{:class => "actions"}
|
||||
= link_to image_tag("euro_new.png", :size => "16x16", :alt => _("New transaction"), :border => "0"), {:action => 'newTransaction', :id => group}, {:title => _("New transaction")}
|
||||
= link_to image_tag("b_browse.png", :size => "16x16", :border => "0", :alt => 'Kontoauszug'), {:action => 'listTransactions', :id => group}, {:title => _("List transactions")}
|
||||
|
||||
7
app/views/finance/_newArticleResult.haml
Normal file
7
app/views/finance/_newArticleResult.haml
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
%h2
|
||||
Neuer gelieferter Artikel die Bestellung
|
||||
|
||||
- remote_form_for 'order_article_result', @article, :url => {:action => 'createArticleResult' }, |
|
||||
:before => "Element.show('loader')", :success => "Element.hide('loader')" do |@form| |
|
||||
|
||||
= render :partial => "articleResultForm"
|
||||
17
app/views/finance/_newGroupResult.haml
Normal file
17
app/views/finance/_newGroupResult.haml
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
%h2
|
||||
Neue Gruppenmenge für
|
||||
= @result.order_article_result.name
|
||||
- remote_form_for 'group_order_article_result', @result, :url => {:action => 'createGroupResult'}, |
|
||||
:before => "Element.show('loader')", :success => "Element.hide('loader')" do |@form| |
|
||||
= error_messages_for 'result'
|
||||
%p
|
||||
Gruppe:
|
||||
= @form.select "group_order_result_id", OrderGroup.find(:all, :order => "name").collect {|og| [og.name, og.id] }
|
||||
%p
|
||||
Menge:
|
||||
= @form.text_field "quantity", :size => 5
|
||||
= @form.hidden_field "order_article_result_id"
|
||||
%p
|
||||
= submit_tag "Speichern"
|
||||
|
|
||||
= link_to_function 'Abbrechen', "Element.hide('edit_box')"
|
||||
6
app/views/finance/_order_group.haml
Normal file
6
app/views/finance/_order_group.haml
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
%tr.transaction
|
||||
%td
|
||||
%select{:name => 'financial_transactions[][order_group_id]'}
|
||||
= options_for_select OrderGroup.find(:all, :order => 'name').collect { |g| [ g.name, g.id ] }
|
||||
%td= text_field_tag 'financial_transactions[][amount]'
|
||||
%td= link_to_function image_tag("b_drop.png", :size => "16x16", :alt => _("Remove"), :border => "0"), "$(this).up('.transaction').remove()", {:title => _("Remove ordergroup")}
|
||||
60
app/views/finance/_summary.haml
Normal file
60
app/views/finance/_summary.haml
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
%p
|
||||
%b=h @order.supplier ? @order.supplier.name : _('nonexistent')
|
||||
| Rechnungsnummer:
|
||||
= @order.invoice_number
|
||||
| Rechnungsdatum:
|
||||
= @order.invoice_date
|
||||
|
|
||||
= link_to_remote image_tag('b_edit.png', :size => "16x16", :border => 0, :alt => 'Rechnungsbetrag ändern'), |
|
||||
:url => {:action => "editOrderSummary", :id => @order}, |
|
||||
:before => "Element.show('loader')", |
|
||||
:success => "Element.hide('loader')" |
|
||||
%table
|
||||
%tr
|
||||
%td{:colspan => "2"}
|
||||
%b Foodcoop
|
||||
%td{:colspan => "2"}
|
||||
%b Lieferant
|
||||
%tr
|
||||
%td
|
||||
%abbr{:title => "gelieferten Artikel x Nettopreis"} Nettobetrag:
|
||||
%td= number_to_currency(@order.sumPrice("clear"))
|
||||
%td
|
||||
Rechnungsbetrag
|
||||
%small (incl. Pfand/Gutschriften)
|
||||
%td#invoice_amount= number_to_currency(@order.invoice_amount)
|
||||
%tr
|
||||
%td
|
||||
%abbr{:title => "Nettobetrag mit Pfand und MwSt."} Bruttobetrag:
|
||||
%td= number_to_currency(@order.sumPrice("gross"))
|
||||
%td
|
||||
%span - extra Pfand
|
||||
%small (Kistenpfand etc.)
|
||||
%td#deposit= number_to_currency(@order.deposit)
|
||||
%tr
|
||||
%td
|
||||
%abbr{:title => "Bruttobetrag mit Foodcoop Aufschlag"} FC Summe:
|
||||
%td= number_to_currency(@order.sumPrice("fc"))
|
||||
%td{:style => "border-bottom: 1px solid grey"}
|
||||
+ Pfandgutschriften
|
||||
%td{:style => "border-bottom: 1px solid grey"}
|
||||
#deposit_credit= number_to_currency(@order.deposit_credit)
|
||||
%tr
|
||||
%td
|
||||
%abbr{:title => "Zugeteilte Mengen x Bruttopreise (inkl. Aufschlag)"} Gruppenbeträge:
|
||||
%td#groups_amount= number_to_currency(@order.sumPrice("groups"))
|
||||
%td
|
||||
Summe
|
||||
%small (Rechungsbetrag ohne Pfand)
|
||||
%td#clear_invoice= number_to_currency(@order.invoice_amount - @order.deposit + @order.deposit_credit)
|
||||
%tr
|
||||
%td{:colspan => "4"}
|
||||
%abbr{:title => "Gruppenbeträge ohne Aufschlag minus Rechnung ohne Pfand. |
|
||||
Im Idealfall sollte hier 0.00 stehen."} Differenz ohne Aufschlag: |
|
||||
%span#fcProfit= number_to_currency(@order.fcProfit(false))
|
||||
%tr
|
||||
%td{:colspan => "4"}
|
||||
%b
|
||||
%abbr{:title => "= Gruppenbeträge - Rechnung ohne Pfand"} Differenz mit Aufschlag
|
||||
= "(#{number_to_percentage(FoodSoft.getPriceMarkup)}):"
|
||||
%span#fcProfit= number_to_currency(@order.fcProfit)
|
||||
16
app/views/finance/confirmOrder.haml
Normal file
16
app/views/finance/confirmOrder.haml
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
%h1 Bestellung abschließen
|
||||
.single_column#confirm{:style => "width:35em"}
|
||||
%p
|
||||
Wenn die Bestellung abgeschlossen wird, werden ebenfalls alle Gruppenkonten aktualisiert.
|
||||
%br/
|
||||
Die Konten werden wie folgt belastet:
|
||||
%table.list{:style => "width:35em"}
|
||||
- for groupResult in @order.group_order_results
|
||||
%tr{:class => cycle('even', 'odd')}
|
||||
%td= groupResult.group_name
|
||||
%td= number_to_currency(groupResult.price)
|
||||
%p
|
||||
%div{:style => "float:left"}
|
||||
= button_to "Abschließen", :action => "balanceOrder", :id => @order
|
||||
%div{:style => "float:right"}
|
||||
= link_to 'Zurück zur Abrechnung', :action => "editOrder", :id => @order
|
||||
48
app/views/finance/editOrder.haml
Normal file
48
app/views/finance/editOrder.haml
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
%h1 Bestellung abrechnen
|
||||
- if @order.booked
|
||||
%p
|
||||
%b Achtung, Bestellung wurde schon abgerechnet!
|
||||
.left_column{:style => 'width: 50em'}
|
||||
.box_title
|
||||
%h2
|
||||
= @order.name + " | " + format_date(@order.starts) + ' --> ' + format_date(@order.ends)
|
||||
.column_content#summary
|
||||
#order_summary
|
||||
= render :partial => "summary"
|
||||
.right_column{:style => 'width: 20em'}
|
||||
.box_title
|
||||
%h2 Aktionen
|
||||
.column_content
|
||||
%ul
|
||||
- unless @order.booked
|
||||
%li= link_to "Bestellung abschließen", :action => "confirmOrder", :id => @order
|
||||
|
||||
.right_column{:style => 'clear:both;width: 28%'}
|
||||
.box_title
|
||||
%h2 Protokoll
|
||||
.column_content
|
||||
#note
|
||||
- unless @order.note.empty?
|
||||
= simple_format @order.note
|
||||
- else
|
||||
%p Hier kannst Du deine Abrechnung kommentieren
|
||||
%small Protokoll bearbeiten:
|
||||
= link_to_remote image_tag("b_edit.png", :size => "16x16", :border => "0"), |
|
||||
:update => 'results', :url => { :action => 'editOrder', :id => @order, :view => 'editNote' }, |
|
||||
:before => "Element.show('loader')", :success => "Element.hide('loader')" |
|
||||
%hr/
|
||||
#comments
|
||||
= render :partial => 'shared/comments'
|
||||
|
||||
.left_column{:style => 'width: 69%'}
|
||||
.box_title
|
||||
#editOrderNav
|
||||
%ul
|
||||
%li= link_to_remote 'Gruppenübersicht', :update => 'results', :url => { :action => 'editOrder', :id => @order, :view => 'groupsOverview' }, :before => "Element.show('loader')", :success => "Element.hide('loader')"
|
||||
%li= link_to_remote 'Artikelübersicht', :update => 'results', :url => { :action => 'editOrder', :id => @order, :view => 'articlesOverview' }, :before => "Element.show('loader')", :success => "Element.hide('loader')"
|
||||
%li= link_to_remote 'Bestellung bearbeiten', :update => 'results', :url => { :action => 'editOrder', :id => @order, :view => 'editResults' }, :before => "Element.show('loader')", :success => "Element.hide('loader')"
|
||||
.column_content
|
||||
#results
|
||||
= render :partial => 'groupsOverview'
|
||||
%p= link_to_top
|
||||
#edit_box{:style => 'display:none'}
|
||||
44
app/views/finance/index.haml
Normal file
44
app/views/finance/index.haml
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
%h1 Finanzbereich
|
||||
.left_column{:style => 'width: 50%'}
|
||||
.box_title
|
||||
%h2 letzte Überweisungen
|
||||
.column_content
|
||||
%p
|
||||
= link_to "Bestellgruppen", :action => "listOrdergroups"
|
||||
%table.list
|
||||
%thead
|
||||
%tr
|
||||
%th Datum
|
||||
%th Gruppe
|
||||
%th Notiz
|
||||
%th Betrag
|
||||
%tbody
|
||||
- @financial_transactions.each do |ft|
|
||||
%tr{:class => cycle("even","odd", :name => "financial_transaction")}
|
||||
%td= format_date(ft.created_on)
|
||||
%td= ft.order_group.name
|
||||
%td{:style => "width:50%"}=h ft.note
|
||||
%td{:style => "color:#{ft.amount < 0 ? 'red' : 'black'}", :class => "currency"}= number_to_currency(ft.amount)
|
||||
|
||||
.right_column{:style => 'width: 46%'}
|
||||
.box_title
|
||||
%h2 noch nicht abgerechnet
|
||||
.column_content
|
||||
%p= link_to "Bestellungsübersicht", :action => "listOrders"
|
||||
- unless @orders.empty?
|
||||
%table.list
|
||||
%thead
|
||||
%tr
|
||||
%th Name
|
||||
%th Ende
|
||||
%th Betrag(FC)
|
||||
%th
|
||||
%tbody
|
||||
- @orders.each do |order|
|
||||
%tr{:class => cycle("even","odd", :name => "order")}
|
||||
%td= order.name
|
||||
%td= format_date(order.ends)
|
||||
%td{:class => "currency"}= number_to_currency(order.sumPrice("fc"))
|
||||
%td= link_to "abrechnen", :action => "editOrder", :id => order
|
||||
- else
|
||||
Super, alles schon abgerechnet...
|
||||
24
app/views/finance/listOrdergroups.haml
Normal file
24
app/views/finance/listOrdergroups.haml
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
- title _("Manage accounts")
|
||||
%p
|
||||
%i
|
||||
=_ "To create multiple transactions at once please follow this "
|
||||
= link_to _("link"), :action => 'new_transactions'
|
||||
.left_column{:style=>"width:50em"}
|
||||
.box_title
|
||||
%h2=_ "Ordergroups"
|
||||
.column_content
|
||||
#group_filter
|
||||
%form{:name=>"sform", :action=>"", :style=>"display:inline;"}
|
||||
%label{:for => 'article_name'}= _("Search 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 => 'listOrdergroups'}, |
|
||||
:with => 'query' |
|
||||
#table
|
||||
= render :partial => "listOrdergroups"
|
||||
%br/
|
||||
- if @current_user.role_admin?
|
||||
= link_to _("New ordergroup"), :controller => 'admin', :action => 'newOrderGroup'
|
||||
37
app/views/finance/listOrders.haml
Normal file
37
app/views/finance/listOrders.haml
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
%h1 beendete Bestellungen
|
||||
%p
|
||||
%i
|
||||
Aktuell gibt es die Möglichkeit eine Bestellung mittels dem "abrechnen"-link zu verbuchen, d.h.
|
||||
nach Bearbeitung der Liefermengen die Gruppenbeträge automatisiert zu verbuchen,
|
||||
%br/
|
||||
oder die Bestellung manuell abzurechnen (Kontostände selbst zu aktualisieren) und mittels "auf gebucht setzen"
|
||||
die Bestellung als abgeschlossen zu deklarieren.
|
||||
.left_column{:style => "width:70em"}
|
||||
.box_title
|
||||
.column_content
|
||||
- unless @orders.empty?
|
||||
= will_paginate @orders
|
||||
%table.list
|
||||
%thead
|
||||
%tr
|
||||
%th Name
|
||||
%th Anbieter
|
||||
%th Ende
|
||||
%th Status
|
||||
%th zuletzt bearbeitet von
|
||||
%th
|
||||
%tbody
|
||||
- @orders.each do |order|
|
||||
%tr{:class => cycle("even","odd", :name => "order")}
|
||||
%td= link_to truncate(order.name), :action => "editOrder", :id => order
|
||||
%td=h order.supplier ? order.supplier.name : _('nonexistent')
|
||||
%td=h format_time(order.ends) unless order.ends.nil?
|
||||
%td= order.booked ? "abgerechnet (#{number_to_currency order.fcProfit})" : "beendet"
|
||||
%td= order.updated_by.nil? ? '??' : order.updated_by.nick
|
||||
%td
|
||||
- unless order.booked
|
||||
= link_to "abrechnen", :action => "editOrder", :id => order
|
||||
|
|
||||
= link_to 'auf "gebucht" setzen', {:action => 'setAllBooked', :id => order}, :confirm => 'Wirklich alle Gruppenbestellungen für diese Bestellung auf "gebucht" setzen?', :method => "post"
|
||||
- else
|
||||
%i derzeit gibt es keine beendeten Bestellungen
|
||||
20
app/views/finance/new_transactions.haml
Normal file
20
app/views/finance/new_transactions.haml
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
- title _("Update multiple accounts")
|
||||
|
||||
- form_tag :action => "create_transactions" do
|
||||
%p
|
||||
%b= _("Note") + ":"
|
||||
= text_field_tag "note"
|
||||
%p
|
||||
%table#OrderGroups{:style => "width:20em"}
|
||||
%tr
|
||||
%th=_ "Ordergroup"
|
||||
%th=_ "Amount"
|
||||
= render :partial => 'order_group', :collection => [1, 2, 3]
|
||||
|
||||
%p
|
||||
= link_to_function _("Add another ordergroup") do |page|
|
||||
- page.insert_html :bottom, :OrderGroups, :partial => 'order_group'
|
||||
%p
|
||||
= submit_tag _("Save")
|
||||
|
|
||||
= link_to _("Cancel"), :action => 'listOrdergroups'
|
||||
10
app/views/financial_transactions/_form.rhtml
Normal file
10
app/views/financial_transactions/_form.rhtml
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<%= error_messages_for 'financial_transaction' %>
|
||||
|
||||
<div class="edit_form" style="width:30em">
|
||||
<p><b><%=h @group.name %></b>
|
||||
<p><label for="financial_transaction_amount">Betrag</label>
|
||||
<%= text_field 'financial_transaction', 'amount', :size => '10' %> Euro</p>
|
||||
|
||||
<p><label for="financial_transaction_note">Note</label><br/>
|
||||
<%= text_area 'financial_transaction', 'note', :cols => "40", :rows => "5" %></p>
|
||||
</div>
|
||||
41
app/views/financial_transactions/_list.rhtml
Normal file
41
app/views/financial_transactions/_list.rhtml
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
<% if @total == 0 %>
|
||||
|
||||
<p>Keine gefunden</p>
|
||||
|
||||
<% else %>
|
||||
|
||||
<p>Anzahl gefundener Transaktionen: <b><%= @total %></b></p>
|
||||
|
||||
<p>
|
||||
<%= pagination_links_remote @financial_transactions, @per_page, {:sort => params[:sort], :query => params['query']}%>
|
||||
</p>
|
||||
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<td <%= sort_td_class_helper "date" %>>
|
||||
<%= sort_link_helper "Datum", "date" %>
|
||||
</td>
|
||||
<td>Wer</td>
|
||||
<td <%= sort_td_class_helper "note" %>>
|
||||
<%= sort_link_helper "Notiz", "note" %>
|
||||
</td>
|
||||
<td <%= sort_td_class_helper "amount" %>>
|
||||
<%= sort_link_helper "Betrag", "amount" %>
|
||||
</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @financial_transactions.each do |t| %>
|
||||
<tr class="<%= cycle("even","odd") %>">
|
||||
<td><%= format_time(t.created_on) %></td>
|
||||
<td><%=h t.user.nil? ? '??' : t.user.nick %></td>
|
||||
<td><%=h t.note %></td>
|
||||
<td style="color:<%= t.amount < 0 ? 'red' : 'black' %>; width:5em" class="currency"><%= number_to_currency(t.amount) %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<% end %>
|
||||
24
app/views/financial_transactions/list.rhtml
Normal file
24
app/views/financial_transactions/list.rhtml
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
<h1>Kontoauszug für <%= @group.name %></h1>
|
||||
<p>
|
||||
<b>Kontostand: <%= number_to_currency(@group.account_balance) -%></b>
|
||||
<span style="color:grey">(zuletzt aktualisiert vor <%= distance_of_time_in_words(Time.now, @group.account_updated) -%>)</span>
|
||||
</p>
|
||||
<div class="left_column" style="width:100%">
|
||||
<div class="box_title"><h2>Überweisungen</h2></div>
|
||||
<div class="column_content">
|
||||
<form name="sform" action="" style="display:inline;">
|
||||
<label for="financial_transaction_note">in Notizen suchen: </label>
|
||||
<%= text_field_tag("query", params['query'], :size => 10 ) %>
|
||||
</form>
|
||||
<%= observe_field 'query', :frequency => 2,
|
||||
:before => "Element.show('loader')",
|
||||
:success => "Element.hide('loader')",
|
||||
:url => {:action => 'listTransactions'},
|
||||
:with => 'query' %>
|
||||
<div id="table">
|
||||
<%= render :partial => "/financial_transactions/list" %>
|
||||
</div>
|
||||
<p><%= link_to 'Neue Transaktion', :action => 'newTransaction', :id => @group %></p>
|
||||
</div>
|
||||
</div>
|
||||
<%= link_to 'Bestellgruppen', :controller => 'finance', :action => "listOrdergroups" %>
|
||||
9
app/views/financial_transactions/new.rhtml
Normal file
9
app/views/financial_transactions/new.rhtml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<h1>Neue Transaktion</h1>
|
||||
|
||||
<% form_tag(:action => 'createTransaction', :id => @group) do -%>
|
||||
<%= render :partial => 'financial_transactions/form' %>
|
||||
<%= submit_tag 'Speichern' %>
|
||||
<%= hidden_field 'financial_transaction', 'order_group_id' %>
|
||||
<% end -%>
|
||||
<br />
|
||||
<%= link_to 'Zurück', :controller => 'finance' %>
|
||||
21
app/views/groups/_edit_members.rhtml
Normal file
21
app/views/groups/_edit_members.rhtml
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
<h1>Mitglieder von <%=h @group.name %></h1>
|
||||
<p>
|
||||
<i>Hier kannst Du die Mitglieder der Gruppe verwalten.</i>
|
||||
</p>
|
||||
<div class="left_column" style="width:48%">
|
||||
<div class="box_title">
|
||||
<h2>Sind schon Mitglieder</h2>
|
||||
</div>
|
||||
<div class="column_content" id="members">
|
||||
<%=render :partial => 'groups/members' %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="right_column" style="width:48%">
|
||||
<div class="box_title">
|
||||
<h2>Sind noch keine Mitglieder</h2>
|
||||
</div>
|
||||
<div class="column_content" id="non_members">
|
||||
<%= render :partial => 'groups/non_members' %>
|
||||
<%= link_to('Person einladen', :controller =>'index', :action => 'invite', :id => @group) if (@current_user.is_member_of(@group) || @current_user.role_admin?) %>
|
||||
</div>
|
||||
</div>
|
||||
87
app/views/groups/_form.haml
Normal file
87
app/views/groups/_form.haml
Normal file
|
|
@ -0,0 +1,87 @@
|
|||
= error_messages_for 'group'
|
||||
|
||||
<!--[form:group]-->
|
||||
%div{:style => "float:left;width:55%;"}
|
||||
- if controller.controller_name == "admin" || !@group.is_a?(OrderGroup)
|
||||
%p
|
||||
%label{:for => "group_name"} Names
|
||||
%br/
|
||||
= text_field 'group', 'name', :size => 20
|
||||
%p
|
||||
%label{:for => "group_description"} Beschreibung
|
||||
%br/
|
||||
= text_field 'group', 'description', :size => 40
|
||||
- if @group.is_a?(OrderGroup) && controller.controller_name == "admin"
|
||||
%p
|
||||
%label{:for => "group_actual_size"} Aktuelle Gruppengröße
|
||||
%br/
|
||||
= text_field "group", "actual_size", :size => 3
|
||||
- if controller.controller_name == "admin"
|
||||
%div{:style => "float:right;width:40%"}
|
||||
%h3 Gruppe hat Zugriff auf
|
||||
%table
|
||||
%tr
|
||||
%td
|
||||
%label{:for => "group_role_admin"} Administration
|
||||
%td= check_box 'group', 'role_admin'
|
||||
%tr
|
||||
%td
|
||||
%label{:for => "group_role_finance"} Finanzen
|
||||
%td= check_box 'group', 'role_finance'
|
||||
%tr
|
||||
%td
|
||||
%label{:for => "group_role_suppliers"} Lieferantenverwaltung
|
||||
%td= check_box 'group', 'role_suppliers'
|
||||
%tr
|
||||
%td
|
||||
%label{:for => "group_role_article_meta"} Artikelverwaltung
|
||||
%td= check_box 'group', 'role_article_meta'
|
||||
%tr
|
||||
%td
|
||||
%label{:for => "group_role_orders"} Bestellungsverwaltung
|
||||
%td= check_box 'group', 'role_orders'
|
||||
-unless @group.is_a?(OrderGroup)
|
||||
%div{:style => "clear:both"}
|
||||
%h3
|
||||
Wöchentliche Jobs definieren?
|
||||
= check_box "group", "weekly_task", {:onclick => "toggleWeeklyTask();"}
|
||||
%table
|
||||
%tr
|
||||
%td
|
||||
%label{:for => "group_weekday"} Wochentag:
|
||||
%td
|
||||
%select#group_weekday{:name => "group[weekday]"}
|
||||
= options_for_select([["Montag", "1"], ["Dienstag", "2"], ["Mittwoch","3"],["Donnerstag","4"],["Freitag","5"],["Samstag","6"],["Sonntag","0"]], [@group.weekday.to_s])
|
||||
%tr
|
||||
%td
|
||||
%label{:for => "group_task_name"} Dienstname:
|
||||
%td= text_field "group", "task_name",:size => 20
|
||||
%tr
|
||||
%td
|
||||
%label{:for => "group_task_name"} Benötigte Verantwortliche:
|
||||
%td= text_field "group", "task_required_users",:size => 3
|
||||
%tr
|
||||
%td
|
||||
%label{:for => "group_task_name"} Beschreibung:
|
||||
%td= text_area "group", "task_description"
|
||||
|
||||
%script{ 'type' => "text/javascript"}
|
||||
:plain
|
||||
//<![CDATA[
|
||||
// preset data
|
||||
function toggleWeeklyTask(){
|
||||
if ($("group_weekly_task").checked == true) {
|
||||
$('group_weekday').disabled = false;
|
||||
$('group_task_name').disabled = false;
|
||||
$('group_task_required_users').disabled = false;
|
||||
$('group_task_description').disabled = false;
|
||||
} else {
|
||||
$('group_weekday').disabled = true;
|
||||
$('group_task_name').disabled = true;
|
||||
$('group_task_required_users').disabled = true;
|
||||
$('group_task_description').disabled = true;
|
||||
}
|
||||
}
|
||||
toggleWeeklyTask();
|
||||
//]]>
|
||||
<!--[eoform:group]-->
|
||||
16
app/views/groups/_members.rhtml
Normal file
16
app/views/groups/_members.rhtml
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<% if flash[:error] %><h3 class="error" id="flashError" ><%= flash[:error] %></h3><%= javascript_tag("new Effect.Highlight('flashError', {delay:0.8, duration:1});") -%><% end %>
|
||||
<% memberships = @group.memberships
|
||||
if memberships.size != 0 %>
|
||||
<ul style="">
|
||||
<% for membership in memberships %>
|
||||
<li style="margin-left:-15px">
|
||||
<b><%= link_to membership.user.nick, :action => "showUser", :id => membership.user %></b> (<%=h membership.user.first_name + ' ' + membership.user.last_name %>)
|
||||
| <%= link_to_remote 'entfernen', :url => {:action => 'dropMember', :group => @group, :membership => membership},
|
||||
:before => "Element.show('loader')",
|
||||
:success => "Element.hide('loader')" %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% else %>
|
||||
<p><i><%= @group.name %> hat keine Mitglieder.</i></p>
|
||||
<% end %>
|
||||
8
app/views/groups/_non_members.rhtml
Normal file
8
app/views/groups/_non_members.rhtml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<ul>
|
||||
<% for user in @group.non_members %>
|
||||
<li><b><%= link_to user.nick, :action => "showUser", :id => user %></b> (<%=h user.first_name + ' ' + user.last_name %>)
|
||||
| <%= link_to_remote 'hinzufügen', :url => {:action => 'addMember', :id => @group, :user => user},
|
||||
:before => "Element.show('loader')",
|
||||
:success => "Element.hide('loader')" %> </li>
|
||||
<% end %>
|
||||
</ul>
|
||||
6
app/views/groups/_workgroup_members.haml
Normal file
6
app/views/groups/_workgroup_members.haml
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
- for group in Group.find :all, :conditions => "type != 'OrderGroup'"
|
||||
%h4= link_to_function group.name, "Element.toggle('group_#{group.id}')"
|
||||
%ul{:style => "display:none"}[group]
|
||||
- for user in group.users.find :all, :order => "nick"
|
||||
%li= user.nick + " (#{user.find_ordergroup.name if user.find_ordergroup})"
|
||||
|
||||
8
app/views/groups/edit.rhtml
Normal file
8
app/views/groups/edit.rhtml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<h1>Gruppe bearbeiten</h1>
|
||||
<div class="edit_form" style="width:50em">
|
||||
<% form_tag(:action => 'updateGroup', :id => @group) do %>
|
||||
<%= render :partial => 'groups/form' %>
|
||||
<br style="clear:both" />
|
||||
<%= submit_tag 'Speichern' %> | <%= link_to "Abbrechen", :action => "listGroups" %>
|
||||
<% end %>
|
||||
</div>
|
||||
33
app/views/index/_list_members.haml
Normal file
33
app/views/index/_list_members.haml
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
- unless params[:sort_by_ordergroups]
|
||||
%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 Nick
|
||||
%th Vorname
|
||||
%th Nachname
|
||||
%th Email
|
||||
%th Telefon
|
||||
%th Bestellgruppe
|
||||
%th Arbeitsgruppe(n)
|
||||
%tbody
|
||||
- for user in @users
|
||||
%tr{:class => cycle('even','odd', :name => 'users')}
|
||||
- groups = user.groups
|
||||
- ordergroup = groups.detect { |group| group.is_a?(OrderGroup) }
|
||||
- workgroups = groups.select { |group| !group.is_a?(OrderGroup) }.collect(&:name)
|
||||
%td= link_to user.nick, {:controller => "messages", :action => "user", :id => user}, :title => _('Send user an email')
|
||||
%td=h user.first_name if @current_user.role_admin? || user.settings["profile.nameIsPublic"] == '1'
|
||||
%td=h user.last_name if @current_user.role_admin? || user.settings["profile.nameIsPublic"] == '1'
|
||||
%td=h user.email if @current_user.role_admin? || user.settings["profile.emailIsPublic"] == '1'
|
||||
%td=h user.phone if @current_user.role_admin? || user.settings["profile.phoneIsPublic"] == '1'
|
||||
%td=h ordergroup.name if ordergroup
|
||||
%td=h workgroups.join(', ')
|
||||
|
||||
40
app/views/index/_showGroup.haml
Normal file
40
app/views/index/_showGroup.haml
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
.single_column{:style => "width:50em"}
|
||||
.box_title
|
||||
%h2= @group.name
|
||||
.column_content
|
||||
%table
|
||||
%tr
|
||||
%td= _("Description") + ":"
|
||||
%td= @group.description
|
||||
%tr
|
||||
%td= _("Group has access to") + ":"
|
||||
%td
|
||||
- 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(', ')
|
||||
%tr
|
||||
%td= _("Members") + ":"
|
||||
%td
|
||||
- members = @group.users
|
||||
= "(#{members.size})"
|
||||
= members.collect(&:nick).join(", ")
|
||||
%tr
|
||||
%td= _("Weekly task") + ":"
|
||||
%td
|
||||
- if @group.weekly_task
|
||||
=h @group.task_name
|
||||
=_ "at"
|
||||
= weekday(@group.weekday)
|
||||
- else
|
||||
=_ 'No weekly tasks defined yet'
|
||||
%p
|
||||
= link_to _("Show all tasks"), :controller => "tasks", :action => "workgroup", :id => @group
|
||||
|
|
||||
- if @group.member?(@current_user)
|
||||
= link_to _("Edit group"), :action => "editGroup", :id => @group
|
||||
|
|
||||
= link_to _('Send members a message'), :controller => 'messages', :action => 'group', :id => @group
|
||||
43
app/views/index/_start_nav.haml
Normal file
43
app/views/index/_start_nav.haml
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
%h2= _('Go to ...')
|
||||
%ul
|
||||
%li
|
||||
= _('FoodCoop')
|
||||
%ul
|
||||
%li= link_to _("Member list"), :controller => "index", :action => "foodcoop_members"
|
||||
%li= link_to _("My tasks"), :controller => "tasks", :action => "myTasks"
|
||||
%li= link_to _("Write message"), :controller => "messages", :action => "new"
|
||||
|
||||
// Orders
|
||||
- hasOrderGroup = !@current_user.find_ordergroup.nil?
|
||||
- hasOrdersRole = @current_user.role_orders?
|
||||
- if hasOrderGroup || hasOrdersRole
|
||||
%li
|
||||
= _("Orders")
|
||||
%ul
|
||||
- if hasOrderGroup
|
||||
%li= link_to _('Order summary'), :controller => "ordering"
|
||||
- if hasOrdersRole
|
||||
%li= link_to _('Finish order'), :controller => 'orders'
|
||||
// Articles
|
||||
- if @current_user.role_article_meta? || @current_user.role_suppliers?
|
||||
%li
|
||||
= _("Artcle management")
|
||||
%ul
|
||||
%li= link_to _("Refresh articles"), :controller => "articles", :action => 'list'
|
||||
%li= link_to _("Suppliers"), :controller => 'suppliers', :action => 'list'
|
||||
|
||||
// Finance
|
||||
- if @current_user.role_finance?
|
||||
%li
|
||||
= _('Financial management')
|
||||
%ul
|
||||
%li= link_to _("Update account balances"), :controller => 'finance', :action => 'new_transactions'
|
||||
%li= link_to _('Cancel orders'), :controller => 'finance'
|
||||
|
||||
// Administration
|
||||
- if @current_user.role_admin?
|
||||
%li
|
||||
= _('Administration')
|
||||
%ul
|
||||
%li= link_to _("New ordergroup"), :controller => "admin", :action => "newOrderGroup"
|
||||
%li= link_to _("New user"), :controller => "admin", :action => "newUser"
|
||||
14
app/views/index/editGroup.haml
Normal file
14
app/views/index/editGroup.haml
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
%h1 Gruppe bearbeiten
|
||||
|
||||
%p
|
||||
%i
|
||||
Mitglieder kannst du
|
||||
= link_to "hier", :action => "members", :id => @group
|
||||
hinzufügen.
|
||||
.edit_form{:style => "width:35em"}
|
||||
- form_tag(:action => 'updateGroup', :id => @group) do
|
||||
= render :partial => "/groups/form"
|
||||
%p{:style => "clear:both"}
|
||||
= submit_tag 'Speichern'
|
||||
|
|
||||
= link_to "Abbrechen", :action => "showGroup", :id => @group
|
||||
11
app/views/index/editProfile.rhtml
Normal file
11
app/views/index/editProfile.rhtml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<h1>Meine Daten bearbeiten</h1>
|
||||
<div class="left_column" style="width: 100%;">
|
||||
<div class="box_title"><h2><%= h @user.nick %></h2></div>
|
||||
<div class="column_content">
|
||||
<% form_tag(:action => 'updateProfile') do %>
|
||||
<%= render :partial => 'users/form' %>
|
||||
<p style="clear:both">
|
||||
<%= submit_tag 'Speichern' %> | <%= link_to 'Abbrechen', :action => 'myProfile' %></p>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
33
app/views/index/foodcoop_members.haml
Normal file
33
app/views/index/foodcoop_members.haml
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
%h1 Mitglieder der Foodcoop
|
||||
%p
|
||||
%i
|
||||
Hier kannst Du den Mitgliedern Deiner Foodcoop eine Nachricht schreiben.
|
||||
%br/
|
||||
Damit Deine Kontaktdaten einzusehen sind, musst Du sie unter
|
||||
= link_to "Einstellungen", :action => "editProfile"
|
||||
freigeben.
|
||||
|
||||
.left_column{:style => "width:100%"}
|
||||
.box_title
|
||||
%h2 Übersicht
|
||||
.column_content
|
||||
- unless params[:sort_by_ordergroups]
|
||||
#user_filter{:style => "float:left; margin-right:2em;"}
|
||||
%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 => 'foodcoop_members'}, |
|
||||
:with => 'query' |
|
||||
|
||||
=_ "Sort by Ordergroups :"
|
||||
- form_tag({:action => "foodcoop_members"}, :method => "get", :style=>"display:inline;") do
|
||||
-unless params[:sort_by_ordergroups]
|
||||
%input{:type => "checkbox", :name => :sort_by_ordergroups, :value => "1", :onclick => "submit();"}
|
||||
-else
|
||||
%input{:type => "checkbox", :name => :sort_by_ordergroups, :value => "0", :checked => "checked", :onclick => "submit();"}
|
||||
#user_table
|
||||
= render :partial => "list_members"
|
||||
71
app/views/index/index.haml
Normal file
71
app/views/index/index.haml
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
%h1 Startseite
|
||||
|
||||
#start_nav
|
||||
= render :partial => 'start_nav'
|
||||
|
||||
- unless @unaccepted_tasks.empty? && @next_tasks.empty? && @unassigned_tasks_number == 0
|
||||
.right_column{:style => "width:70%"}
|
||||
.box_title
|
||||
%h2=_ "Tasks"
|
||||
.column_content
|
||||
-unless @next_tasks.empty?
|
||||
%div{:style => "float:left, margin-bottom:2em"}
|
||||
%h3=_ "Your tasks for the upcoming week:"
|
||||
%table{:style => "width:25em"}
|
||||
-for task in @next_tasks
|
||||
%tr
|
||||
%td= format_date task.due_date
|
||||
%td
|
||||
%b= task.name
|
||||
|
||||
- unless @unaccepted_tasks.empty?
|
||||
%h3=_ "Accept tasks"
|
||||
= _("Your are responsible for a few tasks.")
|
||||
= link_to _("Accept/Reject tasks"), :controller => "tasks", :action => "myTasks"
|
||||
- unless @unassigned_tasks_number == 0
|
||||
%h3=_ "Unassigned tasks"
|
||||
= _("There are") + " #{@unassigned_tasks_number} " + link_to(_("unassigned task(s)"), :controller => "tasks")
|
||||
%p{:style => "clear:both"}= link_to _("My tasks"), :controller => "tasks", :action => "myTasks"
|
||||
|
||||
- unless @messages.empty?
|
||||
.right_column{:style => "width:70%"}
|
||||
.box_title
|
||||
%h2=_ "Unread messages"
|
||||
.column_content
|
||||
= render :partial => 'messages/unread'
|
||||
%p= link_to _("All messages"), :controller => 'messages', :action => 'inbox'
|
||||
|
||||
- if @orderGroup
|
||||
// Current orders
|
||||
= render :partial => 'ordering/currentOrders'
|
||||
|
||||
|
||||
// OrderGroup overview
|
||||
.right_column{:style => "width:70%"}
|
||||
.box_title
|
||||
%h2=_ "My ordergroup"
|
||||
.column_content
|
||||
%p
|
||||
%b= @orderGroup.name
|
||||
|
|
||||
=_ "Account balance:"
|
||||
= number_to_currency(@orderGroup.account_balance)
|
||||
%span{:style => "color:grey"}
|
||||
(zuletzt aktualisiert vor
|
||||
= distance_of_time_in_words(Time.now, @orderGroup.account_updated) + ")"
|
||||
%h3=_ "Last transactions"
|
||||
%table
|
||||
%tr
|
||||
%th=_ "When"
|
||||
%th=_ "Who"
|
||||
%th=_ "Note"
|
||||
%th=_ "Amount"
|
||||
- for ft in @financial_transactions
|
||||
%tr{:class => cycle('even','odd')}
|
||||
%td= format_time(ft.created_on)
|
||||
%td= h(ft.user.nil? ? '?' : ft.user.nick)
|
||||
%td= h(ft.note)
|
||||
- color = ft.amount < 0 ? 'red' : 'black'
|
||||
%td{:style => "color:#{color}; width:5em", :class => "currency"}= number_to_currency(ft.amount)
|
||||
%br/
|
||||
= link_to _("more ..."), :action => "myOrdergroup"
|
||||
13
app/views/index/invite.haml
Normal file
13
app/views/index/invite.haml
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
%h1 Einladen
|
||||
%p
|
||||
Hier kannst du eine Person in die Gruppe
|
||||
=h @group.name
|
||||
einladen, die noch nicht Mitglied der Foodcoop ist.
|
||||
= error_messages_for('invite')
|
||||
.edit_form{:style => 'width:35em'}
|
||||
- form_for(:invite, @invite) do |i|
|
||||
%p
|
||||
Email-Adresse:
|
||||
= i.text_field('email', :size => 40, :maxlength => 128)
|
||||
%p
|
||||
= submit_tag('Einladung abschicken')
|
||||
8
app/views/index/members.rhtml
Normal file
8
app/views/index/members.rhtml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<%= render :partial => 'groups/edit_members' %>
|
||||
<p style="clear:both">
|
||||
<% if @group.is_a?(OrderGroup) -%>
|
||||
<%= link_to "Zurück", :action => "myOrdergroup" %>
|
||||
<% else -%>
|
||||
<%= link_to 'Zurück', :action => 'showGroup', :id => @group %>
|
||||
<% end -%>
|
||||
</p>
|
||||
42
app/views/index/myOrdergroup.rhtml
Normal file
42
app/views/index/myOrdergroup.rhtml
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
<h1>Meine Bestellgruppe</h1>
|
||||
<div class="left_column">
|
||||
<div class="box_title"><h2><%=h @ordergroup.name %></h2></div>
|
||||
<div class="column_content">
|
||||
<p><b>Beschreibung:</b> <%=h @ordergroup.description %>
|
||||
<%= link_to '(ändern)', :action => 'editGroup', :id => @ordergroup %>
|
||||
</p>
|
||||
<p><b>Gruppengröße:</b> <%=h @ordergroup.actual_size %></p>
|
||||
<p><b>Kontostand:</b> <%= number_to_currency(@ordergroup.account_balance) %></p>
|
||||
<h2>Personen</h2>
|
||||
<ul style="list-style-type:decimal;">
|
||||
<% for membership in @ordergroup.memberships %>
|
||||
<li>
|
||||
<%= link_to membership.user.nick, :controller => 'index', :action => 'showUser', :id => membership.user %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<%= link_to('Hinzufügen/entfernen', :action => 'members', :id => @ordergroup) %> |
|
||||
<%= link_to('Person einladen', :action => 'invite', :id => @ordergroup) %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="right_column">
|
||||
<div class="box_title"><h2>Kontoauszug</h2></div>
|
||||
<div class="column_content">
|
||||
<p>
|
||||
<form name="sform" action="" style="display:inline;">
|
||||
<label for="financial_transaction_note">Filter für Notizen: </label>
|
||||
<%= text_field_tag("query", params['query'], :size => 10 ) %>
|
||||
</form>
|
||||
</p>
|
||||
<%= observe_field 'query', :frequency => 2,
|
||||
:before => "Element.show('loader')",
|
||||
:success => "Element.hide('loader')",
|
||||
:url => {:action => 'myOrdergroup'},
|
||||
:with => 'query' %>
|
||||
<div id="table">
|
||||
<%= render :partial => "/financial_transactions/list" %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
30
app/views/index/myProfile.rhtml
Normal file
30
app/views/index/myProfile.rhtml
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
<h1><%= _('edit my profile')%></h1>
|
||||
<%= _('Here you can change your preferences. For example you can change your phone number or your password.
|
||||
<br>
|
||||
You can also see in which workgroups you are.
|
||||
<p></p>
|
||||
')%>
|
||||
<div class="left_column" style="width: 60%;">
|
||||
<div class="box_title"><h2>Nickname: <%= h @user.nick %><small> (Mitglied seit: <%= distance_of_time_in_words(Time.now, @user.created_on) -%>)</small></h2></div>
|
||||
<div class="column_content">
|
||||
<% form_tag(:action => 'updateProfile') do %>
|
||||
<%= render :partial => 'users/form' %>
|
||||
<p style="clear:both">
|
||||
<%= submit_tag 'Speichern' %> | <%= link_to 'Abbrechen', :action => 'myProfile' %></p>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="right_column" style="width: 35%;">
|
||||
<div class="box_title"><h2>Du bist Mitglied in folgenden Gruppen</h2></div>
|
||||
<div class="column_content">
|
||||
<% for membership in Membership.find_all_by_user_id(@user.id) %>
|
||||
<p>
|
||||
<%= link_to(membership.group.name, :action => 'showGroup', :id => membership.group) %>
|
||||
<% if membership.group.type != 'OrderGroup' %>
|
||||
(<%= link_to _("Cancel membership"), { :action => 'cancel_membership', :id => membership }, :confirm => _("Are you sure to cancel this membership?"), :method => :post %>)
|
||||
<% end %>
|
||||
</p>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
8
app/views/index/showGroup.haml
Normal file
8
app/views/index/showGroup.haml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
%h1
|
||||
=h @group.is_a?(OrderGroup) ? "Bestellgruppe:" : "Gruppe:"
|
||||
=h @group.name
|
||||
= render :partial => "showGroup"
|
||||
|
||||
- unless @group.is_a?(OrderGroup)
|
||||
%p{:style => "clear:both"}
|
||||
= link_to "alle Arbeitsgruppen", :action => "workgroups"
|
||||
12
app/views/index/showUser.haml
Normal file
12
app/views/index/showUser.haml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
%h1=h @user.nick
|
||||
.left_column{:style => "width:50em"}
|
||||
.box_title
|
||||
%h2 Übersicht
|
||||
.column_content
|
||||
= render :partial => "users/show"
|
||||
%p{:style => "clear:both"}
|
||||
%p= link_to "Nachricht senden", :controller => "messages", :action => 'user', :id => @user
|
||||
.box_title
|
||||
%h2 Gruppenabos
|
||||
.column_content
|
||||
= render :partial => "users/memberships"
|
||||
15
app/views/index/workgroups.haml
Normal file
15
app/views/index/workgroups.haml
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
%h1 Arbeitsgruppen
|
||||
|
||||
%p
|
||||
%i
|
||||
Das bearbeiten von Gruppen ist nur für Mitglieder der Gruppe möglich.
|
||||
%br/
|
||||
Wenn du einer Gruppe beitreten willst, dann schreib doch den Mitgliedern eine Nachricht.
|
||||
|
||||
- unless @groups.empty?
|
||||
-for @group in @groups
|
||||
= render :partial => "showGroup"
|
||||
|
||||
|
||||
|
||||
|
||||
37
app/views/layouts/application.haml
Normal file
37
app/views/layouts/application.haml
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
!!!
|
||||
%html
|
||||
%head
|
||||
%meta{"http-equiv" => "content-type", :content => "text/html;charset=UTF-8"}
|
||||
%title= "FoodSoft - " + (yield(:title) or controller.controller_name)
|
||||
= stylesheet_link_tag 'foodsoft'
|
||||
= stylesheet_link_tag "print", :media => "print"
|
||||
= javascript_include_tag 'prototype'
|
||||
= javascript_include_tag 'effects'
|
||||
= javascript_include_tag 'controls'
|
||||
= javascript_include_tag 'application'
|
||||
= javascript_include_tag('ordering') if (controller.controller_name == "ordering")
|
||||
%body
|
||||
#logininfo= render :partial => 'shared/loginInfo'
|
||||
|
||||
#header
|
||||
#logo
|
||||
%a{:href => "/"}
|
||||
<span>food</span>soft
|
||||
%span{:style => "color:white; font-size:45%; letter-spacing: -1px;"}= FoodSoft::getFoodcoopName
|
||||
#nav= render :partial => 'shared/nav'
|
||||
|
||||
#main
|
||||
#content
|
||||
- if flash[:notice]
|
||||
%h3.notice#flashNotice= flash[:notice]
|
||||
- if flash[:error]
|
||||
%h3.error#flashError= flash[:error]
|
||||
#loader{:style => "display:none;"}= image_tag("loader.gif", :border => 0)
|
||||
- if yield(:title)
|
||||
%h1= yield(:title)
|
||||
= yield
|
||||
|
||||
- if flash[:notice]
|
||||
= javascript_tag("new Effect.Highlight('flashNotice', {delay:0.8, duration:1});")
|
||||
- if flash[:error]
|
||||
= javascript_tag("new Effect.Highlight('flashError', {delay:0.8, duration:1});")
|
||||
15
app/views/layouts/login.haml
Normal file
15
app/views/layouts/login.haml
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
!!!
|
||||
%html
|
||||
%head
|
||||
%meta{"http-equiv" => "content-type", :content => "text/html;charset=UTF-8"}
|
||||
%title= "FoodSoft - " + (yield(:title) or controller.controller_name)
|
||||
= stylesheet_link_tag 'foodsoft'
|
||||
= javascript_include_tag 'prototype'
|
||||
%body
|
||||
#login
|
||||
- if yield(:title)
|
||||
%h1= yield(:title)
|
||||
= yield
|
||||
#meta
|
||||
Foodcoop
|
||||
= link_to_if FoodSoft::getFoodcoopUrl, FoodSoft::getFoodcoopName, FoodSoft::getFoodcoopUrl
|
||||
12
app/views/login/forgot_password.rhtml
Normal file
12
app/views/login/forgot_password.rhtml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<% title _('Forgot password?') %>
|
||||
<% if flash[:error] %>
|
||||
<p style="color: red"><%= flash[:error] %></p><% end %>
|
||||
<p><%= _('No problem: You can enter a new password here.') -%></p>
|
||||
<p><%= _("Just enter your email address. Then you'll receive an email with the detailed instructions.") %></p>
|
||||
<div class="edit_form" style="width:25em">
|
||||
<% form_tag(:action => 'reset_password') do %>
|
||||
<p><label for="user">Email</label><br/>
|
||||
<%= text_field 'login', 'email' %></p>
|
||||
<%= submit_tag _("Reset your password") %> | <%= link_to _("Back"), :action => 'login' %>
|
||||
<% end %>
|
||||
</div>
|
||||
47
app/views/login/invite.haml
Normal file
47
app/views/login/invite.haml
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
%h1=_ 'Invitation'
|
||||
%p
|
||||
=_ 'You are invited to join:'
|
||||
%b= @invite.group.name
|
||||
%p=_ 'If you accept the invitation and want to join the foodcoop please fill out the form.'
|
||||
.edit_form{:style => "width:25em"}
|
||||
- form_for(:user, @user) do |u|
|
||||
- if flash[:error]
|
||||
%p= flash[:error]
|
||||
= error_messages_for('user')
|
||||
%p
|
||||
%label{:for => 'nick'}=_ 'Nickname (for log in)'
|
||||
%br/
|
||||
= u.text_field 'nick', :maxlength => 25
|
||||
%p
|
||||
%label{:for => 'first_name'}=_ 'First name'
|
||||
%br/
|
||||
= u.text_field 'first_name', :maxlength => 50, :size => 25
|
||||
%p
|
||||
%label{:for => 'last_name'}=_ 'Last name'
|
||||
%br/
|
||||
= u.text_field 'last_name'
|
||||
%p
|
||||
%label{:for => 'phone'}=_ 'Phone'
|
||||
%br/
|
||||
= u.text_field 'phone'
|
||||
%p
|
||||
%label{:for => 'address'}=_ 'Address'
|
||||
%br/
|
||||
= u.text_field 'address'
|
||||
%p
|
||||
%label{:for => 'password'}=_ 'Password'
|
||||
%br/
|
||||
= password_field_tag 'user[password]'
|
||||
%p
|
||||
%label{:for => 'password_confirmation'}=_ 'Passwort confirmation'
|
||||
%br/
|
||||
= password_field_tag 'user[password_confirmation]'
|
||||
|
||||
%h3=_ 'Settings'
|
||||
- for setting in User::setting_keys.keys
|
||||
%p
|
||||
= check_box_tag "user[settings][#{setting}]", '1', @user.settings[setting] == '1' || @user.settings_default(setting)
|
||||
%label{:for => "user[settings][#{setting}]"}= User::setting_keys[setting]
|
||||
|
||||
= submit_tag _('Send')
|
||||
= javascript_tag("$('user_login').focus()")
|
||||
22
app/views/login/login.haml
Normal file
22
app/views/login/login.haml
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
%h1=_ 'Login'
|
||||
.edit_form{:style => "width:25em"}
|
||||
- form_tag :action => 'login' do
|
||||
- if flash[:notice]
|
||||
%div.notice= flash[:notice]
|
||||
- if flash[:error]
|
||||
%div.error= flash[:error]
|
||||
%p
|
||||
%label{:for => 'user'}=_ 'Username'
|
||||
%br/
|
||||
= text_field 'login', 'user'
|
||||
%p
|
||||
%label{:for => 'password'}=_ 'Password'
|
||||
%br/
|
||||
= password_field 'login', 'password'
|
||||
= submit_tag _('Login!')
|
||||
|
|
||||
= link_to _('Forgot Password?'), :action => 'forgot_password'
|
||||
%br/
|
||||
%br/
|
||||
%i{:style => 'font-size:0.8em;'}=_ 'Cookies must be accepted!'
|
||||
= javascript_tag("$('login_user').focus()")
|
||||
11
app/views/login/password.rhtml
Normal file
11
app/views/login/password.rhtml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<h1>Neues Passwort</h1>
|
||||
<p>Bitte neues Passwort für <%=h @user.nick %> eingeben.</p>
|
||||
<% if flash[:error] %><p style="color: red"><%= flash[:error] %></p><% end %>
|
||||
<div class="edit_form" style="width:25em">
|
||||
<% form_tag(:action => 'new', :id => @user.id, :token => @user.reset_password_token) do %>
|
||||
<p><label for="user">Neues Passwort</label><br/>
|
||||
<%= password_field_tag "user[password]" %></p>
|
||||
<p><label for="user">Passwort wiederholen</label><br/>
|
||||
<%= password_field_tag "user[password_confirmation]" %></p>
|
||||
<%= submit_tag 'Speichern' %> | <%= link_to 'abbrechen', :action => 'login' %>
|
||||
<% end %>
|
||||
19
app/views/mailer/invite.rhtml
Normal file
19
app/views/mailer/invite.rhtml
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
Hallo!
|
||||
|
||||
<%= @invite.user.first_name %> <%= @invite.user.last_name %> (<%= @invite.user.email %>) hat dich in die Gruppe "<%= @invite.group.name %>" eingeladen.
|
||||
Um die Einladung anzunehmen und der Foodcoop beizutreten, gehe zu: <%= @link %>
|
||||
Dieser Link kann nur einmal aufgerufen werden und ist nur bis <%= @invite.expires_at.strftime('%A den %d.%m.%Y um %H:%M') %> gültig.
|
||||
|
||||
Grüße sendet die Foodsoft!
|
||||
|
||||
=======
|
||||
|
||||
Hi!
|
||||
|
||||
<%= @invite.user.first_name %> <%= @invite.user.last_name %> (<%= @invite.user.email %>) has invited you to join the group "<%= @invite.group.name %>".
|
||||
To accept the invitation and to join the foodcoop please follow this link: <%= @link %>
|
||||
This link works only once and expires on <%= @invite.expires_at.strftime('%A den %d.%m.%Y um %H:%M') %>.
|
||||
|
||||
Greetings, your FoodSoft Team!
|
||||
|
||||
<%= render :partial => 'shared/mail_footer' %>
|
||||
14
app/views/mailer/message.rhtml
Normal file
14
app/views/mailer/message.rhtml
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
Foodsoft-Nachricht
|
||||
|
||||
Von: <%= @sender %>
|
||||
An: <%= @recipients %>
|
||||
|
||||
======================================================================
|
||||
<%= @body %>
|
||||
======================================================================
|
||||
|
||||
Antworten: <%= @reply %>
|
||||
Nachricht online einsehen: <%= @link %>
|
||||
Nachrichten-Einstellungen: <%= @profile %>
|
||||
|
||||
<%= render :partial => 'shared/mail_footer' %>
|
||||
20
app/views/mailer/password.rhtml
Normal file
20
app/views/mailer/password.rhtml
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
Hallo <%= @user.nick %>,
|
||||
|
||||
du (oder jemand anderes) hat auf der FoodSoft-Website ein neues Passwort angefordert.
|
||||
Um ein neues Passwort einzugeben, gehe zu: <%= @link %>
|
||||
Dieser Link kann nur einmal aufgerufen werden und läuft am <%= @user.reset_password_expires.strftime('%A (%d.%m.%Y %H:%M)') %> ab.
|
||||
Wenn du das Passwort nicht ändern möchtest oder diese Email nicht ausgelöst hast, brauchst du nichts zu tun. Dein bisheriges Passwort wurde nicht geändert.
|
||||
|
||||
Grüße sendet die Foodsoft! :)
|
||||
|
||||
===========
|
||||
|
||||
Hi <%= @user.nick %>,
|
||||
you have (or someone else has) requested a new password.
|
||||
In order to choose a new password follow this link: <%= @link %>
|
||||
This link works only once and expires on <%= @user.reset_password_expires.strftime('%A (%d.%m.%Y %H:%M)') %>.
|
||||
If you don't want to change your password, just ignore this message. Your password hasn't been changed yet.
|
||||
|
||||
Greetings, your FoodSoft Team!
|
||||
|
||||
<%= render :partial => 'shared/mail_footer' %>
|
||||
26
app/views/messages/_list.haml
Normal file
26
app/views/messages/_list.haml
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
- unless @messages.empty?
|
||||
- form_tag :action => 'destroy' do
|
||||
%table.list
|
||||
%thead
|
||||
%tr
|
||||
%th
|
||||
%input{:type => 'checkbox', :name => 'checkall', :id => 'checkall', :onclick => 'checkUncheckAll(this)'}
|
||||
%th Betreff
|
||||
%th Absender
|
||||
%th Datum
|
||||
%th
|
||||
%tbody
|
||||
- for message in @messages
|
||||
- style = message.read? ? '' : 'font-weight:bold'
|
||||
%tr{:class => cycle('even','odd', :name => 'inbox'), :style => style, :id => message.id, :onclick => "checkRow('#{message.id}')"}
|
||||
%td
|
||||
%input{:type => 'checkbox', :name => 'ids[]', :id => "checkbox_#{message.id}", :value => message.id, :onclick => "checkRow('#{message.id}')"}
|
||||
%td= link_to(h(message.subject), {:controller => 'messages', :action => 'show', :id => message})
|
||||
%td= message.sender ? h(message.sender.nick) : 'FoodSoft'
|
||||
%td= format_time(message.created_on)
|
||||
%td
|
||||
= link_to(image_tag('b_drop.png', :size => "16x16", :border => 0, :alt => 'löschen'), {:controller => 'messages', :action => 'destroy', :id => message}, :method => "post")
|
||||
= link_to('Antworten', :controller => 'messages', :action => 'reply', :id => message) unless message.system_message?
|
||||
%tr
|
||||
%td{:colspan => 5}= submit_tag 'Löschen'
|
||||
|
||||
15
app/views/messages/_unread.haml
Normal file
15
app/views/messages/_unread.haml
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
- unless @messages.empty?
|
||||
%table.list
|
||||
%thead
|
||||
%tr
|
||||
%th Betreff
|
||||
%th Absender
|
||||
%th Datum
|
||||
%tbody
|
||||
- for message in @messages
|
||||
%tr{:class => cycle('even','odd', :name => 'inbox')}
|
||||
%td= link_to(h(message.subject), {:controller => 'messages', :action => 'show', :id => message})
|
||||
%td= message.sender ? h(message.sender.nick) : 'FoodSoft'
|
||||
%td= format_time(message.created_on)
|
||||
|
||||
|
||||
5
app/views/messages/inbox.haml
Normal file
5
app/views/messages/inbox.haml
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
%h1 Nachrichten - Eingang
|
||||
|
||||
%p= link_to('Neue Nachricht', :action => 'new')
|
||||
|
||||
= render :partial => 'list'
|
||||
9
app/views/messages/negative_balance.rhtml
Normal file
9
app/views/messages/negative_balance.rhtml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
Hallo <%= user.nick %>!
|
||||
|
||||
Der Kontostand deiner Bestellgruppe <%= group.name %> ist durch eine Buchung am <%= transaction.created_on.strftime('%d.%m.%Y um %H:%M') %> ins Minus gerutscht: <%= FoodSoft::format_currency(group.account_balance) %>
|
||||
|
||||
Es wurden <%= FoodSoft::format_currency(transaction.amount) %> für "<%= transaction.note %>" abgebucht, die Buchung wurde von <%= transaction.user.nick %> erstellt.
|
||||
|
||||
Bitte zahlt so bald wie möglich wieder Geld ein, um das Gruppenkonto auszugleichen.
|
||||
|
||||
Viele Grüße von <%= FoodSoft::getFoodcoopName %>
|
||||
49
app/views/messages/new.haml
Normal file
49
app/views/messages/new.haml
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
%h1 Neue Nachricht
|
||||
|
||||
- form_tag(:action => 'create') do
|
||||
= error_messages_for 'message'
|
||||
|
||||
%p
|
||||
%label{:for => "message_recipient"} An
|
||||
%fieldset
|
||||
<input type="checkbox" name="everyone" value="yes"
|
||||
= "checked='checked'" if @everyone
|
||||
onchange="Element.toggle('recipients')" />
|
||||
gesamte Foodcoop
|
||||
%table{:id => 'recipients', :style => (@everyone ? 'display:none;' : '')}
|
||||
%tr
|
||||
%td
|
||||
%b BenutzerInnen:
|
||||
%br/
|
||||
%small{:style => "color:grey"} (Mehrere Benutzerinnen mit Komma trennen)
|
||||
%br/
|
||||
= text_field_with_auto_complete(:recipient, :nicks, {:value => @recipient_nicks}, {:tokens => ","})
|
||||
:javascript
|
||||
var userListLoaded = false;
|
||||
function checkUserList() {
|
||||
if (userListLoaded) {
|
||||
$('user-list').toggle();
|
||||
}
|
||||
return !userListLoaded;
|
||||
}
|
||||
= link_to_remote('Liste', :update => 'user-list', :url => {:action => 'user_list'}, :complete => 'userListLoaded = true', :condition => 'checkUserList()')
|
||||
%div{:id => 'user-list', :class => 'auto_complete'}
|
||||
%tr
|
||||
%td
|
||||
%b Gruppe:
|
||||
%br/
|
||||
%select{:name => 'recipient[group_id]'}
|
||||
%option{:value => '-1'} -- Gruppe --
|
||||
= options_from_collection_for_select(Group.find(:all, :order => 'name', :include => :memberships).reject{|g| g.memberships.empty?}, "id", "name", (@group ? @group.id : nil))
|
||||
|
||||
%p
|
||||
%label{:for => "message_subject"} Betreff
|
||||
%br/
|
||||
= text_field 'message', 'subject'
|
||||
|
||||
%p
|
||||
%label{:for => "message_body"} Nachricht
|
||||
%br/
|
||||
= preserve(text_area 'message', 'body', :cols => '80', :rows => '20')
|
||||
|
||||
= submit_tag "Senden"
|
||||
14
app/views/messages/order_finished.rhtml
Normal file
14
app/views/messages/order_finished.rhtml
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
Hallo <%= user.nick %>!
|
||||
|
||||
Die Bestellung "<%= order.name %>" wurde am <%= order.ends.strftime('%d.%m.%Y um %H:%M') %> von <%= order.updated_by.nick %> beendet.
|
||||
|
||||
Für deine Bestellgruppe <%= group.name %> wurden die folgenden Artikel bestellt:
|
||||
<% for result in results
|
||||
article = result.order_article_result -%>
|
||||
<%= article.name %>: <%= result.quantity %> x <%= article.unit %> = <%= FoodSoft::format_currency(result.quantity * article.gross_price) %>
|
||||
<% end -%>
|
||||
Gesamtpreis: <%= FoodSoft::format_currency(total) %>
|
||||
|
||||
Bestellung online einsehen: <%= ApplicationController.current.url_for(:controller => 'ordering', :action => 'my_order_result', :id => order.id) %>
|
||||
|
||||
Viele Grüße von <%= FoodSoft::getFoodcoopName %>
|
||||
28
app/views/messages/show.haml
Normal file
28
app/views/messages/show.haml
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
%h1 Nachricht anzeigen
|
||||
|
||||
%div{:style => "width:40em"}
|
||||
- if @message
|
||||
%table{:style => "width:25em"}
|
||||
%tr
|
||||
%td Von:
|
||||
%td=h @message.system_message? ? 'FoodSoft' : @message.sender.nick
|
||||
%tr
|
||||
%td An:
|
||||
%td=h @message.recipients
|
||||
%tr
|
||||
%td Betreff:
|
||||
%td
|
||||
%b=h @message.subject
|
||||
%tr
|
||||
%td Gesendet:
|
||||
%td= format_time(@message.created_on)
|
||||
%hr/
|
||||
%p= simple_format(h(@message.body))
|
||||
%hr/
|
||||
%p
|
||||
= link_to('Antworten', :action => 'reply', :id => @message) + ' | ' unless @message.system_message?
|
||||
= link_to('Löschen', {:action => 'destroy', :id => @message}, :method => "post")
|
||||
|
|
||||
= link_to 'Nachrichteneingang', :action => 'inbox'
|
||||
- else
|
||||
%p Nachricht kann nicht angezeigt werden.
|
||||
31
app/views/ordering/_bookedOrders.haml
Normal file
31
app/views/ordering/_bookedOrders.haml
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
- if controller.action_name == 'myOrders'
|
||||
= pagination_links_remote @bookedOrders, 10, {:show_all => params[:show_all]}
|
||||
%table.list
|
||||
%thead
|
||||
%tr
|
||||
%th=_ 'Name'
|
||||
%th=_ 'Supplier'
|
||||
%th=_ 'End'
|
||||
%th=_ 'Sum'
|
||||
%tbody
|
||||
- @bookedOrders.each do |order|
|
||||
- if order.is_a?(GroupOrder) || order.is_a?(GroupOrderResult)
|
||||
%tr{:class=> cycle('even', 'odd', :name => 'bookedOrders')}
|
||||
%td= link_to order.order.name, :action => 'my_order_result', :id => order.order
|
||||
%td=h order.order.supplier ? order.order.supplier.name : _("nonexistent")
|
||||
%td= format_time(order.order.ends)
|
||||
%td{:class => "currency"}= number_to_currency(order.price)
|
||||
- else
|
||||
// check if the OrderGroup has ordered
|
||||
- if groupOrder = order.group_order(@orderGroup)
|
||||
%tr{:class=> cycle('even', 'odd', :name => 'bookedOrders')}
|
||||
%td= link_to order.name, :action => 'my_order_result', :id => order
|
||||
%td=h order.supplier ? order.supplier.name : _("nonexistent")
|
||||
%td= format_time(order.ends)
|
||||
%td{:class => "currency"}= number_to_currency(groupOrder.price)
|
||||
- else
|
||||
%tr{:class=> cycle('even', 'odd', :name => 'bookedOrders'), :style => "color:grey"}
|
||||
%td= link_to truncate(order.name), {:action => "my_order_result", :id => order}, :style => "color:grey"
|
||||
%td= order.supplier ? order.supplier.name : _("nonexistent")
|
||||
%td= format_time(order.ends)
|
||||
%td{:class => "currency"} --
|
||||
34
app/views/ordering/_currentOrders.haml
Normal file
34
app/views/ordering/_currentOrders.haml
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
- if @orderGroup
|
||||
.right_column{:style => "width:70%"}
|
||||
.box_title
|
||||
%h2=_ "Running orders"
|
||||
.column_content
|
||||
- unless @currentOrders.empty?
|
||||
%table.list
|
||||
%thead
|
||||
%tr
|
||||
%th=_ "Name"
|
||||
%th=_ "Supplier"
|
||||
%th=_ "End"
|
||||
%th=_ "Who ordered?"
|
||||
%th=_ "Sum"
|
||||
%tbody
|
||||
- total = 0
|
||||
- @currentOrders.each do |order|
|
||||
%tr{:class => cycle('even', 'odd', :name => 'current_orders')}
|
||||
%td= link_to order.name, :controller => 'ordering', :action => 'order', :id => order
|
||||
%td=h order.supplier.name
|
||||
%td=h format_time(order.ends) unless order.ends.nil?
|
||||
- if (groupOrder = order.group_orders.find(:first, :conditions => ["order_group_id = ?", @orderGroup.id]))
|
||||
- total += groupOrder.price
|
||||
%td=h groupOrder.updated_by.nil? ? '??' : "#{groupOrder.updated_by.nick} (#{format_time(groupOrder.updated_on)})"
|
||||
%td= number_to_currency(groupOrder.price)
|
||||
- else
|
||||
%td
|
||||
%td
|
||||
- if total > 0
|
||||
%p
|
||||
=_ "Total sum"
|
||||
%b= number_to_currency(total)
|
||||
- else
|
||||
%i=_ "There aren't current orders at the moment."
|
||||
30
app/views/ordering/_finishedOrders.haml
Normal file
30
app/views/ordering/_finishedOrders.haml
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
%table.list
|
||||
%thead
|
||||
%tr
|
||||
%th=_ 'Name'
|
||||
%th=_ 'Supplier'
|
||||
%th=_ 'End'
|
||||
%th=_ 'Sum'
|
||||
%tbody
|
||||
- @finishedOrders.each do |order|
|
||||
- if order.is_a?(GroupOrder) or order.is_a?(GroupOrderResult)
|
||||
%tr{:class=> cycle('even', 'odd', :name => 'bookedOrders')}
|
||||
%td= link_to order.order.name, :action => 'my_order_result', :id => order.order
|
||||
%td=h order.order.supplier ? order.order.supplier.name : _("nonexistent")
|
||||
%td= format_time(order.order.ends)
|
||||
%td{:class => "currency"}= number_to_currency(order.price)
|
||||
- else
|
||||
// check if the OrderGroup has ordered
|
||||
- if groupOrder = order.group_order(@orderGroup)
|
||||
%tr{:class=> cycle('even', 'odd', :name => 'finishedOrders')}
|
||||
%td= link_to order.name, :action => 'my_order_result', :id => order
|
||||
%td=h order.supplier ? order.supplier.name : _("nonexistent")
|
||||
%td= format_time(order.ends)
|
||||
%td{:class => "currency"}= number_to_currency(groupOrder.price)
|
||||
- else
|
||||
%tr{:class=> cycle('even', 'odd', :name => 'finishedOrders'), :style => "color:grey"}
|
||||
%td= link_to truncate(order.name), {:action => "my_order_result", :id => order}, :style => "color:grey"
|
||||
%td= order.supplier ? order.supplier.name : _("nonexistent")
|
||||
%td= format_time(order.ends)
|
||||
%td{:class => "currency"} --
|
||||
|
||||
33
app/views/ordering/_finished_order_result.haml
Normal file
33
app/views/ordering/_finished_order_result.haml
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
%table.list
|
||||
%thead
|
||||
%tr
|
||||
%th{:style => "width:40%"}=_ "Name"
|
||||
%th=_ "Unit quantity"
|
||||
%th=_ "Unit price"
|
||||
%th=_ "Received"
|
||||
%th=_ "Total price"
|
||||
%tbody
|
||||
- for article in @groupOrderResult.group_order_article_results
|
||||
- price = article.order_article_result.gross_price
|
||||
- quantity = article.quantity
|
||||
%tr{:class => cycle('even', 'odd', :name => 'articles')}
|
||||
%td{:style=>"width:40%"}
|
||||
=h article.order_article_result.name
|
||||
- unless article.order_article_result.note.nil?
|
||||
= image_tag "lamp_grey.png", {:alt => "Notiz anzeigen", :size => "15x16", :border => "0", :onmouseover => "$('note_#{article.id}').show();", :onmouseout => "$('note_#{article.id}').hide();" }
|
||||
%td
|
||||
= article.order_article_result.unit_quantity
|
||||
x
|
||||
= article.order_article_result.unit
|
||||
%td= number_to_currency(price)
|
||||
%td= quantity
|
||||
%td= number_to_currency(quantity * price)
|
||||
|
||||
- unless article.order_article_result.note.nil?
|
||||
%tr{:id => "note_#{article.id}", :style => "display:none"}
|
||||
%td{:colspan => "5"}
|
||||
Notiz:
|
||||
=h article.order_article_result.note
|
||||
%tr{:class => cycle('even', 'odd', :name => 'articles')}
|
||||
%th{:colspan => "4"}=_ "Sum"
|
||||
%th= number_to_currency(@groupOrderResult.price)
|
||||
54
app/views/ordering/_unfinished_order_result.haml
Normal file
54
app/views/ordering/_unfinished_order_result.haml
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
%table.list
|
||||
%thead
|
||||
%tr
|
||||
%th{:style => "width:40%"} Name
|
||||
%th Gebinde
|
||||
%th Einzelpreis
|
||||
%th
|
||||
%abbr{:title => "Menge + Toleranz"} Bestellt
|
||||
%th
|
||||
%abbr{:title => "Unter Berücksichtigung der anderen Gruppen"} Zugeteilt
|
||||
%th Gesamtpreis
|
||||
%tbody
|
||||
- total = 0 #set counter for order-sum
|
||||
- for category, order_articles in @order.get_articles
|
||||
%tr{:style => "background-color:#EFEFEF"}
|
||||
%td{:style => "text-align:left;"}=h category
|
||||
%td{:colspan => "9"}
|
||||
- for order_article in order_articles
|
||||
- article = order_article.article
|
||||
- # get the order-results for the ordergroup
|
||||
- group_order_article = GroupOrderArticle.find_by_group_order_id_and_order_article_id @group_order.id, order_article.id
|
||||
- if group_order_article
|
||||
- quantity = group_order_article.quantity
|
||||
- tolerance = group_order_article.tolerance
|
||||
- result = group_order_article.orderResult[:quantity] + group_order_article.orderResult[:tolerance]
|
||||
- sub_total = article.gross_price * (quantity + tolerance)
|
||||
- else
|
||||
- quantity, tolerance, result, sub_total = 0, 0, 0, 0
|
||||
- total += sub_total
|
||||
- # give the article different colors, dependent on order-result
|
||||
- style = "grey"
|
||||
- if (quantity > 0)
|
||||
- style = result > 0 ? 'green' : 'red'
|
||||
%tr{:class => cycle('even', 'odd', :name => 'articles'), :style => "color:#{style}"}
|
||||
%td{:style => "width:40%"}
|
||||
=h order_article.article.name
|
||||
- unless order_article.article.note.empty?
|
||||
= image_tag("lamp_grey.png", {:alt => "Notiz anzeigen", :size => "15x16", :border => "0", :onmouseover => "$('note_#{order_article.id}').show();", :onmouseout => "$('note_#{order_article.id}').hide();"})
|
||||
%td= "#{article.unit_quantity} x #{order_article.article.unit}"
|
||||
%td= number_to_currency(article.gross_price)
|
||||
%td
|
||||
= quantity
|
||||
= "+ #{tolerance}" if article.unit_quantity > 1
|
||||
%td= result > 0 ? result : "0"
|
||||
%td= number_to_currency(sub_total)
|
||||
- unless order_article.article.note.empty?
|
||||
%tr{:id => "note_#{order_article.id}", :class => "note even", :style => "display:none"}
|
||||
%td{:colspan => "6"}=h order_article.article.note
|
||||
%tr{:class => cycle('even', 'odd', :name => 'articles')}
|
||||
%th{:colspan => "5"} Summe
|
||||
%th= number_to_currency(total)
|
||||
|
||||
|
||||
|
||||
45
app/views/ordering/index.haml
Normal file
45
app/views/ordering/index.haml
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
%h1= _('Order Overview')
|
||||
|
||||
// OrderGroups Account Balance
|
||||
.left_column{:style => "width:26%"}
|
||||
.box_title
|
||||
%h2=h @orderGroup.name
|
||||
.column_content
|
||||
%table
|
||||
%tr
|
||||
%td= _('Account balance')
|
||||
%td{:class => "currency", :style => "width:5em"}= number_to_currency(@orderGroup.account_balance)
|
||||
%tr
|
||||
%td= "- " + _('Current orders')
|
||||
%td{:class => "currency"}= number_to_currency(@currentOrdersValue)
|
||||
%tr
|
||||
%td= "- " +_('Unrecorded orders')
|
||||
%td{:class => "currency"}= number_to_currency(@nonbookedOrdersValue)
|
||||
%tr
|
||||
%th= _('Available')
|
||||
%th{:class => "currency"}= number_to_currency(@orderGroup.account_balance - @currentOrdersValue - @nonbookedOrdersValue)
|
||||
|
||||
// Current Orders
|
||||
= render :partial => "currentOrders"
|
||||
|
||||
// finished, nonbooked Orders
|
||||
- unless @finishedOrders.empty?
|
||||
.right_column{:style => "width:70%"}
|
||||
.box_title
|
||||
%h2= _('unrecorded orders')
|
||||
.column_content
|
||||
= render :partial => "finishedOrders"
|
||||
- if @nonbookedOrdersValue > 0
|
||||
%p
|
||||
= _('total order value')
|
||||
%b= number_to_currency(@nonbookedOrdersValue)
|
||||
|
||||
// bookedOrders
|
||||
- unless @bookedOrders.empty?
|
||||
.right_column{:style => "width:70%"}
|
||||
.box_title
|
||||
%h2= _('balanced orders')
|
||||
.column_content
|
||||
= render :partial => "bookedOrders"
|
||||
%br/
|
||||
= link_to _('more...'), :action => "myOrders"
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue