app/views/trade/admin/payment_methods/unverified.html.erb in rails_trade-0.0.2 vs app/views/trade/admin/payment_methods/unverified.html.erb in rails_trade-0.0.3
- old
+ new
@@ -1,58 +1,5 @@
-<%= render layout: 'index_layout' do %>
- <table class="ui bottom attached selectable table">
- <thead>
- <tr>
- <th><%= PaymentMethod.human_attribute_name(:account_name) %></th>
- <th><%= PaymentMethod.human_attribute_name(:account_num) %></th>
- <th><%= PaymentMethod.human_attribute_name(:bank) %></th>
- <th><%= PaymentMethod.human_attribute_name(:payment_references) %></th>
- <th><%= PaymentMethod.human_attribute_name(:verified) %></th>
- <th>Actions</th>
- </tr>
- </thead>
- <tbody>
- <% @payment_methods.each do |payment_method| %>
- <tr>
- <td><%= payment_method.account_name %></td>
- <td><%= payment_method.account_num %></td>
- <td><%= payment_method.bank %></td>
- <td>
- <% payment_method.payment_references.each do |reference| %>
- <p><%= reference.buyer.name %></p>
- <% end %>
- </td>
- <td>
- <%= form_with model: payment_method, scope: 'payment_method', url: admin_payment_method_path(payment_method), method: :patch do |f| %>
- <div class="ui toggle checkbox">
- <label></label>
- <%= f.check_box :verified, onChange: 'this.form.submit()', label: false, on: { wrap_all: false, wrap_checkbox: false, offset: false } %>
- </div>
- <% end %>
- </td>
- <td>
- <%= link_to t('.edit'), edit_admin_payment_method_path(payment_method), class: 'ui mini blue button' %>
- <%= link_to t('.destroy'), admin_payment_method_path(payment_method), class: 'ui mini red button', method: :delete, data: { confirm: t('.confirm') } %>
- </td>
- </tr>
- <% payment_method.repeat_results.each do |result| %>
- <tr class="warning">
- <td><%= result.id %></td>
- <td><%= result.account_name %></td>
- <td><%= result.account_num %></td>
- <td><%= result.bank %></td>
- <td>
- <% result.payment_references.each do |reference| %>
- <p><%= reference.buyer.name %></p>
- <% end %>
- </td>
- <td></td>
- <td>
- <%= link_to '并入此账户', merge_from_admin_payment_method_path(result, other_id: payment_method.id), method: :patch %>
- </td>
- </tr>
- <% end %>
- <% end %>
- </tbody>
- </table>
-
+<%= render layout: 'index_table', locals: { cache_key: Trade::PaymentMethod.column_names.hash } do %>
+ <%= render partial: 'index_tbody', layout: 'index_tr', collection: @payment_methods, as: :model %>
<% end %>
+
+<%= paginate @payment_methods %>