Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove all icons from tabs and buttons #1358

Merged
merged 5 commits into from
Aug 1, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## Solidus 1.4.0 (master, unreleased)

* Backend: UI, Remove icons from buttons and tabs

* Backend: Deprecate args/options that add icons to buttons

* Update Rules::Taxon/Product handling of invalid match policies

Rules::Taxon and Rules::Product now require valid match_policy values.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@

<fieldset class="no-border-bottom">
<legend align="center" class="stock-location">
<button class="add_variant no-text fa fa-plus icon_link" title="{{ t "add" }}" data-action="add">{{ t "add" }}</button>
<button class="add_variant" title="{{ t "add" }}" data-action="add">{{ t "add" }}</button>
</legend>
</fieldset>
</fieldset>
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,14 @@ input[type="submit"],
input[type="button"],
button, .button {
display: inline-block;
padding: 8px 15px;
padding: 6px 15px;
border: none;
border-radius: $border-radius;
background-color: $color-btn-bg;
color: $color-btn-text;
font-weight: $font-weight-bold !important;
white-space: nowrap;
line-height: $line-height;

&:before {
font-weight: normal !important;
Expand Down
8 changes: 7 additions & 1 deletion backend/app/helpers/spree/admin/navigation_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,12 @@ def icon(icon_name)
end

def button(text, icon_name = nil, button_type = 'submit', options = {})
button_tag(text, options.merge(type: button_type, class: "fa fa-#{icon_name} button"))
class_names = "button"
if icon_name
Spree::Deprecation.warn "Using icon_name arg is deprecated. Icons could not be visible in future versions.", caller
class_names.prepend "fa fa-#{icon_name} "
end
button_tag(text, options.merge(type: button_type, class: class_names))
end

def button_link_to(text, url, html_options = {})
Expand All @@ -136,6 +141,7 @@ def button_link_to(text, url, html_options = {})
html_options[:class] += ' button'

if html_options[:icon]
Spree::Deprecation.warn "Using :icon option is deprecated. Icons could not be visible in future versions.", caller
html_options[:class] += " fa fa-#{html_options[:icon]}"
end
link_to(text, url, html_options)
Expand Down
1 change: 0 additions & 1 deletion backend/app/helpers/spree/admin/orders_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ def event_links
next unless @order.send("can_#{event}?")
links << button_link_to(Spree.t(event), [event, :admin, @order],
method: :put,
icon: event.to_s,
data: { confirm: Spree.t(:order_sure_want_to, event: Spree.t(event)) })
end
safe_join(links, '&nbsp;'.html_safe)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<% content_for :page_actions do %>
<ul class="actions inline-menu">
<li>
<%= button_link_to Spree.t(:new_adjustment_reason), new_object_url, { icon: 'plus', id: 'admin_new_named_type' } %>
<%= button_link_to Spree.t(:new_adjustment_reason), new_object_url, { id: 'admin_new_named_type' } %>
</li>
</ul>
<% end %>
Expand Down
4 changes: 2 additions & 2 deletions backend/app/views/spree/admin/adjustments/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<%= render :partial => 'form', :locals => { :f => f } %>

<div class="filter-actions actions" data-hook="buttons">
<%= button Spree.t(:continue), 'arrow-right' %>
<%= link_to_with_icon 'remove', Spree.t('actions.cancel'), admin_order_adjustments_url(@order), :class => 'button' %>
<%= button Spree.t(:continue) %>
<%= link_to Spree.t('actions.cancel'), admin_order_adjustments_url(@order), :class => 'button' %>
</div>
</fieldset>
<% end %>
4 changes: 2 additions & 2 deletions backend/app/views/spree/admin/adjustments/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<% content_for :page_actions do %>
<% if can? :create, Spree::Adjustment %>
<li>
<%= button_link_to Spree.t(:new_adjustment), new_admin_order_adjustment_url(@order), :icon => 'plus' %>
<%= button_link_to Spree.t(:new_adjustment), new_admin_order_adjustment_url(@order) %>
</li>
<% end %>
<% end %>
Expand All @@ -15,7 +15,7 @@
<% if @order.can_add_coupon? %>
<div data-hook="adjustments_new_coupon_code">
<%= text_field_tag "coupon_code", "", :placeholder => Spree.t(:coupon_code) %>
<%= button Spree.t(:add_coupon_code), 'plus', 'submit', :id => "add_coupon_code" %>
<%= button Spree.t(:add_coupon_code), nil, 'submit', :id => "add_coupon_code" %>
</div>
<% end %>
<%= javascript_tag do -%>
Expand Down
4 changes: 2 additions & 2 deletions backend/app/views/spree/admin/adjustments/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
<%= render :partial => 'form', :locals => { :f => f } %>

<div class="filter-actions actions" data-hook="buttons">
<%= button Spree.t(:continue), 'arrow-right' %>
<%= button_link_to Spree.t('actions.cancel'), admin_order_adjustments_url(@order), :icon => 'remove' %>
<%= button Spree.t(:continue) %>
<%= button_link_to Spree.t('actions.cancel'), admin_order_adjustments_url(@order) %>
</div>
</fieldset>
<% end %>
2 changes: 1 addition & 1 deletion backend/app/views/spree/admin/countries/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<ul class="actions inline-menu">
<% if can?(:create, Spree::Country) %>
<li>
<%= button_link_to Spree.t(:new_country), new_object_url, { :icon => 'plus', :id => 'admin_new_country' } %>
<%= button_link_to Spree.t(:new_country), new_object_url, { :id => 'admin_new_country' } %>
</li>
<% end %>
</ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<td class='align-center'>
<%= form_for [:admin, return_item] do |f| %>
<%= f.hidden_field 'reception_status_event', value: 'receive' %>
<%= f.button Spree.t('actions.receive'), class: 'fa icon_link no-text with-tip', "data-action" => 'save' %>
<%= f.button Spree.t('actions.receive'), class: 'with-tip', "data-action" => 'save' %>
<% end %>
</td>
<% end %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<% if @customer_return.completely_decided? %>
<%= form_for [:admin, @order, Spree::Reimbursement.new] do |f| %>
<%= hidden_field_tag :build_from_customer_return_id, @customer_return.id %>
<%= f.button class: 'button fa fa-reply' do %>
<%= f.button class: 'button' do %>
<%= Spree.t(:create_reimbursement) %>
<% end %>
<% end %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<% content_for :page_actions do %>
<% if can? :create, Spree::CustomerReturn %>
<li>
<%= button_link_to Spree.t(:new_customer_return), spree.new_admin_order_customer_return_path(@order), icon: 'plus' %>
<%= button_link_to Spree.t(:new_customer_return), spree.new_admin_order_customer_return_path(@order) %>
</li>
<% end %>
<% end %>
Expand Down
4 changes: 2 additions & 2 deletions backend/app/views/spree/admin/customer_returns/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
</div>

<div class="form-buttons filter-actions actions" data-hook="buttons">
<%= button Spree.t('actions.create'), 'ok' %>
<%= button_link_to Spree.t('actions.cancel'), admin_order_customer_returns_url(@order), :icon => 'remove' %>
<%= button Spree.t('actions.create') %>
<%= button_link_to Spree.t('actions.cancel'), admin_order_customer_returns_url(@order) %>
</div>
</fieldset>
<% end %>
Expand Down
4 changes: 2 additions & 2 deletions backend/app/views/spree/admin/general_settings/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@

<% if can? :update, :general_settings %>
<div class="form-buttons filter-actions actions" data-hook="buttons">
<%= button Spree.t('actions.update'), 'refresh' %>
<%= link_to_with_icon 'remove', Spree.t('actions.cancel'), edit_admin_general_settings_url, :class => 'button' %>
<%= button Spree.t('actions.update') %>
<%= link_to Spree.t('actions.cancel'), edit_admin_general_settings_url, :class => 'button' %>
</div>
<% end %>

Expand Down
4 changes: 2 additions & 2 deletions backend/app/views/spree/admin/images/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


<% content_for :page_actions do %>
<li><%= button_link_to Spree.t(:back_to_images_list), admin_product_images_url(@product), :icon => 'arrow-left' %></li>
<li><%= button_link_to Spree.t(:back_to_images_list), admin_product_images_url(@product) %></li>
<% end %>

<%= form_for [:admin, @product, @image], :html => { :multipart => true } do |f| %>
Expand All @@ -22,7 +22,7 @@
</div>
<div class="clear"></div>
<div class="form-buttons filter-actions actions" data-hook="buttons">
<%= button Spree.t('actions.update'), 'refresh' %>
<%= button Spree.t('actions.update') %>
<%= link_to Spree.t('actions.cancel'), admin_product_images_url(@product), :id => 'cancel_link', :class => 'button remove' %>
</div>
</fieldset>
Expand Down
6 changes: 3 additions & 3 deletions backend/app/views/spree/admin/images/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
<legend align="center"><%= Spree.t(:new_image) %></legend>

<%= render :partial => 'form', :locals => { :f => f } %>

<div class="form-buttons filter-actions actions" data-hook="buttons">
<%= button Spree.t('actions.update'), 'refresh' %>
<%= link_to_with_icon 'remove', Spree.t('actions.cancel'), admin_product_images_url(@product), :id => 'cancel_link', :class => 'button' %>
<%= button Spree.t('actions.update') %>
<%= link_to Spree.t('actions.cancel'), admin_product_images_url(@product), :id => 'cancel_link', :class => 'button' %>
</div>
</fieldset>
<% end %>
4 changes: 2 additions & 2 deletions backend/app/views/spree/admin/log_entries/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<% admin_breadcrumb(plural_resource_name(Spree::LogEntry)) %>

<% content_for :page_actions do %>
<li><%= button_link_to Spree.t(:logs), spree.admin_order_payment_log_entries_url(@order, @payment), :icon => 'archive' %></li>
<li><%= button_link_to Spree.t(:back_to_payment), spree.admin_order_payment_url(@order, @payment), :icon => 'arrow-left' %></li>
<li><%= button_link_to Spree.t(:logs), spree.admin_order_payment_log_entries_url(@order, @payment) %></li>
<li><%= button_link_to Spree.t(:back_to_payment), spree.admin_order_payment_url(@order, @payment) %></li>
<% end %>

<table class='index' id='listing_log_entries'>
Expand Down
2 changes: 1 addition & 1 deletion backend/app/views/spree/admin/option_types/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<% content_for :page_actions do %>
<li>
<span id="new_add_option_value" data-hook>
<%= link_to_add_fields Spree.t(:add_option_value), "tbody#option_values", :class => 'button fa fa-plus' %>
<%= link_to_add_fields Spree.t(:add_option_value), "tbody#option_values", :class => 'button' %>
</span>
</li>
<% end %>
Expand Down
2 changes: 1 addition & 1 deletion backend/app/views/spree/admin/option_types/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<% content_for :page_actions do %>
<% if can?(:create, Spree::OptionType) %>
<li id="new_ot_link">
<%= button_link_to Spree.t(:new_option_type), new_admin_option_type_url, { :remote => true, :icon => 'plus', :id => 'new_option_type_link' } %>
<%= button_link_to Spree.t(:new_option_type), new_admin_option_type_url, { :remote => true, :id => 'new_option_type_link' } %>
</li>
<% end %>
<% end %>
Expand Down
2 changes: 1 addition & 1 deletion backend/app/views/spree/admin/orders/cart.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<li><%= event_links %></li>
<% end %>
<% if can?(:resend, @order) && @order.completed? %>
<li><%= button_link_to Spree.t(:resend), resend_admin_order_url(@order), :method => :post, :icon => 'email' %></li>
<li><%= button_link_to Spree.t(:resend), resend_admin_order_url(@order), :method => :post %></li>
<% end %>
<% end %>

Expand Down
2 changes: 1 addition & 1 deletion backend/app/views/spree/admin/orders/confirm.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<%= render partial: 'spree/admin/orders/confirm/payments', locals: {payments: @order.payments} %>

<div class="form-buttons filter-actions actions" data-hook="complete-order-button">
<%= button_to [:complete, :admin, @order], {class: 'button fa fa-rocket', method: 'put'} do %>
<%= button_to [:complete, :admin, @order], { class: 'button', method: 'put' } do %>
<%= Spree.t(:complete_order) %>
<% end %>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<div class="form-buttons filter-actions actions" data-hook="complete-order-button">
<div><%= Spree.t(:order_please_refresh) %></div><br/>
<%= button_to [:advance, :admin, @order], {class: 'button fa fa-refresh', method: 'put'} do %>
<%= button_to [:advance, :admin, @order], { class: 'button', method: 'put' } do %>
<%= Spree.t(:order_refresh_totals) %>
<% end %>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,6 @@
<div class="clear"></div>

<div class="form-buttons filter-actions actions" data-hook="buttons">
<%= button Spree.t('actions.update'), 'refresh' %>
<%= button Spree.t('actions.update') %>
</div>
</fieldset>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


<% content_for :page_actions do %>
<li><%= button_link_to Spree.t(:back_to_orders_list), admin_orders_path, :icon => 'arrow-left' %></li>
<li><%= button_link_to Spree.t(:back_to_orders_list), admin_orders_path %></li>
<% end %>


Expand Down
2 changes: 1 addition & 1 deletion backend/app/views/spree/admin/orders/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<li><%= event_links %></li>
<% end %>
<% if can?(:resend, @order) && @order.completed? %>
<li><%= button_link_to Spree.t(:resend), resend_admin_order_url(@order), method: :post, icon: 'email' %></li>
<li><%= button_link_to Spree.t(:resend), resend_admin_order_url(@order), method: :post %></li>
<% end %>
<% end %>

Expand Down
4 changes: 2 additions & 2 deletions backend/app/views/spree/admin/orders/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<% content_for :page_actions do %>
<li>
<%= button_link_to Spree.t(:new_order), new_admin_order_url, :icon => 'plus', :id => 'admin_new_order' %>
<%= button_link_to Spree.t(:new_order), new_admin_order_url, :id => 'admin_new_order' %>
</li>
<% end if can? :edit, Spree::Order.new %>

Expand Down Expand Up @@ -95,7 +95,7 @@

<div class="actions filter-actions">
<div data-hook="admin_orders_index_search_buttons">
<%= button Spree.t(:filter_results), 'search' %>
<%= button Spree.t(:filter_results) %>
</div>
</div>
<% end %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<fieldset class="no-border-top">
<%= render :partial => 'form', :locals => { :f => f } %>
<div data-hook="buttons" class="filter-actions actions">
<%= button Spree.t('actions.update'), 'refresh' %>
<%= button Spree.t('actions.update') %>
</div>
</fieldset>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<% content_for :page_actions do %>
<% if can?(:create, Spree::PaymentMethod) %>
<li>
<%= button_link_to Spree.t(:new_payment_method), new_object_url, :icon => 'plus', :id => 'admin_new_payment_methods_link' %>
<%= button_link_to Spree.t(:new_payment_method), new_object_url, :id => 'admin_new_payment_methods_link' %>
</li>
<% end %>
<% end %>
Expand Down
2 changes: 1 addition & 1 deletion backend/app/views/spree/admin/payment_methods/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<fieldset class="no-border-top">
<%= render :partial => 'form', :locals => { :f => f } %>
<div data-hook="buttons" class="filter-actions actions">
<%= button Spree.t('actions.create'), 'ok' %>
<%= button Spree.t('actions.create') %>
</div>
</fieldset>
<% end %>
2 changes: 1 addition & 1 deletion backend/app/views/spree/admin/payments/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<% content_for :page_actions do %>
<% if @order.outstanding_balance? %>
<li id="new_payment_section">
<%= button_link_to Spree.t(:new_payment), new_admin_order_payment_url(@order), :icon => 'plus' %>
<%= button_link_to Spree.t(:new_payment), new_admin_order_payment_url(@order) %>
</li>
<% end %>
<% end %>
Expand Down
2 changes: 1 addition & 1 deletion backend/app/views/spree/admin/payments/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<%= render :partial => 'form', :locals => { :f => f } %>

<div class="filter-actions actions" data-hook="buttons">
<%= button @order.cart? ? Spree.t('actions.continue') : Spree.t('actions.update'), @order.cart? ? 'arrow-right' : 'refresh' %>
<%= button @order.cart? ? Spree.t('actions.continue') : Spree.t('actions.update') %>
</div>
</fieldset>
<% end %>
Expand Down
2 changes: 1 addition & 1 deletion backend/app/views/spree/admin/payments/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


<% content_for :page_actions do %>
<li><%= button_link_to Spree.t(:logs), spree.admin_order_payment_log_entries_url(@order, @payment), :icon => 'archive' %></li>
<li><%= button_link_to Spree.t(:logs), spree.admin_order_payment_log_entries_url(@order, @payment) %></li>
<% end %>

<%= render :partial => "spree/admin/payments/source_views/#{@payment.payment_method.method_type}", :locals => { :payment => @payment.source.is_a?(Spree::Payment) ? @payment.source : @payment } %>
Expand Down
4 changes: 2 additions & 2 deletions backend/app/views/spree/admin/prices/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<% content_for :page_actions do %>
<li id="new_price_link">
<%= button_link_to t(".new_price"), new_object_url, { :remote => true, :icon => 'plus', :id => 'admin_new_product' } %>
<%= button_link_to t(".new_price"), new_object_url, { :remote => true, :id => 'admin_new_product' } %>
</li>
<% end if can?(:create, Spree::Product) %>

Expand Down Expand Up @@ -62,7 +62,7 @@

<div class="actions filter-actions">
<div data-hook="admin_orders_index_search_buttons">
<%= button Spree.t(:filter_results), 'search' %>
<%= button Spree.t(:filter_results) %>
</div>
</div>

Expand Down
2 changes: 1 addition & 1 deletion backend/app/views/spree/admin/products/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<% content_for :page_actions do %>
<% if can?(:create, Spree::Product) %>
<li id="new_product_link">
<%= button_link_to Spree.t(:new_product), new_object_url, { :icon => 'plus', :id => 'admin_new_product' } %>
<%= button_link_to Spree.t(:new_product), new_object_url, { :id => 'admin_new_product' } %>
</li>
<% end %>
<% end %>
Expand Down
Loading