From bc6f7934e08d49e39834a17bbf8af52c793e1ac7 Mon Sep 17 00:00:00 2001 From: luisramos0 Date: Tue, 17 Sep 2019 16:23:39 +0100 Subject: [PATCH] Add spree_backend views related to admin/configuration menu that are missing in ofn --- .../spree/admin/tax_categories/_form.html.erb | 24 ++++++++ .../spree/admin/tax_categories/edit.html.erb | 18 ++++++ .../spree/admin/tax_categories/index.html.erb | 48 +++++++++++++++ .../spree/admin/tax_categories/new.html.erb | 19 ++++++ .../spree/admin/tax_categories/show.html.erb | 1 + .../spree/admin/tax_rates/_form.html.erb | 42 +++++++++++++ app/views/spree/admin/tax_rates/edit.html.erb | 21 +++++++ .../spree/admin/tax_rates/index.html.erb | 59 +++++++++++++++++++ app/views/spree/admin/tax_rates/new.html.erb | 25 ++++++++ 9 files changed, 257 insertions(+) create mode 100644 app/views/spree/admin/tax_categories/_form.html.erb create mode 100644 app/views/spree/admin/tax_categories/edit.html.erb create mode 100644 app/views/spree/admin/tax_categories/index.html.erb create mode 100644 app/views/spree/admin/tax_categories/new.html.erb create mode 100644 app/views/spree/admin/tax_categories/show.html.erb create mode 100644 app/views/spree/admin/tax_rates/_form.html.erb create mode 100644 app/views/spree/admin/tax_rates/edit.html.erb create mode 100644 app/views/spree/admin/tax_rates/index.html.erb create mode 100644 app/views/spree/admin/tax_rates/new.html.erb diff --git a/app/views/spree/admin/tax_categories/_form.html.erb b/app/views/spree/admin/tax_categories/_form.html.erb new file mode 100644 index 0000000000..f112f86675 --- /dev/null +++ b/app/views/spree/admin/tax_categories/_form.html.erb @@ -0,0 +1,24 @@ +
+
+ <%= f.field_container :name do %> + <%= f.label :name, Spree.t(:name) %> + <%= f.text_field :name, :class => 'fullwidth' %> + <% end %> +
+ +
+ <%= f.field_container :description do %> + <%= f.label :description, Spree.t(:description) %>
+ <%= f.text_field :description, :class => 'fullwidth' %> + <% end %> +
+ +
+ <%= f.field_container :is_default, :class => ['checkbox'] do %> + + <% end %> +
+
\ No newline at end of file diff --git a/app/views/spree/admin/tax_categories/edit.html.erb b/app/views/spree/admin/tax_categories/edit.html.erb new file mode 100644 index 0000000000..8cb0a957c0 --- /dev/null +++ b/app/views/spree/admin/tax_categories/edit.html.erb @@ -0,0 +1,18 @@ +<%= render :partial => 'spree/admin/shared/configuration_menu' %> + +<% content_for :page_title do %> + <%= Spree.t(:editing_tax_category) %> +<% end %> + +<% content_for :page_actions do %> +
  • <%= link_to_with_icon 'icon-arrow-left', Spree.t(:back_to_tax_categories_list), admin_tax_categories_path, :class => 'button' %>
  • +<% end %> + +<%= render :partial => 'spree/shared/error_messages', :locals => { :target => @tax_category } %> + +<%= form_for [:admin, @tax_category] do |f| %> +
    + <%= render :partial => 'form', :locals => { :f => f } %> + <%= render :partial => 'spree/admin/shared/edit_resource_links' %> +
    +<% end %> diff --git a/app/views/spree/admin/tax_categories/index.html.erb b/app/views/spree/admin/tax_categories/index.html.erb new file mode 100644 index 0000000000..135bd56cee --- /dev/null +++ b/app/views/spree/admin/tax_categories/index.html.erb @@ -0,0 +1,48 @@ +<%= render :partial => 'spree/admin/shared/configuration_menu' %> + +<% content_for :page_title do %> + <%= Spree.t(:listing_tax_categories) %> +<% end %> + +<% content_for :page_actions do %> + +<% end %> + + + + + + + + + + + + + + + + + + <% @tax_categories.each do |tax_category| + @edit_url = edit_admin_tax_category_path(tax_category) + @delete_url = admin_tax_category_path(tax_category) + %> + + + + + + <% end %> + <% if @tax_categories.empty? %> + + <% end %> + +
    <%= Spree.t(:name) %><%= Spree.t(:description) %><%= Spree.t(:default) %>
    <%= tax_category.name %><%= tax_category.description %><%= tax_category.is_default.to_s.titleize %> + <%= link_to_edit tax_category, :no_text => true %> + <%= link_to_delete tax_category, :no_text => true %> +
    <%= Spree.t(:none) %>
    \ No newline at end of file diff --git a/app/views/spree/admin/tax_categories/new.html.erb b/app/views/spree/admin/tax_categories/new.html.erb new file mode 100644 index 0000000000..7a0be6efac --- /dev/null +++ b/app/views/spree/admin/tax_categories/new.html.erb @@ -0,0 +1,19 @@ +<%= render :partial => 'spree/admin/shared/configuration_menu' %> + +<% content_for :page_title do %> + <%= Spree.t(:new_tax_category) %> +<% end %> + +<% content_for :page_actions do %> +
  • <%= link_to_with_icon 'icon-arrow-left', Spree.t(:back_to_tax_categories_list), admin_tax_categories_path, :class => 'button' %>
  • +<% end %> + + +<%= render :partial => 'spree/shared/error_messages', :locals => { :target => @tax_category } %> + +<%= form_for [:admin, @tax_category] do |f| %> +
    + <%= render :partial => 'form', :locals => { :f => f } %> + <%= render :partial => 'spree/admin/shared/new_resource_links' %> +
    +<% end %> diff --git a/app/views/spree/admin/tax_categories/show.html.erb b/app/views/spree/admin/tax_categories/show.html.erb new file mode 100644 index 0000000000..74bb46d527 --- /dev/null +++ b/app/views/spree/admin/tax_categories/show.html.erb @@ -0,0 +1 @@ +<%= render :partial => 'spree/admin/shared/configuration_menu' %> diff --git a/app/views/spree/admin/tax_rates/_form.html.erb b/app/views/spree/admin/tax_rates/_form.html.erb new file mode 100644 index 0000000000..dec5a210c7 --- /dev/null +++ b/app/views/spree/admin/tax_rates/_form.html.erb @@ -0,0 +1,42 @@ +
    +
    +
    + <%= Spree.t(:general_settings) %> + +
    +
    + <%= f.label :name, Spree.t(:name) %> + <%= f.text_field :name, :class => 'fullwidth' %> +
    +
    + <%= f.label :amount, Spree.t(:rate) %> + <%= f.text_field :amount, :class => 'fullwidth' %> +

    <%= Spree.t(:tax_rate_amount_explanation) %>

    +
    +
    + <%= f.check_box :included_in_price %> + <%= f.label :included_in_price, Spree.t(:included_in_price) %> +
    +
    + +
    +
    + <%= f.label :zone, Spree.t(:zone) %> + <%= f.collection_select(:zone_id, @available_zones, :id, :name, {}, {:class => 'select2 fullwidth'}) %> +
    +
    + <%= f.label :tax_category_id, Spree.t(:tax_category) %> + <%= f.collection_select(:tax_category_id, @available_categories,:id, :name, {}, {:class => 'select2 fullwidth'}) %> +
    +
    + <%= f.check_box :show_rate_in_label %> + <%= f.label :show_rate_in_label, Spree.t(:show_rate_in_label) %> +
    +
    +
    +
    + +
    + + <%= render :partial => 'spree/admin/shared/calculator_fields', :locals => { :f => f } %> +
    diff --git a/app/views/spree/admin/tax_rates/edit.html.erb b/app/views/spree/admin/tax_rates/edit.html.erb new file mode 100644 index 0000000000..8308a1c802 --- /dev/null +++ b/app/views/spree/admin/tax_rates/edit.html.erb @@ -0,0 +1,21 @@ +<%= render :partial => 'spree/admin/shared/configuration_menu' %> + +<% content_for :page_title do %> + <%= Spree.t(:editing_tax_rate) %> +<% end %> + +<% content_for :page_actions do %> +
  • + <%= button_link_to Spree.t(:back_to_tax_rates_list), spree.admin_tax_rates_path, :icon => 'icon-arrow-left' %> +
  • +<% end %> + +<%= render :partial => 'spree/shared/error_messages', :locals => { :target => @tax_rate } %> + +<%= form_for [:admin, @tax_rate] do |f| %> +
    + <%= render :partial => 'form', :locals => { :f => f } %> +
    + <%= render :partial => 'spree/admin/shared/edit_resource_links' %> +
    +<% end %> diff --git a/app/views/spree/admin/tax_rates/index.html.erb b/app/views/spree/admin/tax_rates/index.html.erb new file mode 100644 index 0000000000..90e404788c --- /dev/null +++ b/app/views/spree/admin/tax_rates/index.html.erb @@ -0,0 +1,59 @@ +<%= render :partial => 'spree/admin/shared/configuration_menu' %> + +<% content_for :page_title do %> + <%= Spree.t(:tax_rates) %> +<% end %> + +<% content_for :page_actions do %> +
  • + <%= button_link_to Spree.t(:new_tax_rate), new_object_url, :icon => 'icon-plus' %> +
  • +<% end %> + +<% unless @tax_rates.any? %> +
    + <%= Spree.t(:no_results) %> +
    +<% else %> + + + + + + + + + + + + + + + + + + + + + + + + + <% @tax_rates.each do |tax_rate|%> + + + + + + + + + + + <% end %> + +
    <%= Spree.t(:zone) %><%= Spree.t(:name) %><%= Spree.t(:category) %><%= Spree.t(:amount) %><%= Spree.t(:included_in_price) %><%= Spree.t(:show_rate_in_label) %><%= Spree.t(:calculator) %>
    <%=tax_rate.zone.try(:name) || Spree.t(:not_available) %><%=tax_rate.name %><%=tax_rate.tax_category.try(:name) || Spree.t(:not_available) %><%=tax_rate.amount %><%=tax_rate.included_in_price %><%=tax_rate.show_rate_in_label %><%=tax_rate.calculator.to_s %> + <%= link_to_edit tax_rate, :no_text => true %> + <%= link_to_delete tax_rate, :no_text => true %> +
    +<% end %> diff --git a/app/views/spree/admin/tax_rates/new.html.erb b/app/views/spree/admin/tax_rates/new.html.erb new file mode 100644 index 0000000000..c3720fcb59 --- /dev/null +++ b/app/views/spree/admin/tax_rates/new.html.erb @@ -0,0 +1,25 @@ +<%= render :partial => 'spree/admin/shared/configuration_menu' %> + +<% content_for :page_title do %> + <%= Spree.t(:new_tax_rate) %> +<% end %> + +<% content_for :page_actions do %> +
  • + <%= button_link_to Spree.t(:back_to_tax_rates_list), spree.admin_tax_rates_path, :icon => 'icon-arrow-left' %> +
  • +<% end %> + +<%= render :partial => 'spree/shared/error_messages', :locals => { :target => @tax_rate } %> + +<%= form_for [:admin, @tax_rate] do |f| %> +
    + + <%= render :partial => 'form', :locals => { :f => f } %> + +
    + + <%= render :partial => 'spree/admin/shared/new_resource_links' %> + +
    +<% end %>