Skip to content

Commit

Permalink
improve views - respecting new Spree localization practices
Browse files Browse the repository at this point in the history
Part of #33
  • Loading branch information
GarPit authored and radar committed Dec 8, 2013
1 parent 61a0f71 commit 9c41458
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
6 changes: 3 additions & 3 deletions app/views/spree/admin/product_groups/_preview.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<h2><%= Spree::ProductGroup.human_attribute_name(:products) %> (<%= count %>)</h2>

<% if count == 0 %>
<p data-hook="preview_empty"><%= t(:no_match_found) %></p>
<p data-hook="preview_empty"><%= Spree.t(:no_match_found) %></p>
<% else %>

<% if count > Spree::Config[:admin_pgroup_per_page] %>
Expand All @@ -14,7 +14,7 @@
<thead>
<tr data-hook="preview_header">
<th><%= Spree::Product.human_attribute_name(:name) %></th>
<th><%= t(:action) %></th>
<th><%= Spree.t(:action) %></th>
</tr>
</thead>
<tbody>
Expand All @@ -24,7 +24,7 @@
<%= link_to product.name, product_url(product) %>
</td>
<td>
<%= link_to t(:edit), edit_admin_product_path(product) %>
<%= link_to Spree.t(:edit), edit_admin_product_path(product) %>
</td>
</tr>
<% end %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
<% end %>
</td>
<td class="actions" data-hook="actions">
<%= link_to_delete product_scope, url: admin_product_group_product_scope_path(@product_group, product_scope), :no_text => true %>
<%= link_to_with_icon 'cross icon-trash no-text', '', admin_product_group_product_scope_path(@product_group, product_scope), :remote => true, :method => 'delete' %>
</td>
</tr>
12 changes: 6 additions & 6 deletions app/views/spree/admin/product_groups/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,35 @@
<% content_for :page_actions do %>
<li>
<%= button_link_to Spree.t(:back_to_product_groups_list), admin_product_groups_url, :icon => 'icon-arrow-left' %>
</li>
</li>
<% end %>

<fieldset id="product_group_forms_container" data-hook>

<%= form_for [:admin, @product_group], :html => { :id => 'product-group-form', :method => :put } do |f| %>

<%= f.field_container :name do %>
<%= f.label :name, t(:name) %><br />
<%= f.label :name, Spree::ProductGroup.human_attribute_name(:name) %><br />
<%= f.text_field :name %>
<%= f.error_message_on :name %>
<% end %>

<%= f.field_container :permalink do %>
<%= f.label :permalink, t(:permalink) %><br />
<%= f.label :permalink, Spree::ProductGroup.human_attribute_name(:permalink) %><br />
<%= f.text_field :permalink %>
<%= f.error_message_on :permalink %>
<% end %>

<%= f.field_container :order_scope do %>
<%= f.label :order_scope, t(:sort_ordering) %><br />
<%= f.label :order_scope, Spree::ProductGroup.human_attribute_name(:sort_ordering) %><br />
<%= f.select(:order_scope, Spree::Product.simple_scopes.collect{|p| [ t(:name, :scope =>[:product_scopes, :scopes, p]), p.to_s ] }) %>
<% end %>

<table id="product_scopes" data-hook>
<%= render :partial => 'product_scope', :collection => @product_group.product_scopes.reject {|s| s.is_ordering? } %>
</table>

<%= button t(:update) %>
<%= button Spree.t(:update) %>

<% end %>

Expand All @@ -54,7 +54,7 @@
)
%>
<p>
<%= label_tag :product_scope_name, t(:add_scope) %>
<%= label_tag :product_scope_name, Spree.t(:add_scope) %>
<%= select_tag 'product_scope[name]', options %>
<%= submit_tag Spree.t(:add) %>
</p>
Expand Down
6 changes: 3 additions & 3 deletions app/views/spree/admin/product_groups/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<% content_for :page_actions do %>
<li>
<%= button_link_to t(:new_product_group), new_object_url, :icon => 'icon-plus', :id => 'admin_new_product_group_link' %>
<%= button_link_to Spree.t(:new_product_group), new_object_url, :icon => 'icon-plus', :id => 'admin_new_product_group_link' %>
</li>
<% end %>

Expand All @@ -25,7 +25,7 @@
<th><%= Spree::ProductGroup.human_attribute_name(:url) %></th>
<th><%= Spree::ProductGroup.human_attribute_name(:product_scopes) %></th>
<th><%= Spree::ProductGroup.human_attribute_name(:product_count) %></th>
<th><%= t(:action) %></th>
<th><%= Spree.t(:action) %></th>
</tr>
</thead>
<tbody>
Expand All @@ -49,4 +49,4 @@
<%= Spree.t(:no_resource_found, resource: I18n.t(:other, scope: 'activerecord.models.spree/product_group')) %>,
<%= link_to Spree.t(:add_one), new_object_url %>!
</div>
<% end %>
<% end %>
8 changes: 4 additions & 4 deletions app/views/spree/admin/product_groups/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
<% content_for :page_actions do %>
<li>
<%= button_link_to Spree.t(:back_to_product_groups_list), admin_product_groups_url, :icon => 'icon-arrow-left' %>
</li>
</li>
<% end %>

<%= form_for [:admin, @product_group], :html => { :id => 'product-group-form', :multipart => true } do |f| %>
<fieldset data-hook="name">
<legend><%= t(:product_group) %></legend>
<legend><%= Spree::ProductGroup.model_name.human %></legend>
<%= f.field_container :name do %>
<%= f.label :name, t(:name) %>
<%= f.label :name, Spree::ProductGroup.human_attribute_name(:name) %>
<%= f.text_field :name %>
<%= f.error_message_on :name %>
<% end %>
</fieldset>
<%= button t(:create) %>
<%= button Spree.t(:create) %>
<% end %>
2 changes: 1 addition & 1 deletion app/views/spree/admin/product_groups/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<% @product_group.product_scopes.each do |product_scope| %>
<tr <%= !product_scope.valid? ? "class='invalid'":'' %> data-hook="product_scopes_row">
<td>
<%= product_scope.to_sentence %>
<%= product_scope.to_sentence.html_safe %>
</td>
<td>
<%= product_scope.arguments.join(', ') %>
Expand Down

0 comments on commit 9c41458

Please sign in to comment.