Moved User.address-info into Ordergroup.contact_... attributes. Updated model-fixtures for testing.

This commit is contained in:
Benjamin Meichsner 2009-02-02 16:35:43 +01:00
parent aa47a24fda
commit 0a2a79237a
60 changed files with 466 additions and 443 deletions

View file

@ -14,7 +14,7 @@
- for user in @users
%tr{:class => cycle('even','odd', :name => 'users')}
%td= link_to user.nick, [:admin, user]
%td= [user.first_name, user.last_name].join(", ")
%td=h user.name
%td= format_date(user.created_on)
%br/
= link_to 'Alle Benutzerinnen', admin_users_path

View file

@ -1,11 +1,18 @@
- form_for [:admin, @ordergroup] do |@form|
= render :partial => 'shared/group_form'
%div{:style => "float:left;width:55%;"}
%p
= @form.label :actual_size, "Aktuelle Gruppengröße"
%br/
= @form.text_field :actual_size, :size => 3
- render :layout => 'shared/group_form' do
%div{:style => "float:right;width:40%"}
%p
= @form.label :contact_person
%br/
= @form.text_field :contact_person, :size => 20
%p
= @form.label :contact_phone
%br/
= @form.text_field :contact_phone, :size => 20
%p
= @form.label :contact_address
%br/
= @form.text_field :contact_address
%br{ :style => "clear:both" }
= submit_tag "Speichern"

View file

@ -10,12 +10,16 @@
%thead
%tr
%th Name
%th Kontakt
%th Adresse
%th Mitglieder
%th
%tbody
- for ordergroup in @ordergroups
%tr{:class => cycle('even','odd', :name => 'groups')}
%td= link_to ordergroup.name, [:admin, ordergroup]
%td= ordergroup.contact
%td= link_to_gmaps ordergroup.contact_address
%td= ordergroup.users.size
%td
= link_to image_tag('b_users.png', :size => '16x16', :border => "0", :alt => 'Mitlglieder bearbeiten'), memberships_admin_ordergroup_path(ordergroup)

View file

@ -9,30 +9,23 @@
%table.list
%thead
%tr
%th= _('Username')
%th= _('First name')
%th= _('Last name')
%th= _('Email')
%th= _('Roles')
%th= _('Last Login')
%th Login
%th Name
%th Email
%th Zugriff auf
%th Letzter 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, [:admin, user]
%td=h user.first_name
%td=h user.last_name
%td=h user.name
%td=h user.email
%td=h roles.join(', ')
%td=h format_roles(user)
%td=h format_time(user.last_login)
%td
= link_to(image_tag('b_edit.png', :size => "16x16", :border => "0", :alt => 'Benutzer_in bearbeiten', :title => 'Benutzer_in bearbeiten'), edit_admin_user_path(user))
= link_to(image_tag('b_drop.png', :size => "16x16", :border => "0", :alt => 'Benutzer_in löschen', :title => 'Benutzer_in löschen'), |
[:admin, user], |
:confirm => 'Willst du ' + user.first_name + ' wirklich löschen?', :method => :delete) |
:confirm => 'Willst du ' + user.name + ' wirklich löschen?', :method => :delete) |

View file

@ -10,10 +10,9 @@
<div style="float:left;margin:5px; margin-right:10px;" class="box">
<p><b>Person</b></p>
<p><b>Nick:</b> <%=h @user.nick %></p>
<p><b>Name:</b> <%=h @user.first_name + ' ' + @user.last_name %></p>
<p><b>Name:</b> <%=h @user.name %></p>
<p><b>Email:</b> <%=h @user.email %></p>
<p><b>Telefon:</b> <%=h @user.phone %></p>
<p><b>Adresse:</b> <%=h @user.address %></p>
</div>
<div style="float:left; margin:5px;" class="box">
<p>
@ -32,14 +31,8 @@
<p>
<b>Benutzer_in hat Zugriff auf:</b>
</p>
<% 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? %>
<p>
<%=h roles.join(', ') %>
<%=h format_roles(@user) %>
</p>
</div>
<p style="clear:both">

View file

@ -11,14 +11,16 @@
%tr
%th Name
%th Mitglieder
%th Zugriff auf
%th
%tbody
- for workgroup in @workgroups
%tr{:class => cycle('even','odd', :name => 'groups')}
%td= link_to workgroup.name, [:admin, workgroup]
%td= workgroup.users.size
%td= format_roles(workgroup)
%td
= link_to image_tag('b_users.png', :size => '16x16', :border => "0", :alt => 'Mitlglieder bearbeiten'), memberships_admin_workgroup_path(workgroup)
= link_to(image_tag('b_edit.png', :size => "16x16", :border => "0", :alt => 'Gruppe bearbeiten'), edit_admin_workgroup_path(workgroup))
= link_to(image_tag('b_drop.png', :size => "16x16", :border => "0", :alt => 'Gruppe löschen'), [:admin, workgroup], |
:confirm => 'Willst du ' + workgroup.name + ' wirklich löschen?', :method => :delete) |
:confirm => 'Willst du ' + workgroup.name + ' wirklich löschen?', :method => :delete) |

View file

@ -13,14 +13,14 @@
%thead
%tr
%th= sort_link_helper _("Name"), "name", @per_page
%th= sort_link_helper _("Size of group"), "size", @per_page
%th Kontakt
%th= sort_link_helper _("Account balance"), "account_balance", @per_page
%th
%tbody
- for group in @groups
%tr{:class => cycle('even','odd', :name => 'groups')}
%td= group.name
%td= group.actual_size
%td= group.contact
%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 => 'new', :id => group}, {:title => _("New transaction")}

View file

@ -23,4 +23,4 @@
= render :partial => "ordergroups"
%br/
- if @current_user.role_admin?
= link_to _("New ordergroup"), :controller => 'admin', :action => 'newOrdergroup'
= link_to "Neue Bestellgruppe anlegen", new_admin_ordergroup_path

View file

@ -11,8 +11,7 @@
%thead
%tr
%th Nick
%th Vorname
%th Nachname
%th Name
%th Email
%th Telefon
%th Bestellgruppe
@ -20,14 +19,10 @@
%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.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(', ')
%td=h user.ordergroup_name
%td=h groups.select { |group| !group.is_a?(Ordergroup) }.collect(&:name).join(', ')

View file

@ -5,7 +5,6 @@
<p><b>Beschreibung:</b> <%=h @ordergroup.description %>
<%= link_to '(ändern)', :controller => 'foodcoop', :action => 'edit_group', :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;">

View file

@ -31,10 +31,6 @@
Telefon
%br/
= form.text_field :phone
%p
Adresse
%br/
= form.text_field :address
%p
Passwort
%br/

View file

@ -2,16 +2,16 @@
%tr
%td Beschreibung:
%td=h group.description
- if @current_user.role_admin? or @current_user.role_finance?
%tr
%td Kontakt:
%td=h group.contact
%tr
%td Adresse:
%td= link_to_gmaps group.contact_address
%tr
%td Gruppe hat Zugriff auf:
%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?
= roles.join(', ')
%td= format_roles(group)
%tr
%td Mitglieder:
%td

View file

@ -21,10 +21,6 @@
<td><%= @form.label :phone %></td>
<td><%= @form.text_field :phone %></td>
</tr>
<tr>
<td><%= @form.label :address %></td>
<td><%= @form.text_field :address %></td>
</tr>
<tr>
<td/>
</tr>