Merge pull request #4075 from HugsDaniel/defacepocalypse-payment-methods

[Defacepocalypse] De-deface payment methods index
This commit is contained in:
Luis Ramos
2019-07-31 15:49:48 +01:00
committed by GitHub
5 changed files with 43 additions and 20 deletions

View File

@@ -1,6 +0,0 @@
/ insert_after "[data-hook='admin_payment_methods_index_rows'] td:first-child"
%td.align-center
- method.distributors.each do |distributor|
= distributor.name
%br/

View File

@@ -1,4 +0,0 @@
/ insert_after "[data-hook='admin_payment_methods_index_headers'] th:first-child"
%th
= t(:products_distributor)

View File

@@ -1,9 +0,0 @@
/ replace_contents "table#listing_payment_methods colgroup"
%col{style: "width: 13%"}
%col{style: "width: 14%"}
%col{style: "width: 32%"}
%col{style: "width: 14%"}
%col{style: "width: 8%"}
%col{style: "width: 8%"}
%col{style: "width: 11%"}

View File

@@ -1 +0,0 @@
remove "erb[loud]:contains(\"render :partial => 'spree/admin/shared/configuration_menu'\")"

View File

@@ -0,0 +1,43 @@
- content_for :page_title do
= Spree.t(:payment_methods)
- content_for :page_actions do
%li
= button_link_to Spree.t(:new_payment_method), new_object_url, icon: 'icon-plus', id: 'admin_new_payment_methods_link'
- if @payment_methods.any?
%table#listing_payment_methods.index
%colgroup
%col{style: "width: 13%"}
%col{style: "width: 14%"}
%col{style: "width: 32%"}
%col{style: "width: 14%"}
%col{style: "width: 8%"}
%col{style: "width: 8%"}
%col{style: "width: 11%"}
%thead
%tr
%th= Spree.t(:name)
%th= t(:products_distributor)
%th= Spree.t(:provider)
%th= Spree.t(:environment)
%th= Spree.t(:display)
%th= Spree.t(:active)
%th.actions
%tbody
- @payment_methods.each do |method|
%tr{class: "#{cycle('odd', 'even')}", id: "#{spree_dom_id method}"}
%td.align-center= method.name
%td.align-center
- method.distributors.each do |distributor|
= distributor.name
%br/
%td= method.type
%td.align-center= method.environment.to_s.titleize
%td.align-center= method.display_on.blank? ? Spree.t(:both) : Spree.t(method.display_on)
%td.align-center= method.active ? Spree.t(:say_yes) : Spree.t(:say_no)
%td.actions
= link_to_edit method, no_text: true
= link_to_delete method, no_text: true
- else
.alpha.twelve.columns.no-objects-found= Spree.t(:no_payment_methods_found)