Sha256: a8e4136ea9edd05b9e305b77d0aa5c5c004dc4a3eeec9a17728518cbc08266c0

Contents?: true

Size: 1.97 KB

Versions: 3

Compression:

Stored size: 1.97 KB

Contents

<% content_for :page_title do %>
  <%= Spree.t(:"admin.user.stores") %>
<% end %>

<% content_for :page_actions do %>
  <%= button_link_to Spree.t(:add_store), spree.new_admin_store_path(@user), class: "btn-success", icon: 'add.svg' if can?(:create, Spree::Store) %>
<% end %>

<% if @stores.any? %>
<div class="table-responsive">
  <table class="table">
    <thead>
      <th><%= Spree.t(:name) %></th>
      <th><%= Spree.t(:url) %></th>
      <th><%= Spree.t(:currency) %></th>
      <th><%= Spree.t(:default) %>?</th>
      <th data-hook="admin_stores_index_header_actions" class="actions"></th>
    <thead>
    <tbody>
      <% @stores.each do |store| %>
        <tr>
          <td><%= store.unique_name %></td>
          <td><%= link_to store.url, store.formatted_url, target: :blank %></td>
          <td><%= store.default_currency %></td>
          <td><%= active_badge(store.default) %></td>
          <td class="actions actions-2 text-right" data-hook="admin_stores_index_row_actions">
            <%= link_to_edit_url spree.edit_admin_store_path(store), no_text: true if can?(:edit, store) %>

            <% if can?(:edit, store) %>
              <% btn_url = store.default? ? '#' : spree.set_default_admin_store_path(store) %>
              <% btn_class = store.default? ? 'outline-secondary disabled' : 'warning' %>
              <% btn_label = store.default? ? nil : Spree.t(:store_set_default_button) %>
              <%= link_to_with_icon('save.svg', btn_label, btn_url, no_text: true, method: (store.default? ? nil : :put), class: "btn btn-#{btn_class} btn-sm with-tip", aria: {disabled: store.default?}) %>
            <% end %>

            <%= link_to_delete store, no_text: true, url: spree.admin_store_path(store) if can?(:destroy, store) %>
          </td>
        </tr>
      <% end %>
    </tbody>
  </table>
</div>
<% else %>
  <div class="alert alert-info no-objects-found">
    <%= Spree.t(:no_resource_found, resource: plural_resource_name(Spree::StoreCredit)) %>
  </div>
<% end %>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
spree_backend-4.2.0.rc5 app/views/spree/admin/stores/index.html.erb
spree_backend-4.2.0.rc4 app/views/spree/admin/stores/index.html.erb
spree_backend-4.2.0.rc3 app/views/spree/admin/stores/index.html.erb