mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-31 21:37:16 +00:00
Merge pull request #9936 from dacook/minor-admin-updates
Code cleanup: admin interface
This commit is contained in:
@@ -5,12 +5,6 @@
|
||||
%legend= t(".#{ item[:name] }.legend")
|
||||
= render "admin/enterprises/form/#{ item[:form_name] || item[:name] }", f: f
|
||||
|
||||
- when 'address'
|
||||
= f.fields_for :address do |af|
|
||||
%fieldset.alpha.no-border-bottom{ id: "#{item[:name]}_panel", data: { "tabs-and-panels-target": "panel" }}
|
||||
%legend= t(".#{ item[:name] }.legend")
|
||||
= render 'admin/enterprises/form/address', af: af
|
||||
|
||||
- when 'enterprise_permissions'
|
||||
%fieldset.alpha.no-border-bottom{ id: "#{item[:name]}_panel", data: { "tabs-and-panels-target": "panel" }}
|
||||
%legend= t(".#{ item[:name] }.legend")
|
||||
|
||||
@@ -1,54 +1,55 @@
|
||||
-# redo denoting required fields in the whole project
|
||||
.row
|
||||
= t(:required_fields)
|
||||
(
|
||||
%span.required *
|
||||
)
|
||||
.row
|
||||
.three.columns.alpha
|
||||
= af.label :address1, t(:address)
|
||||
= f.fields_for :address do |af|
|
||||
.row
|
||||
= t(:required_fields)
|
||||
(
|
||||
%span.required *
|
||||
.eight.columns.omega
|
||||
= af.text_field :address1, { placeholder: t(:address_placeholder) }
|
||||
.row
|
||||
.alpha.three.columns
|
||||
= af.label :address2, t(:address2)
|
||||
.eight.columns.omega
|
||||
= af.text_field :address2
|
||||
.row
|
||||
.three.columns.alpha
|
||||
= af.label :city, t(:city)
|
||||
\/
|
||||
= af.label :zipcode, t(:postcode)
|
||||
%span.required *
|
||||
.four.columns
|
||||
= af.text_field :city, { placeholder: t(:city_placeholder) }
|
||||
.four.columns.omega
|
||||
= af.text_field :zipcode, { placeholder: t(:postcode_placeholder) }
|
||||
.row{"data-controller": "dependent-select", "data-dependent-select-options-value": countries_with_states }
|
||||
.three.columns.alpha
|
||||
= af.label :state_id, t(:state)
|
||||
\/
|
||||
= af.label :country_id, t(:country)
|
||||
%span.required *
|
||||
.four.columns
|
||||
= af.select :state_id, @enterprise.address.country.states.map { |s| [s.name, s.id] }, {}, { "data-controller": "tom-select", "data-dependent-select-target": "select", class: "primary" }
|
||||
.four.columns.omega{ data: { controller: "primary-details" }}
|
||||
= af.select :country_id, available_countries.map { |c| [c.name, c.id] }, {}, { "data-controller": "tom-select", "data-dependent-select-target": "source", "data-action": "dependent-select#handleSelectChange", class: "primary" }
|
||||
.row
|
||||
.three.columns.alpha
|
||||
= af.label :latitude, t(:latitude)
|
||||
\/
|
||||
= af.label :longitude, t(:longitude)
|
||||
%span.required *
|
||||
= render partial: 'admin/shared/tooltip', locals: {tooltip_text: t('latitude_longitude_tip')}
|
||||
.four.columns
|
||||
= af.text_field :latitude, { placeholder: t(:latitude_placeholder) }
|
||||
.four.columns.omega
|
||||
= af.text_field :longitude, { placeholder: t(:longitude_placeholder) }
|
||||
.row
|
||||
.three.columns.alpha
|
||||
= " ".html_safe
|
||||
.five.columns.omega
|
||||
= check_box_tag "use_geocoder"
|
||||
= label_tag "use_geocoder", t('use_geocoder')
|
||||
)
|
||||
.row
|
||||
.three.columns.alpha
|
||||
= af.label :address1, t(:address)
|
||||
%span.required *
|
||||
.eight.columns.omega
|
||||
= af.text_field :address1, { placeholder: t(:address_placeholder) }
|
||||
.row
|
||||
.alpha.three.columns
|
||||
= af.label :address2, t(:address2)
|
||||
.eight.columns.omega
|
||||
= af.text_field :address2
|
||||
.row
|
||||
.three.columns.alpha
|
||||
= af.label :city, t(:city)
|
||||
\/
|
||||
= af.label :zipcode, t(:postcode)
|
||||
%span.required *
|
||||
.four.columns
|
||||
= af.text_field :city, { placeholder: t(:city_placeholder) }
|
||||
.four.columns.omega
|
||||
= af.text_field :zipcode, { placeholder: t(:postcode_placeholder) }
|
||||
.row{"data-controller": "dependent-select", "data-dependent-select-options-value": countries_with_states }
|
||||
.three.columns.alpha
|
||||
= af.label :state_id, t(:state)
|
||||
\/
|
||||
= af.label :country_id, t(:country)
|
||||
%span.required *
|
||||
.four.columns
|
||||
= af.select :state_id, @enterprise.address.country.states.map { |s| [s.name, s.id] }, {}, { "data-controller": "tom-select", "data-dependent-select-target": "select", class: "primary" }
|
||||
.four.columns.omega{ data: { controller: "primary-details" }}
|
||||
= af.select :country_id, available_countries.map { |c| [c.name, c.id] }, {}, { "data-controller": "tom-select", "data-dependent-select-target": "source", "data-action": "dependent-select#handleSelectChange", class: "primary" }
|
||||
.row
|
||||
.three.columns.alpha
|
||||
= af.label :latitude, t(:latitude)
|
||||
\/
|
||||
= af.label :longitude, t(:longitude)
|
||||
%span.required *
|
||||
= render partial: 'admin/shared/tooltip', locals: {tooltip_text: t('latitude_longitude_tip')}
|
||||
.four.columns
|
||||
= af.text_field :latitude, { placeholder: t(:latitude_placeholder) }
|
||||
.four.columns.omega
|
||||
= af.text_field :longitude, { placeholder: t(:longitude_placeholder) }
|
||||
.row
|
||||
.three.columns.alpha
|
||||
= " ".html_safe
|
||||
.five.columns.omega
|
||||
= check_box_tag "use_geocoder"
|
||||
= label_tag "use_geocoder", t('use_geocoder')
|
||||
|
||||
@@ -195,7 +195,7 @@ table#listing_enterprise_groups {
|
||||
}
|
||||
|
||||
.fullwidth_inputs {
|
||||
input[type=text], select {
|
||||
#{$text-inputs}, select {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
input[type="text"],
|
||||
input[type="password"],
|
||||
input[type="email"],
|
||||
$text-inputs:
|
||||
"input[type=text], input[type=password], input[type=email], input[type=url], input[type=tel]";
|
||||
|
||||
#{$text-inputs},
|
||||
input[type="date"],
|
||||
input[type="datetime"],
|
||||
input[type="time"],
|
||||
input[type="url"],
|
||||
input[type="number"],
|
||||
input[type="tel"],
|
||||
textarea, fieldset {
|
||||
@include border-radius($border-radius);
|
||||
padding: 7px 10px;
|
||||
|
||||
Reference in New Issue
Block a user