Skip to content

Commit

Permalink
Unfinished people administration commited for starting pair programming.
Browse files Browse the repository at this point in the history
  • Loading branch information
raskhadafi committed Dec 17, 2010
1 parent 9ea37d1 commit 735a2e1
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 25 deletions.
8 changes: 3 additions & 5 deletions app/helpers/application_helper.rb
@@ -1,18 +1,16 @@
module ApplicationHelper
# Tabs
def ui_tab_link(name, options = {})
only = options.delete(:only)
return if only and !only.call
return if options[:if] and not options[:if].call

content_tag 'li' do
link_to t(name, :scope => 'tabs'), "#tab-#{name}"
end
end

def ui_tab_content(name, options = {})
only = options.delete(:only)
return if only and !only.call

return if options[:if] and !options[:if].call

partial = options.delete(:partial)
partial ||= "tab_#{name}"

Expand Down
7 changes: 0 additions & 7 deletions app/views/parents/_show.html.haml

This file was deleted.

7 changes: 0 additions & 7 deletions app/views/people/_show.html.haml

This file was deleted.

22 changes: 22 additions & 0 deletions app/views/people/_tab_create_user.html.haml
@@ -0,0 +1,22 @@
%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
File renamed without changes.
8 changes: 7 additions & 1 deletion app/views/people/show.html.haml
Expand Up @@ -3,4 +3,10 @@
%h1= resource

%div[resource]
= render 'show'
= ui_tabs [ |
{:name => 'address', :partial => 'people/tab_address' }, |
{:name => 'remarks', :partial => 'people/tab_remarks' }, |
{:name => 'user', :partial => 'people/tab_user', :if => lambda { resource.user } }, |
{:name => 'create_user', :partial => 'people/tab_create_user', :unless => lambda { resource.user } } |
] |

5 changes: 0 additions & 5 deletions app/views/students/_show.html.haml

This file was deleted.

0 comments on commit 735a2e1

Please sign in to comment.