Skip to content
Browse files

Unify new user form between person and user views.

  • Loading branch information...
1 parent a1c83c9 commit 8fb84e3a2677eee40a21ce62b099556b2859b650 @huerlisi committed Dec 17, 2010
Showing with 2 additions and 29 deletions.
  1. +2 −20 app/views/people/_tab_create_user.html.haml
  2. +0 −1 app/views/people/show.html.haml
  3. +0 −8 app/views/users/_form.html.haml
View
22 app/views/people/_tab_create_user.html.haml
@@ -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'
View
1 app/views/people/show.html.haml
@@ -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 } } |
] |
-
View
8 app/views/users/_form.html.haml
@@ -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.
Something went wrong with that request. Please try again.