Files
openfoodnetwork/app/views/admin/enterprises/new.html.haml
David Cook 2e2ff25ef7 DRY up code
Slightly. If we upgrade to Ruby 3.1 with hash value omission, this would be neater.
If we could set a scope in the controller (https://stackoverflow.com/questions/6137960/rails-i18n-default-scope) it would be even neater.
2022-10-04 19:39:29 +02:00

21 lines
728 B
Plaintext

= render partial: 'spree/shared/error_messages', locals: { target: @enterprise }
- content_for :page_title do
= t('.title')
- content_for :page_actions do
%li= button_link_to t('.back_link'), main_app.admin_enterprises_path, icon: 'icon-arrow-left'
- content_for :main_ng_app_name do
= "admin.enterprises"
= admin_inject_available_countries(module: 'admin.enterprises')
= admin_inject_json "admin.enterprises", "defaultCountryID", DefaultCountry.id
-# Form
= form_for [main_app, :admin, @enterprise], html: { "nav-check" => '', "nav-callback" => '' } do |f|
.row
.twelve.columns.fullwidth_inputs{ ng: { controller: "NewEnterpriseController" } }
= render 'new_form', f: f, scope: 'admin.enterprises.form'