Moved form helpers from application_helper to a real FormHelper
This commit is contained in:
@@ -1,41 +1,20 @@
|
||||
= form_for @organization do |f|
|
||||
.columns
|
||||
- if @organization.errors.any?
|
||||
#error_explanation
|
||||
%h2= "#{pluralize(@organization.errors.count, "error")} prohibited this organization from being saved:"
|
||||
%ul
|
||||
- @organization.errors.full_messages.each do |msg|
|
||||
%li= msg
|
||||
= field f, :name, :text_field
|
||||
= field f, :slug, :text_field
|
||||
= f.text_field :name
|
||||
= f.text_field :slug
|
||||
|
||||
.columns.medium-4.small-text-centered
|
||||
-#%h2=_'organization.create.intro-title', :t
|
||||
-#%p=_'organization.create.intro', :p
|
||||
=# field f, :avatar, :image_field
|
||||
= field f, :avatar, :image_field, @organization.avatar_url
|
||||
-#= field f, :year_founded, :number_field
|
||||
=# f.label :avatar do
|
||||
=# %div
|
||||
=# = image_tag(@organization.avatar_url || ''
|
||||
=# = f.hidden_field :avatar_cache
|
||||
= f.image_field :avatar, @organization.avatar_url
|
||||
.columns.medium-8
|
||||
= field f, :email_address, :email_field
|
||||
= f.email_field :email_address
|
||||
= f.fields_for :locations do |b|
|
||||
= field_set_tag 'Location' do
|
||||
= field b, :country, :country_select, {help: 'Select a Country'}
|
||||
= b.country_select :country, {help: 'Select a Country'}
|
||||
- cc = @organization.locations && @organization.locations[b.index].country ? @organization.locations[b.index].country : 'US'
|
||||
= field b, :territory, :subregion_select, cc, html: {class: @organization.locations[b.index].country ? 'can' : 'cant', data: {:country => cc}}
|
||||
= field b, :city, :text_field
|
||||
= field b, :street, :text_field
|
||||
= field b, :postal_code, :text_field
|
||||
-#= field f, :logo, :text_field
|
||||
-#= field f, :avatar, :text_field
|
||||
-#= field f, :requires_approval, :check_box
|
||||
-#= field f, :secret_question, :text_field
|
||||
-#= field f, :secret_answer, :text_field
|
||||
-#= field f, :location_id, :number_field
|
||||
-#= field f, :user_organization_replationship_id, :number_field
|
||||
= b.subregion_select :territory, cc, html: {class: @organization.locations[b.index].country ? 'can' : 'cant', data: {:country => cc}}
|
||||
= b.text_field :city
|
||||
= b.text_field :street
|
||||
= b.text_field :postal_code
|
||||
.columns
|
||||
= field f, :info, :text_area
|
||||
= actions :save
|
||||
= f.text_area :info
|
||||
= f.actions :save
|
||||
|
||||
@@ -8,6 +8,6 @@
|
||||
%h2=_'organization.members.help.title', :t
|
||||
%p=_'organization.members.help', :p
|
||||
.columns.medium-8
|
||||
= field f, :cover, :image_field, @organization.cover_url
|
||||
= field f, :year_founded, :number_field
|
||||
= actions :save
|
||||
= f.image_field :cover, @organization.cover_url
|
||||
= f.number_field :year_founded
|
||||
= f.actions :save
|
||||
|
||||
@@ -10,5 +10,6 @@
|
||||
.columns.medium-8
|
||||
.clearfix
|
||||
= f.fields_for :user_organization_relationships, :include_id => true do |u|
|
||||
= field u, :id, :user_select_field, @organization.users[u.index], attrs: [@organization.user_organization_relationships[u.index]]
|
||||
= actions :save
|
||||
= u.user_select_field :id, @organization.users[u.index], {:relationship => @organization.user_organization_relationships[u.index].relationship || true}
|
||||
-#attrs: [@organization.user_organization_relationships[u.index]]
|
||||
= f.actions :save
|
||||
|
||||
Reference in New Issue
Block a user