Replaced IndexController by Home- and FoodcoopController. Some reorganizing in groups/memberships-logic (moved memberships out of admin-namespace).

This commit is contained in:
Benjamin Meichsner 2009-01-15 12:14:01 +01:00
parent fadc951208
commit 6ce6c2c75a
70 changed files with 553 additions and 934 deletions

View file

@ -0,0 +1,33 @@
- unless params[:sort_by_ordergroups]
%p
%table{:style => "width:100%"}
%tr
%td
= pagination_links_remote @users, :update => :users
%td{:style => "text-align:right"}
- if @total > 20
= items_per_page :update => :users
%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,12 @@
.single_column{:style => "width:50em"}
.box_title
%h2= @group.name
.column_content
= render :partial => 'shared/group', :locals => { :group => @group }
%p
= link_to _("Show all tasks"), :controller => "tasks", :action => "workgroup", :id => @group
|
- if @group.member?(@current_user)
= link_to _("Edit group"), :action => "edit_group", :id => @group
|
= link_to _('Send members a message'), :controller => 'messages', :action => 'group', :id => @group

View file

@ -0,0 +1,15 @@
- title "Gruppe bearbeiten"
%p
%i
Mitglieder kannst du
= link_to "hier", :action => "memberships", :id => @group
hinzufügen.
.edit_form{:style => "width:35em"}
- form_for(@group, :url => {:action => 'update_group', :id => @group}) do |@form|
= render :partial => "shared/group_form"
%p{:style => "clear:both"}
= submit_tag 'Speichern'
|
= link_to "Abbrechen", :action => "workgroups"

View file

@ -0,0 +1,14 @@
- title "Neues Foodcoop-Mitglied einladen"
%p
Hier kannst du eine Person in die Gruppe
%b=h @group.name
einladen, die noch nicht Mitglied der Foodcoop ist.
.edit_form{:style => 'width:35em'}
- form_for(@invite, :url => {:action => 'send_invitation', :id => @group}) do |form|
= form.error_messages
%p
Email-Adresse:
= form.text_field('email', :size => 40, :maxlength => 128)
%p
= submit_tag('Einladung abschicken')

View file

@ -0,0 +1,31 @@
%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", my_profile_path
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'}, |
:update => :users, |
:with => 'query' |
=_ "Sort by Ordergroups :"
- form_tag({:action => "members"}, :method => "get", :style=>"display:inline;") do
= check_box_tag :sort_by_ordergroups, 1, params[:sort_by_ordergroups], :onclick => "submit();"
#users
= render :partial => "users"

View file

@ -0,0 +1 @@
<%= render :partial => 'shared/memberships/members' %>

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 => "workgroup"