mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-01 02:03:22 +00:00
Converted erb properties views to haml and added lazy lookups for translations
This commit is contained in:
@@ -1,16 +0,0 @@
|
||||
<div data-hook="admin_property_form" class="align-center row">
|
||||
<div class="alpha eight columns">
|
||||
<%= f.field_container :name do %>
|
||||
<%= f.label :name, Spree.t(:name) %> <span class="required">*</span><br />
|
||||
<%= f.text_field :name, :class => 'fullwidth' %>
|
||||
<%= f.error_message_on :name %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="eight columns omega">
|
||||
<%= f.field_container :presentation do %>
|
||||
<%= f.label :presentation, Spree.t(:presentation) %> <span class="required">*</span><br />
|
||||
<%= f.text_field :presentation, :class => 'fullwidth' %>
|
||||
<%= f.error_message_on :presentation %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
15
app/views/spree/admin/properties/_form.html.haml
Normal file
15
app/views/spree/admin/properties/_form.html.haml
Normal file
@@ -0,0 +1,15 @@
|
||||
.align-center.row
|
||||
.alpha.eight.columns
|
||||
= f.field_container :name do
|
||||
= f.label :name, t('.name')
|
||||
%span.required *
|
||||
%br/
|
||||
= f.text_field :name, class: 'fullwidth'
|
||||
= f.error_message_on :name
|
||||
.eight.columns.omega
|
||||
= f.field_container :presentation do
|
||||
= f.label :presentation, t('.presentation')
|
||||
%span.required *
|
||||
%br/
|
||||
= f.text_field :presentation, class: 'fullwidth'
|
||||
= f.error_message_on :presentation
|
||||
@@ -1,18 +0,0 @@
|
||||
<%= render :partial => 'spree/admin/shared/product_sub_menu' %>
|
||||
|
||||
<% content_for :page_title do %>
|
||||
<%= Spree.t(:editing_property) %>
|
||||
<% end %>
|
||||
|
||||
<% content_for :page_actions do %>
|
||||
<li><%= button_link_to Spree.t(:back_to_properties_list), admin_properties_url, :icon => 'icon-arrow-left'%></li>
|
||||
<% end %>
|
||||
|
||||
<%= render :partial => 'spree/shared/error_messages', :locals => { :target => @property } %>
|
||||
|
||||
<%= form_for [:admin, @property] do |f| %>
|
||||
<fieldset class="no-border-top">
|
||||
<%= render :partial => 'form', :locals => { :f => f } %>
|
||||
<%= render :partial => 'spree/admin/shared/edit_resource_links' %>
|
||||
</fieldset>
|
||||
<% end %>
|
||||
14
app/views/spree/admin/properties/edit.html.haml
Normal file
14
app/views/spree/admin/properties/edit.html.haml
Normal file
@@ -0,0 +1,14 @@
|
||||
= render partial: 'spree/admin/shared/product_sub_menu'
|
||||
|
||||
- content_for :page_title do
|
||||
= t('.editing_property')
|
||||
|
||||
- content_for :page_actions do
|
||||
%li= button_link_to t('.back_to_properties_list'), admin_properties_url, icon: 'icon-arrow-left'
|
||||
|
||||
= render partial: 'spree/shared/error_messages', locals: { target: @property }
|
||||
|
||||
= form_for [:admin, @property] do |f|
|
||||
%fieldset.no-border-top
|
||||
= render partial: 'form', locals: { f: f }
|
||||
= render partial: 'spree/admin/shared/edit_resource_links'
|
||||
@@ -1,41 +0,0 @@
|
||||
<% content_for :page_title do %>
|
||||
<%= Spree.t(:properties) %>
|
||||
<% end %>
|
||||
|
||||
<% content_for :page_actions do %>
|
||||
<li id="new_property_link">
|
||||
<%= button_link_to Spree.t(:new_property), new_admin_property_url, { :remote => true, :icon => 'icon-plus', 'data-update' => 'new_property', :id => 'new_property_link' } %>
|
||||
</li>
|
||||
<% end %>
|
||||
|
||||
<%= render :partial => 'spree/admin/shared/product_sub_menu' %>
|
||||
|
||||
<div id="new_property"></div>
|
||||
|
||||
<table class="index" id='listing_properties' data-hook>
|
||||
<colgroup>
|
||||
<col style="width: 45%">
|
||||
<col style="width: 45%">
|
||||
<col style="width: 10%">
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr data-hook="listing_properties_header">
|
||||
<th><%= Spree.t(:name) %></th>
|
||||
<th><%= Spree.t(:presentation) %></th>
|
||||
<th class="actions"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @properties.each do |property| %>
|
||||
<tr id="<%= spree_dom_id property %>" data-hook="listing_properties_row" class="<%= cycle('odd', 'even')%>">
|
||||
<td><%= property.name %></td>
|
||||
<td><%= property.presentation %></td>
|
||||
<td class="actions">
|
||||
<%= link_to_edit(property, :no_text => true) %>
|
||||
<%= link_to_delete(property, :no_text => true) %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
30
app/views/spree/admin/properties/index.html.haml
Normal file
30
app/views/spree/admin/properties/index.html.haml
Normal file
@@ -0,0 +1,30 @@
|
||||
- content_for :page_title do
|
||||
= t('.properties')
|
||||
|
||||
- content_for :page_actions do
|
||||
%li#new_property_link
|
||||
= button_link_to t('.new_property'), new_admin_property_url, { remote: true, icon: 'icon-plus', 'data-update' => 'new_property', id: 'new_property_link' }
|
||||
|
||||
= render partial: 'spree/admin/shared/product_sub_menu'
|
||||
|
||||
#new_property
|
||||
%table#listing_properties.index
|
||||
%colgroup
|
||||
%col{style: "width: 45%"}/
|
||||
%col{style: "width: 45%"}/
|
||||
%col{style: "width: 10%"}/
|
||||
%thead
|
||||
%tr
|
||||
%th= t('.name')
|
||||
%th= t('.presentation')
|
||||
%th.actions
|
||||
%tbody
|
||||
- @properties.each do |property|
|
||||
- tr_class = cycle('odd', 'even')
|
||||
- tr_id = spree_dom_id(property)
|
||||
%tr{class: tr_class, id: tr_id}
|
||||
%td= property.name
|
||||
%td= property.presentation
|
||||
%td.actions
|
||||
= link_to_edit(property, no_text: true)
|
||||
= link_to_delete(property, no_text: true)
|
||||
@@ -1,13 +0,0 @@
|
||||
<%= render :partial => 'spree/admin/shared/product_sub_menu' %>
|
||||
|
||||
<%= render :partial => 'spree/shared/error_messages', :locals => { :target => @property } %>
|
||||
|
||||
<%= form_for [:admin, @property] do |f| %>
|
||||
<fieldset data-hook="new_property">
|
||||
<legend align="center"><%= Spree.t(:new_property) %></legend>
|
||||
<%= render :partial => 'form', :locals => { :f => f } %>
|
||||
<div class="filter-actions">
|
||||
<%= render :partial => 'spree/admin/shared/new_resource_links' %>
|
||||
</div>
|
||||
</fieldset>
|
||||
<% end %>
|
||||
10
app/views/spree/admin/properties/new.html.haml
Normal file
10
app/views/spree/admin/properties/new.html.haml
Normal file
@@ -0,0 +1,10 @@
|
||||
= render partial: 'spree/admin/shared/product_sub_menu'
|
||||
|
||||
= render partial: 'spree/shared/error_messages', locals: { target: @property }
|
||||
|
||||
= form_for [:admin, @property] do |f|
|
||||
%fieldset
|
||||
%legend{align: "center"}= t('.new_property')
|
||||
= render partial: 'form', locals: { f: f }
|
||||
.filter-actions
|
||||
= render partial: 'spree/admin/shared/new_resource_links'
|
||||
@@ -2993,6 +2993,20 @@ See the %{link} to find out more about %{sitename}'s features and to start using
|
||||
inherits_properties_checkbox_hint: "Inherit properties from %{supplier}? (unless overridden above)"
|
||||
add_product_properties: "Add Product Properties"
|
||||
select_from_prototype: "Select From Prototype"
|
||||
properties:
|
||||
index:
|
||||
properties: "Properties"
|
||||
new_property: "New Property"
|
||||
name: "Name"
|
||||
presentation: "Presentation"
|
||||
new:
|
||||
new_property: "New Property"
|
||||
edit:
|
||||
editing_property: "Editing Property"
|
||||
back_to_properties_list: "Back To Properties List"
|
||||
form:
|
||||
name: "Name"
|
||||
presentation: "Presentation"
|
||||
orders:
|
||||
index:
|
||||
listing_orders: "Listing Orders"
|
||||
|
||||
Reference in New Issue
Block a user