<% content_for :page_title do %> <%= Spree.t('admin.webhooks_subscribers.webhooks_subscribers') %> <% end %> <% content_for :page_actions do %> <%= button_link_to Spree.t('admin.webhooks_subscribers.new_webhooks_subscriber'), new_object_url, class: "btn-success", icon: 'add.svg', id: 'admin_new_webhooks_subscriber_link' %> <% end if can?(:create, Spree::Webhooks::Subscriber) %> <% if @webhooks_subscribers.any? %>
<% if defined?(Spree::Vendor) && can?(:manage, Spree::Vendor) && !current_spree_vendor %> <% end %> <% @webhooks_subscribers.each do |webhooks_subscriber| %> <% if defined?(Spree::Vendor) && can?(:manage, Spree::Vendor) && !current_spree_vendor %> <% end %> <% end %>
<%= Spree.t('admin.url') %><%= Spree.t(:vendor) %><%= Spree.t('admin.active') %> <%= Spree.t('admin.webhooks_subscribers.subscriptions') %> <%= Spree.t('admin.webhooks_subscribers.time_of_last_event') %> <%= Spree.t('admin.webhooks_subscribers.all_events') %>
<%= webhooks_subscriber.url %> <%= link_to webhooks_subscriber.vendor.name, spree.admin_vendor_path(webhooks_subscriber.vendor) if webhooks_subscriber.vendor.present? %> <%= active_badge(webhooks_subscriber.active) %> <%= webhooks_subscriber.subscriptions&.sort&.join(', ') %> <%= webhooks_subscriber.events.order(:created_at).last&.created_at %> <%= link_to Spree.t(:view), admin_webhooks_subscriber_path(webhooks_subscriber) %> <%= link_to_edit(webhooks_subscriber, no_text: true) if can? :edit, webhooks_subscriber %> <%= link_to_delete(webhooks_subscriber, no_text: true) if can? :delete, webhooks_subscriber %>
<%= render 'spree/admin/shared/index_table_options', collection: @webhooks_subscribers, simple: true %> <% else %>
<%= Spree.t(:no_resource_found, resource: plural_resource_name(Spree::Webhooks::Subscriber)) %>, <%= link_to(Spree.t(:add_one), new_object_url) if can? :create, Spree::Webhooks::Subscriber %>!
<% end %>