Files
openfoodnetwork/app/views/admin/enterprises/_form.html.haml
2014-03-20 15:18:21 +11:00

159 lines
5.5 KiB
Plaintext

- content_for :head do
= render 'shared/cms_elrte_head'
- content_for :page_title do
New Enterprise
- content_for :page_actions do
%li= button_link_to "Back to enterprises list", main_app.admin_enterprises_path, icon: 'icon-arrow-left'
.fullwidth_inputs
.row
.alpha.six.columns
.two.columns.alpha
= f.label :name
.four.columns.omega
= f.text_field :name
.omega.six.columns
.two.columns.alpha
= f.label :group_ids, 'Groups'
.with-tip{'data-powertip' => "Select any groups or regions that you are a member of. This will help customers find your enterprise."}
%a What's this?
.four.columns.omega
= f.collection_select :group_ids, EnterpriseGroup.all, :id, :name, {}, {class: "select2 fullwidth", multiple: true}
.row
.alpha.two.columns  
.omega.ten.columns
= f.check_box :is_primary_producer
= f.label :is_primary_producer, 'Producer'
 
= f.check_box :is_distributor
= f.label :is_distributor, 'Hub'
.with-tip{'data-powertip' => "Select 'Producer' if you are a primary producer of food. Select 'Hub' if you want a shop-front. You can choose either or both."}
%a What's this?
= f.fields_for :address do |af|
%fieldset.no-border-bottom
%legend Address
.row
.alpha.six.columns
.alpha.two.columns
= af.label :address1
.omega.four.columns
= af.text_field :address1
.omega.six.columns
.alpha.two.columns
= af.label :address2
.omega.four.columns
= af.text_field :address2
.row
.six.columns.alpha
.alpha.two.columns
= af.label :city, 'Suburb'
.omega.four.columns
= af.text_field :city
.six.columns.omega
.alpha.two.columns
= af.label :zipcode, 'Postcode'
.omega.four.columns
= af.text_field :zipcode
.row
.alpha.two.columns  
.omega.three.columns
= af.collection_select(:state_id, af.object.country.states, :id, :name)
.row
.alpha.two.columns  
.omega.three.columns
= af.collection_select(:country_id, available_countries, :id, :name)
.row
.alpha.six.columns
%fieldset.no-border-bottom
%legend Contact Details
.row
.alpha.two.columns
= f.label :contact, 'Name'
.omega.four.columns
= f.text_field :contact
.row
.alpha.two.columns
= f.label :email
.omega.four.columns
= f.text_field :email
.row
.alpha.two.columns
= f.label :phone
.omega.four.columns
= f.text_field :phone
.omega.six.columns
%fieldset.no-border-bottom
%legend Enterprise Details
.row
.alpha.two.columns
= f.label :abn, 'ABN'
.omega.four.columns
= f.text_field :abn
.row
.alpha.two.columns
= f.label :acn, 'ACN'
.omega.four.columns
= f.text_field :acn
.row
.alpha.two.columns
= f.label :website
.omega.four.columns
= f.text_field :website
-# TODO: Facebook model field
-#.row
-# .alpha.two.columns
-# = f.label :facebook, 'Facebook'
-# .omega.four.columns
-# = f.text_field :facebook
.row
.alpha.two.columns
= f.label :twitter
.omega.four.columns
= f.text_field :twitter
%fieldset.no-border-bottom
%legend About Us
.row
.alpha.two.columns
= f.label :description, 'Short Description'
.omega.ten.columns
= f.text_field :description, placeholder: 'Tell us about your enterprise in one or two sentences'
.row
.alpha.two.columns
= f.label :long_description, 'About Us'
%br
Tell us about yourself. This information appears on your public profile (under "About Us")
.omega.eight.columns
= f.text_area :long_description, class: 'rich_text', placeholder: 'Tell us about yourself. This information appears on your public profile (under "About Us")'
.row
.alpha.two.columns
= f.label :distributor_info, 'How does your hub work?'
%br
%em (Hub only)
%br
Explain your distribution offer/s - this information appears on your public profile (under "How does it work?")
.omega.eight.columns
= f.text_area :distributor_info, class: 'rich_text', placeholder: 'Hub only: Explain your distribution offer/s - this is more detailed information that the user can access by clicking on "How does it work?"'
/ TODO: editor breaks scrolling with arrow keys
.row
.alpha.two.columns
= f.label :logo
%br
100 x 100 pixels
.omega.four.columns
= image_tag @object.logo.url if @object.logo.present?
= f.file_field :logo
.omega.two.columns
= f.label :promo_image, class: 'with-tip', 'data-powertip' => 'This image is displayed in "About Us"'
.with-tip{'data-powertip' => 'This image is displayed on the right hand side of the "About Us" section of your public profile.'}
%a What's this?
.omega.four.columns
= image_tag @object.promo_image.url if @object.promo_image.present?
= f.file_field :pro_image