Files
openfoodnetwork/app/views/admin/enterprises/_new_form.html.haml
Maikel Linke 4feb7c893b Introduce contact email address for enterprises
Add a new column email_address to enterprises.
Use this new field for public display of contact details.
The old field enterprise.email is still used internally.
It is still displayed on orders and emails sent to customers.
A new enterprise has the owner's email address by default now.

Fix GH #757
2016-02-24 15:14:07 +11:00

102 lines
3.4 KiB
Plaintext

.row
.three.columns.alpha
= f.label :name
.nine.columns.omega
= f.text_field :name, { placeholder: "eg. Professor Plum's Biodynamic Truffles", class: "fullwidth" }
- if spree_current_user.admin?
.row
.three.columns.alpha
=f.label :owner_id, 'Owner'
%div{'ofn-with-tip' => "The primary user responsible for this enterprise."}
%a What's this?
.nine.columns.omega
- owner_email = @enterprise.andand.owner.andand.email || ""
= f.hidden_field :owner_id, class: "select2 fullwidth", 'user-select' => 'Enterprise.owner'
.row
.three.columns.alpha
%label Primary Producer?
%div{'ofn-with-tip' => "Select 'Producer' if you are a primary producer of food."}
%a What's this?
.five.columns.omega
= f.check_box :is_primary_producer, 'ng-model' => 'Enterprise.is_primary_producer'
 
= f.label :is_primary_producer, 'I am a Producer'
- if spree_current_user.admin?
.row
.alpha.eleven.columns
.three.columns.alpha
= f.label :sells, 'Sells'
%div{'ofn-with-tip' => "None - enterprise does not sell to customers directly.<br />Own - Enterprise sells own products to customers.<br />Any - Enterprise can sell own or other enterprises products.<br />"}
%a What's this?
.two.columns
= f.radio_button :sells, "none", 'ng-model' => 'Enterprise.sells'
&nbsp;
= f.label :sells, "None", value: "none"
.two.columns
= f.radio_button :sells, "own", 'ng-model' => 'Enterprise.sells'
&nbsp;
= f.label :sells, "Own", value: "own"
.four.columns.omega
= f.radio_button :sells, "any", 'ng-model' => 'Enterprise.sells'
&nbsp;
= f.label :sells, "Any", value: "any"
.row
.alpha.three.columns
= f.label :contact, 'Contact Name'
.omega.nine.columns
= f.text_field :contact, { placeholder: "eg. Gustav Plum"}
.row
.alpha.three.columns
= f.label :email_address
.omega.nine.columns
= f.text_field :email_address, { placeholder: "eg. gustav@truffles.com", "ng-model" => "Enterprise.email_address" }
.row
.alpha.three.columns
= f.label :phone
.omega.nine.columns
= f.text_field :phone, { placeholder: "eg. 98 7654 3210"}
.row
.alpha.three.columns
= f.label :website
.omega.nine.columns
= f.text_field :website, { placeholder: "eg. www.truffles.com"}
= f.fields_for :address do |af|
.row
.three.columns.alpha
= af.label :address1
.nine.columns.omega
= af.text_field :address1, { placeholder: "eg. 123 High Street"}
.row
.alpha.three.columns
= af.label :address2
.nine.columns.omega
= af.text_field :address2
.row
.three.columns.alpha
= af.label :city, 'Suburb'
\/
= af.label :zipcode, 'Postcode'
.four.columns
= af.text_field :city, { placeholder: "eg. Northcote"}
.five.columns.omega
= af.text_field :zipcode, { placeholder: "eg. 3070"}
.row
.three.columns.alpha
= af.label :state_id, 'State'
\/
= af.label :country_id, 'Country'
.four.columns
= af.collection_select :state_id, af.object.country.states, :id, :name, {}, :class => "select2 fullwidth"
.five.columns.omega
= af.collection_select :country_id, available_countries, :id, :name, {}, :class => "select2 fullwidth"
.row
.twelve.columns.alpha
&nbsp;
.row
.twelve.columns.alpha
= render partial: "spree/admin/shared/new_resource_links"