Initial commit of foodsoft 2

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

View file

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

View 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)

View file

@ -0,0 +1,5 @@
%h1 Nachrichten - Eingang
%p= link_to('Neue Nachricht', :action => 'new')
= render :partial => 'list'

View 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 %>

View 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"

View 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 %>

View 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.