forked from solidusio/solidus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html.erb
62 lines (59 loc) · 2.61 KB
/
index.html.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<%= render 'spree/admin/shared/payments_tabs' %>
<% content_for :page_title do %>
<%= plural_resource_name(Spree::PaymentMethod) %>
<% end %>
<% 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' %>
</li>
<% end %>
<% end %>
<% if @payment_methods.any? %>
<table class="index sortable" id="listing_payment_methods" data-hook data-sortable-link="<%= update_positions_admin_payment_methods_url %>">
<colgroup>
<col style="width: 10%">
<col style="width: 13%">
<col style="width: 33%">
<col style="width: 13%">
<col style="width: 19%">
<col style="width: 19%">
<col style="width: 13%">
</colgroup>
<thead>
<tr data-hook="admin_payment_methods_index_headers">
<th></th>
<th><%= Spree::PaymentMethod.human_attribute_name(:name) %></th>
<th><%= Spree::PaymentMethod.human_attribute_name(:type) %></th>
<th><%= Spree::PaymentMethod.human_attribute_name(:display_on) %></th>
<th><%= Spree::PaymentMethod.human_attribute_name(:active) %></th>
<th data-hook="admin_payment_methods_index_header_actions" class="actions"></th>
</tr>
</thead>
<tbody>
<% @payment_methods.each do |method|%>
<tr id="<%= spree_dom_id method %>" data-hook="admin_payment_methods_index_rows" class="<%= cycle('odd', 'even')%>">
<td class="no-border"><span class="handle"></span></td>
<td class="align-center"><%= method.name %></td>
<td class="align-center"><%= method.type %></td>
<td class="align-center"><%= method.display_on.blank? ? Spree.t(:both) : Spree.t(method.display_on) %></td>
<td class="align-center"><%= method.active ? Spree.t(:say_yes) : Spree.t(:say_no) %></td>
<td data-hook="admin_payment_methods_index_row_actions" class="actions">
<% if can?(:update, method.becomes(Spree::PaymentMethod)) %>
<%= link_to_edit method.becomes(Spree::PaymentMethod), :no_text => true %>
<% end %>
<% if can?(:destroy, method.becomes(Spree::PaymentMethod)) %>
<%= link_to_delete method.becomes(Spree::PaymentMethod), :no_text => true %>
<% end %>
</td>
</tr>
<% end %>
</tbody>
</table>
<% else %>
<div class="alpha twelve columns no-objects-found">
<%= render 'spree/admin/shared/no_objects_found',
resource: Spree::PaymentMethod,
new_resource_url: new_object_url %>
</div>
<% end %>