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,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(', ')

View 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

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

View 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

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

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

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

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

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

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

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

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

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

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