mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-02 02:11:33 +00:00
Add spree_backend views related to admin/configuration menu that are missing in ofn
This commit is contained in:
24
app/views/spree/admin/tax_categories/_form.html.erb
Normal file
24
app/views/spree/admin/tax_categories/_form.html.erb
Normal file
@@ -0,0 +1,24 @@
|
||||
<div data-hook="admin_tax_category_form_fields" class="row">
|
||||
<div class="alpha four columns">
|
||||
<%= f.field_container :name do %>
|
||||
<%= f.label :name, Spree.t(:name) %>
|
||||
<%= f.text_field :name, :class => 'fullwidth' %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="five columns">
|
||||
<%= f.field_container :description do %>
|
||||
<%= f.label :description, Spree.t(:description) %><br>
|
||||
<%= f.text_field :description, :class => 'fullwidth' %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="three columns omega">
|
||||
<%= f.field_container :is_default, :class => ['checkbox'] do %>
|
||||
<label>
|
||||
<%= f.check_box :is_default %>
|
||||
<%= Spree.t(:default) %>
|
||||
</label>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
18
app/views/spree/admin/tax_categories/edit.html.erb
Normal file
18
app/views/spree/admin/tax_categories/edit.html.erb
Normal file
@@ -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 %>
|
||||
<li><%= link_to_with_icon 'icon-arrow-left', Spree.t(:back_to_tax_categories_list), admin_tax_categories_path, :class => 'button' %></li>
|
||||
<% end %>
|
||||
|
||||
<%= render :partial => 'spree/shared/error_messages', :locals => { :target => @tax_category } %>
|
||||
|
||||
<%= form_for [:admin, @tax_category] do |f| %>
|
||||
<fieldset class="no-border-top">
|
||||
<%= render :partial => 'form', :locals => { :f => f } %>
|
||||
<%= render :partial => 'spree/admin/shared/edit_resource_links' %>
|
||||
</fieldset>
|
||||
<% end %>
|
||||
48
app/views/spree/admin/tax_categories/index.html.erb
Normal file
48
app/views/spree/admin/tax_categories/index.html.erb
Normal file
@@ -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 %>
|
||||
<ul class="actions inline-menu">
|
||||
<li>
|
||||
<%= button_link_to Spree.t(:new_tax_category), new_object_url, :icon => 'icon-plus', :id => 'admin_new_tax_categories_link' %>
|
||||
</li>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
||||
<table class="index" id='listing_tax_categories' data-hook>
|
||||
<colgroup>
|
||||
<col style="width: 30%" />
|
||||
<col style="width: 40%" />
|
||||
<col style="width: 15%" />
|
||||
<col style="width: 15%" />
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr data-hook="tax_header">
|
||||
<th><%= Spree.t(:name) %></th>
|
||||
<th><%= Spree.t(:description) %></th>
|
||||
<th><%= Spree.t(:default) %></th>
|
||||
<th class="actions"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @tax_categories.each do |tax_category|
|
||||
@edit_url = edit_admin_tax_category_path(tax_category)
|
||||
@delete_url = admin_tax_category_path(tax_category)
|
||||
%>
|
||||
<tr id="<%= spree_dom_id tax_category %>" data-hook="tax_row" class="<%= cycle('odd', 'even')%>">
|
||||
<td><%= tax_category.name %></td>
|
||||
<td><%= tax_category.description %></td>
|
||||
<td class="align-center"><%= tax_category.is_default.to_s.titleize %></td>
|
||||
<td class="actions">
|
||||
<%= link_to_edit tax_category, :no_text => true %>
|
||||
<%= link_to_delete tax_category, :no_text => true %>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% if @tax_categories.empty? %>
|
||||
<tr data-hook="tax_none"><td colspan="4"><%= Spree.t(:none) %></td></tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
19
app/views/spree/admin/tax_categories/new.html.erb
Normal file
19
app/views/spree/admin/tax_categories/new.html.erb
Normal file
@@ -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 %>
|
||||
<li><%= link_to_with_icon 'icon-arrow-left', Spree.t(:back_to_tax_categories_list), admin_tax_categories_path, :class => 'button' %></li>
|
||||
<% end %>
|
||||
|
||||
|
||||
<%= render :partial => 'spree/shared/error_messages', :locals => { :target => @tax_category } %>
|
||||
|
||||
<%= form_for [:admin, @tax_category] do |f| %>
|
||||
<fieldset class="no-border-top">
|
||||
<%= render :partial => 'form', :locals => { :f => f } %>
|
||||
<%= render :partial => 'spree/admin/shared/new_resource_links' %>
|
||||
</fieldset>
|
||||
<% end %>
|
||||
1
app/views/spree/admin/tax_categories/show.html.erb
Normal file
1
app/views/spree/admin/tax_categories/show.html.erb
Normal file
@@ -0,0 +1 @@
|
||||
<%= render :partial => 'spree/admin/shared/configuration_menu' %>
|
||||
42
app/views/spree/admin/tax_rates/_form.html.erb
Normal file
42
app/views/spree/admin/tax_rates/_form.html.erb
Normal file
@@ -0,0 +1,42 @@
|
||||
<div data-hook="admin_tax_rate_form_fields">
|
||||
<div class="alpha twelve columns">
|
||||
<fieldset data-hook="tax_rates" class=" no-border-bottom">
|
||||
<legend align="center"><%= Spree.t(:general_settings) %></legend>
|
||||
|
||||
<div class="alpha six columns">
|
||||
<div data-hook="name" class="field">
|
||||
<%= f.label :name, Spree.t(:name) %>
|
||||
<%= f.text_field :name, :class => 'fullwidth' %>
|
||||
</div>
|
||||
<div data-hook="rate" class="field">
|
||||
<%= f.label :amount, Spree.t(:rate) %>
|
||||
<%= f.text_field :amount, :class => 'fullwidth' %>
|
||||
<p><em><%= Spree.t(:tax_rate_amount_explanation) %></em></p>
|
||||
</div>
|
||||
<div data-hook="included" class="field">
|
||||
<%= f.check_box :included_in_price %>
|
||||
<%= f.label :included_in_price, Spree.t(:included_in_price) %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="omega six columns">
|
||||
<div data-hook="zone" class="field">
|
||||
<%= f.label :zone, Spree.t(:zone) %>
|
||||
<%= f.collection_select(:zone_id, @available_zones, :id, :name, {}, {:class => 'select2 fullwidth'}) %>
|
||||
</div>
|
||||
<div data-hook="category" class="field">
|
||||
<%= f.label :tax_category_id, Spree.t(:tax_category) %>
|
||||
<%= f.collection_select(:tax_category_id, @available_categories,:id, :name, {}, {:class => 'select2 fullwidth'}) %>
|
||||
</div>
|
||||
<div data-hook="show_rate" class="field">
|
||||
<%= f.check_box :show_rate_in_label %>
|
||||
<%= f.label :show_rate_in_label, Spree.t(:show_rate_in_label) %>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div class="clear"></div>
|
||||
|
||||
<%= render :partial => 'spree/admin/shared/calculator_fields', :locals => { :f => f } %>
|
||||
</div>
|
||||
21
app/views/spree/admin/tax_rates/edit.html.erb
Normal file
21
app/views/spree/admin/tax_rates/edit.html.erb
Normal file
@@ -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 %>
|
||||
<li>
|
||||
<%= button_link_to Spree.t(:back_to_tax_rates_list), spree.admin_tax_rates_path, :icon => 'icon-arrow-left' %>
|
||||
</li>
|
||||
<% end %>
|
||||
|
||||
<%= render :partial => 'spree/shared/error_messages', :locals => { :target => @tax_rate } %>
|
||||
|
||||
<%= form_for [:admin, @tax_rate] do |f| %>
|
||||
<fieldset class="no-border-top">
|
||||
<%= render :partial => 'form', :locals => { :f => f } %>
|
||||
<div class="clear"></div>
|
||||
<%= render :partial => 'spree/admin/shared/edit_resource_links' %>
|
||||
</fieldset>
|
||||
<% end %>
|
||||
59
app/views/spree/admin/tax_rates/index.html.erb
Normal file
59
app/views/spree/admin/tax_rates/index.html.erb
Normal file
@@ -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 %>
|
||||
<li>
|
||||
<%= button_link_to Spree.t(:new_tax_rate), new_object_url, :icon => 'icon-plus' %>
|
||||
</li>
|
||||
<% end %>
|
||||
|
||||
<% unless @tax_rates.any? %>
|
||||
<div class="no-objects-found">
|
||||
<%= Spree.t(:no_results) %>
|
||||
</div>
|
||||
<% else %>
|
||||
<table class="index">
|
||||
<colgroup>
|
||||
<col style="width: 15%">
|
||||
<col style="width: 15%">
|
||||
<col style="width: 10%">
|
||||
<col style="width: 10%">
|
||||
<col style="width: 10%">
|
||||
<col style="width: 10%">
|
||||
<col style="width: 15%">
|
||||
<col style="width: 15%">
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr data-hook="rate_header">
|
||||
<th><%= Spree.t(:zone) %></th>
|
||||
<th><%= Spree.t(:name) %></th>
|
||||
<th><%= Spree.t(:category) %></th>
|
||||
<th><%= Spree.t(:amount) %></th>
|
||||
<th><%= Spree.t(:included_in_price) %></th>
|
||||
<th><%= Spree.t(:show_rate_in_label) %></th>
|
||||
<th><%= Spree.t(:calculator) %></th>
|
||||
<th class="actions"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @tax_rates.each do |tax_rate|%>
|
||||
<tr id="<%= spree_dom_id tax_rate %>" data-hook="rate_row" class="<%= cycle('odd', 'even')%>">
|
||||
<td><%=tax_rate.zone.try(:name) || Spree.t(:not_available) %></td>
|
||||
<td><%=tax_rate.name %></td>
|
||||
<td><%=tax_rate.tax_category.try(:name) || Spree.t(:not_available) %></td>
|
||||
<td class="align-center"><%=tax_rate.amount %></td>
|
||||
<td class="align-center"><%=tax_rate.included_in_price %></td>
|
||||
<td class="align-center"><%=tax_rate.show_rate_in_label %></td>
|
||||
<td class="align-center"><%=tax_rate.calculator.to_s %></td>
|
||||
<td class="actions">
|
||||
<%= link_to_edit tax_rate, :no_text => true %>
|
||||
<%= link_to_delete tax_rate, :no_text => true %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<% end %>
|
||||
25
app/views/spree/admin/tax_rates/new.html.erb
Normal file
25
app/views/spree/admin/tax_rates/new.html.erb
Normal file
@@ -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 %>
|
||||
<li>
|
||||
<%= button_link_to Spree.t(:back_to_tax_rates_list), spree.admin_tax_rates_path, :icon => 'icon-arrow-left' %>
|
||||
</li>
|
||||
<% end %>
|
||||
|
||||
<%= render :partial => 'spree/shared/error_messages', :locals => { :target => @tax_rate } %>
|
||||
|
||||
<%= form_for [:admin, @tax_rate] do |f| %>
|
||||
<fieldset class="no-border-top">
|
||||
|
||||
<%= render :partial => 'form', :locals => { :f => f } %>
|
||||
|
||||
<div class="clear"></div>
|
||||
|
||||
<%= render :partial => 'spree/admin/shared/new_resource_links' %>
|
||||
|
||||
</fieldset>
|
||||
<% end %>
|
||||
Reference in New Issue
Block a user