Skip to content

Commit

Permalink
Unify new user form between person and user views.
Browse files Browse the repository at this point in the history
  • Loading branch information
huerlisi committed Dec 17, 2010
1 parent a1c83c9 commit 8fb84e3
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 29 deletions.
22 changes: 2 additions & 20 deletions app/views/people/_tab_create_user.html.haml
Original file line number Diff line number Diff line change
@@ -1,22 +1,4 @@
%h1
Create user
- @user = resource.user
= semantic_form_for @user do |f|
= f.semantic_errors
= f.inputs do
= f.input :email
= f.input :password, :hint => !f.object.new_record?, :input_html => {:autocomplete => "off"}
= f.input :password_confirmation
-# f.input :current_password, :required => true unless can?(:manage, User)
= f.input :role_texts, :as => :select, :collection => Ability.roles_for_collection, :include_blank => false, :input_html => {:multiple => 'multiple'}, :required => true if can?(:manage, Role)

- f.object.build_person unless f.object.person
= f.semantic_fields_for :person do |p|
= p.inputs t_attr(:address, Person) do
= render 'vcards/form', :f => p

= f.inputs t('learnyt.tags') do
= f.input :tag_list

= f.buttons do
= f.commit_button
- @user = resource.build_user
= render 'users/form'
1 change: 0 additions & 1 deletion app/views/people/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@
{:name => 'user', :partial => 'people/tab_user', :if => lambda { resource.user } }, |
{:name => 'create_user', :partial => 'people/tab_create_user', :unless => lambda { resource.user } } |
] |

8 changes: 0 additions & 8 deletions app/views/users/_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,5 @@
-# f.input :current_password, :required => true unless can?(:manage, User)
= f.input :role_texts, :as => :select, :collection => Ability.roles_for_collection, :include_blank => false, :input_html => {:multiple => 'multiple'}, :required => true if can?(:manage, Role)

- f.object.build_person unless f.object.person
= f.semantic_fields_for :person do |p|
= p.inputs t_attr(:address, Person) do
= render 'vcards/form', :f => p

= f.inputs t('learnyt.tags') do
= f.input :tag_list

= f.buttons do
= f.commit_button

0 comments on commit 8fb84e3

Please sign in to comment.