mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Split inputs into separate partials for each fieldset
This commit is contained in:
@@ -7,5 +7,9 @@
|
||||
= render 'admin/shared/side_menu'
|
||||
.one.column
|
||||
.eleven.columns.omega.fullwidth_inputs
|
||||
= render 'inputs', f: f
|
||||
= render 'form_primary_details', f: f
|
||||
= render 'form_about', f: f
|
||||
= render 'form_images', f: f
|
||||
= render 'form_address', f: f
|
||||
= render 'form_web', f: f
|
||||
= render "spree/admin/shared/#{action}_resource_links"
|
||||
|
||||
6
app/views/admin/enterprise_groups/_form_about.html.haml
Normal file
6
app/views/admin/enterprise_groups/_form_about.html.haml
Normal file
@@ -0,0 +1,6 @@
|
||||
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='About'" } }
|
||||
%legend About
|
||||
= f.field_container :long_description do
|
||||
= f.label :long_description
|
||||
%br/
|
||||
= f.text_area :long_description
|
||||
36
app/views/admin/enterprise_groups/_form_address.html.haml
Normal file
36
app/views/admin/enterprise_groups/_form_address.html.haml
Normal file
@@ -0,0 +1,36 @@
|
||||
= f.fields_for :address do |af|
|
||||
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='Contact'" } }
|
||||
%legend Contact
|
||||
.row
|
||||
.alpha.three.columns
|
||||
= af.label :phone
|
||||
.omega.eight.columns
|
||||
= af.text_field :phone, { placeholder: "eg. 98 7654 3210"}
|
||||
.row
|
||||
.three.columns.alpha
|
||||
= af.label :address1
|
||||
.eight.columns.omega
|
||||
= af.text_field :address1, { placeholder: "eg. 123 High Street"}
|
||||
.row
|
||||
.alpha.three.columns
|
||||
= af.label :address2
|
||||
.eight.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"}
|
||||
.four.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"
|
||||
.four.columns.omega
|
||||
= af.collection_select :country_id, available_countries, :id, :name, {}, :class => "select2 fullwidth"
|
||||
18
app/views/admin/enterprise_groups/_form_images.html.haml
Normal file
18
app/views/admin/enterprise_groups/_form_images.html.haml
Normal file
@@ -0,0 +1,18 @@
|
||||
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='Images'" } }
|
||||
%legend Images
|
||||
.row
|
||||
.alpha.three.columns
|
||||
= f.label :logo, class: 'with-tip', 'data-powertip' => 'This is the logo'
|
||||
.with-tip{'data-powertip' => 'This is the logo'}
|
||||
%a What's this?
|
||||
.omega.eight.columns
|
||||
= image_tag @object.logo.url if @object.logo.present?
|
||||
= f.file_field :logo
|
||||
.row
|
||||
.alpha.three.columns
|
||||
= f.label :promo_image, class: 'with-tip', 'data-powertip' => 'This image is displayed at the top of the Group profile'
|
||||
.with-tip{'data-powertip' => 'This image is displayed at the top of the Group profile'}
|
||||
%a What's this?
|
||||
.omega.eight.columns
|
||||
= image_tag @object.promo_image.url if @object.promo_image.present?
|
||||
= f.file_field :promo_image
|
||||
@@ -0,0 +1,30 @@
|
||||
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='Primary Details'" } }
|
||||
%legend Primary Details
|
||||
= f.field_container :name do
|
||||
= f.label :name
|
||||
%br/
|
||||
= f.text_field :name
|
||||
|
||||
= f.field_container :description do
|
||||
= f.label :description
|
||||
%br/
|
||||
= f.text_field :description
|
||||
|
||||
- if spree_current_user.admin?
|
||||
.row
|
||||
.three.columns.alpha
|
||||
=f.label :owner_id, 'Owner'
|
||||
.with-tip{'data-powertip' => "The primary user responsible for this group."}
|
||||
%a What's this?
|
||||
.eight.columns.omega
|
||||
= f.hidden_field :owner_id, class: "select2 fullwidth", 'ofn-user-autocomplete' => true, email: @owner_email
|
||||
|
||||
= f.field_container :on_front_page do
|
||||
= f.label :on_front_page, 'On front page?'
|
||||
%br/
|
||||
= f.check_box :on_front_page
|
||||
|
||||
= f.field_container :enterprise_ids do
|
||||
= f.label :enterprise_ids, 'Enterprises'
|
||||
%br/
|
||||
= f.collection_select :enterprise_ids, @enterprises, :id, :name, {}, {class: "select2 fullwidth", multiple: true}
|
||||
32
app/views/admin/enterprise_groups/_form_web.html.haml
Normal file
32
app/views/admin/enterprise_groups/_form_web.html.haml
Normal file
@@ -0,0 +1,32 @@
|
||||
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='Web'" } }
|
||||
%legend Web Resources
|
||||
.row
|
||||
.alpha.three.columns
|
||||
= f.label :website
|
||||
.omega.eight.columns
|
||||
= f.text_field :website, { placeholder: "eg. www.truffles.com"}
|
||||
.row
|
||||
.alpha.three.columns
|
||||
= f.label :email
|
||||
.omega.eight.columns
|
||||
= f.text_field :email
|
||||
.row
|
||||
.alpha.three.columns
|
||||
= f.label :facebook, 'Facebook'
|
||||
.omega.eight.columns
|
||||
= f.text_field :facebook
|
||||
.row
|
||||
.alpha.three.columns
|
||||
= f.label :instagram, 'Instagram'
|
||||
.omega.eight.columns
|
||||
= f.text_field :instagram
|
||||
.row
|
||||
.alpha.three.columns
|
||||
= f.label :linkedin, 'LinkedIn'
|
||||
.omega.eight.columns
|
||||
= f.text_field :linkedin
|
||||
.row
|
||||
.alpha.three.columns
|
||||
= f.label :twitter
|
||||
.omega.eight.columns
|
||||
= f.text_field :twitter, { placeholder: "eg. @the_prof" }
|
||||
@@ -1,127 +0,0 @@
|
||||
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='Primary Details'" } }
|
||||
%legend Primary Details
|
||||
= f.field_container :name do
|
||||
= f.label :name
|
||||
%br/
|
||||
= f.text_field :name
|
||||
|
||||
= f.field_container :description do
|
||||
= f.label :description
|
||||
%br/
|
||||
= f.text_field :description
|
||||
|
||||
- if spree_current_user.admin?
|
||||
.row
|
||||
.three.columns.alpha
|
||||
=f.label :owner_id, 'Owner'
|
||||
.with-tip{'data-powertip' => "The primary user responsible for this group."}
|
||||
%a What's this?
|
||||
.eight.columns.omega
|
||||
= f.hidden_field :owner_id, class: "select2 fullwidth", 'ofn-user-autocomplete' => true, email: @owner_email
|
||||
|
||||
= f.field_container :on_front_page do
|
||||
= f.label :on_front_page, 'On front page?'
|
||||
%br/
|
||||
= f.check_box :on_front_page
|
||||
|
||||
= f.field_container :enterprise_ids do
|
||||
= f.label :enterprise_ids, 'Enterprises'
|
||||
%br/
|
||||
= f.collection_select :enterprise_ids, @enterprises, :id, :name, {}, {class: "select2 fullwidth", multiple: true}
|
||||
|
||||
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='About'" } }
|
||||
%legend About
|
||||
= f.field_container :long_description do
|
||||
= f.label :long_description
|
||||
%br/
|
||||
= f.text_area :long_description
|
||||
|
||||
|
||||
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='Images'" } }
|
||||
%legend Images
|
||||
.row
|
||||
.alpha.three.columns
|
||||
= f.label :logo, class: 'with-tip', 'data-powertip' => 'This is the logo'
|
||||
.with-tip{'data-powertip' => 'This is the logo'}
|
||||
%a What's this?
|
||||
.omega.eight.columns
|
||||
= image_tag @object.logo.url if @object.logo.present?
|
||||
= f.file_field :logo
|
||||
.row
|
||||
.alpha.three.columns
|
||||
= f.label :promo_image, class: 'with-tip', 'data-powertip' => 'This image is displayed at the top of the Group profile'
|
||||
.with-tip{'data-powertip' => 'This image is displayed at the top of the Group profile'}
|
||||
%a What's this?
|
||||
.omega.eight.columns
|
||||
= image_tag @object.promo_image.url if @object.promo_image.present?
|
||||
= f.file_field :promo_image
|
||||
|
||||
= f.fields_for :address do |af|
|
||||
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='Contact'" } }
|
||||
%legend Contact
|
||||
.row
|
||||
.alpha.three.columns
|
||||
= af.label :phone
|
||||
.omega.eight.columns
|
||||
= af.text_field :phone, { placeholder: "eg. 98 7654 3210"}
|
||||
.row
|
||||
.three.columns.alpha
|
||||
= af.label :address1
|
||||
.eight.columns.omega
|
||||
= af.text_field :address1, { placeholder: "eg. 123 High Street"}
|
||||
.row
|
||||
.alpha.three.columns
|
||||
= af.label :address2
|
||||
.eight.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"}
|
||||
.four.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"
|
||||
.four.columns.omega
|
||||
= af.collection_select :country_id, available_countries, :id, :name, {}, :class => "select2 fullwidth"
|
||||
|
||||
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='Web'" } }
|
||||
%legend Web Resources
|
||||
.row
|
||||
.alpha.three.columns
|
||||
= f.label :website
|
||||
.omega.eight.columns
|
||||
= f.text_field :website, { placeholder: "eg. www.truffles.com"}
|
||||
.row
|
||||
.alpha.three.columns
|
||||
= f.label :email
|
||||
.omega.eight.columns
|
||||
= f.text_field :email
|
||||
.row
|
||||
.alpha.three.columns
|
||||
= f.label :facebook, 'Facebook'
|
||||
.omega.eight.columns
|
||||
= f.text_field :facebook
|
||||
.row
|
||||
.alpha.three.columns
|
||||
= f.label :instagram, 'Instagram'
|
||||
.omega.eight.columns
|
||||
= f.text_field :instagram
|
||||
.row
|
||||
.alpha.three.columns
|
||||
= f.label :linkedin, 'LinkedIn'
|
||||
.omega.eight.columns
|
||||
= f.text_field :linkedin
|
||||
.row
|
||||
.alpha.three.columns
|
||||
= f.label :twitter
|
||||
.omega.eight.columns
|
||||
= f.text_field :twitter, { placeholder: "eg. @the_prof" }
|
||||
Reference in New Issue
Block a user