Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Taxon form UX fixes

Damian Legawiec0887dcbdf32c
diff --git a/backend/app/views/spree/admin/taxons/_form.html.erb b/backend/app/views/spree/admin/taxons/_form.html.erb
index d9b25ba049..3c35d687c7 100644
--- a/backend/app/views/spree/admin/taxons/_form.html.erb
+++ b/backend/app/views/spree/admin/taxons/_form.html.erb
@@ -1,49 +1,45 @@
<div data-hook="admin_inside_taxon_form">
- <div class="row">
- <div class="col-12 col-md-5">
- <%= f.field_container :name, class: ['form-group'] do %>
- <%= f.label :name, Spree.t(:name) %> <span class="required">*</span>
- <%= text_field :taxon, :name, class: 'form-control' %>
- <%= f.error_message_on :name, class: 'error-message' %>
- <% end %>
+ <%= f.field_container :name, class: ['form-group'] do %>
+ <%= f.label :name, raw(Spree.t(:name) + required_span_tag) %>
+ <%= text_field :taxon, :name, class: 'form-control' %>
+ <%= f.error_message_on :name, class: 'error-message' %>
+ <% end %>
- <%= f.field_container :permalink, class: ['form-group'] do %>
- <%= label_tag :permalink_part, Spree.t(:permalink) %> <span class="required">*</span>
- <%= text_field_tag :permalink_part, @permalink_part, class: 'form-control', required: true %>
- <small class="form-text text-muted" id="permalink_part_display">
- <%= @taxon.permalink.split('/')[0...-1].join('/') + '/' %>
- </small>
- <% end %>
+ <%= f.field_container :permalink, class: ['form-group'] do %>
+ <%= label_tag :permalink_part, raw(Spree.t(:permalink) + required_span_tag) %>
+ <div class="input-group mb-3">
+ <div class="input-group-prepend">
+ <span class="input-group-text" id="basic-addon3">https://<%= current_store.url %>/t/</span>
+ </div>
+ <%= text_field_tag :permalink_part, @permalink_part, class: 'form-control', required: true %>
+ </div>
+ <% end %>
- <%= f.field_container :hide_from_nav, class: ['form-group'] do %>
- <%= f.label :hide_from_nav do %>
- <%= Spree.t(:hide_from_subcategories_nav) %>
- <br>
- <%= f.check_box :hide_from_nav, { checked: @taxon.hide_from_nav } %>
- <small><%= Spree.t(:say_yes) %></small>
- <% end %>
- <% end %>
+ <%= f.field_container :hide_from_nav, class: ['form-group'] do %>
+ <%= f.label :hide_from_nav do %>
+ <%= Spree.t(:hide_from_subcategories_nav) %>
+ <br>
+ <%= f.check_box :hide_from_nav, { checked: @taxon.hide_from_nav } %>
+ <small><%= Spree.t(:say_yes) %></small>
+ <% end %>
+ <% end %>
- <%= f.field_container :icon, class: ['form-group'] do %>
- <%= f.label :icon, Spree.t(:header_banner) %>
- <%= image_tag(main_app.url_for(@taxon.icon.try(:attachment)), class: 'w-100') if @taxon.icon %>
- <%= f.file_field :icon %>
- <% if @taxon.icon.present? %>
- <%= link_to Spree.t(:remove_image),
- remove_icon_admin_taxonomy_taxon_url(@taxonomy.id, @taxon.id),
- method: :delete
- %>
- <% end %>
- <% end %>
- </div>
+ <%= f.field_container :icon, class: ['form-group'] do %>
+ <%= f.label :icon, Spree.t(:header_banner) %>
+ <%= image_tag(main_app.url_for(@taxon.icon.try(:attachment)), class: 'w-100') if @taxon.icon %>
+ <%= f.file_field :icon %>
+ <% if @taxon.icon.present? %>
+ <%= link_to Spree.t(:remove_image),
+ remove_icon_admin_taxonomy_taxon_url(@taxonomy.id, @taxon.id),
+ method: :delete
+ %>
+ <% end %>
+ <% end %>
- <div class="col-12 col-md-7">
- <%= f.field_container :description, class: ['form-group'] do %>
- <%= f.label :description, Spree.t(:description) %>
- <%= f.text_area :description, class: 'form-control', rows: 6 %>
- <% end %>
- </div>
- </div>
+ <%= f.field_container :description, class: ['form-group'] do %>
+ <%= f.label :description, Spree.t(:description) %>
+ <%= f.text_area :description, class: 'form-control', rows: 6 %>
+ <% end %>
<%= f.field_container :meta_title, class: ['form-group'] do %>
<%= f.label :meta_title, Spree.t(:meta_title) %>