Skip to content

Commit

Permalink
Made new/edit person both user _form.erb. Updated all views to handle…
Browse files Browse the repository at this point in the history
… approved_membership properly.
  • Loading branch information
ronnqvist committed Feb 12, 2009
1 parent 1cbfc5c commit 4e9b7cd
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 20 deletions.
7 changes: 7 additions & 0 deletions app/views/people/_form.erb
Expand Up @@ -7,6 +7,13 @@
<dt><%= t('people.nickname')%></dt>
<dd><%= form.text_field :nickname %></dd>
<%= render :partial => 'fields', :locals => { :f => form } %>
<dt><%= t('people.approved_membership')%></dt>
<dd><%= form.date_select :approved_membership,
:order => [:day,:month,:year],
:include_blank => true,
:start_year => Time.now.year,
:end_year => 1995
%></dd>
<dt><%= t('comments')%></dt>
<dd><%= form.text_area :comments %></dd>
</dl>
21 changes: 1 addition & 20 deletions app/views/people/edit.html.erb
Expand Up @@ -6,25 +6,6 @@
<%= error_messages_for :person %>
<% form_for :person, :url => person_path(@person), :html => { :method => 'put' } do |f| %>
<%= f.hidden_field :verified, :value => true %>
<%# Make common partial for new and edit %>
<dl>
<dt><%= t('people.firstname')%></dt>
<dd><%= f.text_field :firstname %></dd>
<dt><%= t('people.lastname')%></dt>
<dd><%= f.text_field :lastname %></dd>
<dt><%= t('people.nickname')%></dt>
<dd><%= f.text_field :nickname %></dd>
<%= render :partial => 'fields', :locals => { :f => f } %>
<dt><%= t('people.approved_membership')%></dt>
<dd><%= f.date_select :approved_membership,
:order => [:day,:month,:year],
:include_blank => true,
:start_year => Time.now.year,
:end_year => 1995
%></dd>
<dt><%= t('comments')%></dt>
<dd><%= f.text_area :comments %></dd>
</dl>
<%= render :partial => 'form', :locals => { :form => f } %>
<%= f.submit t('save') %>
<% end %>
5 changes: 5 additions & 0 deletions app/views/people/show.html.erb
Expand Up @@ -49,6 +49,11 @@
<% end %>
<% end %>
<% unless @person.approved_membership.to_s == '' %>
<dt><%= t('people.approved_membership') %></dt>
<dd><%= @person.approved_membership %></dd>
<% end %>
<% unless @person.comments.empty? %>
<dt><%= t('comments') %></dt>
<dd><%= @person.comments %></dd>
Expand Down

0 comments on commit 4e9b7cd

Please sign in to comment.