<% application = @application || @application %> <% context ||= application %> <% collection ||= :access_tokens %> <% hide_actions ||= false %> <% hide_back ||= false %> <% access_tokens = access_tokens.order(:id) unless has_order?(access_tokens) %> <% pagy, access_tokens = pagy(access_tokens, page_param: :access_tokens_page) %> <%= action_model_select_controller do %> <%= updates_for context, collection do %> <%= render 'account/shared/box', pagy: pagy do |box| %> <% box.title t(".contexts.#{context.class.name.underscore}.header") %> <% box.description t(".contexts.#{context.class.name.underscore}.description") %> <% box.table do %> <% if access_tokens.any? %> <%= render "shared/tables/select_all" %> <%# 🚅 super scaffolding will insert new field headers above this line. %> <% access_tokens.each do |access_token| %> <% with_attribute_settings object: access_token do %> <%= render "shared/tables/checkbox", object: access_token %> <%# 🚅 super scaffolding will insert new fields above this line. %> <% end %> <% end %>
<%= t('.fields.token.heading') %> <%= t('.fields.description.heading') %> <%= t('.fields.last_used_at.heading') %><%= t('.fields.created_at.heading') %>
<%= render 'shared/attributes/code', attribute: :token, secret: true %> <%= render 'shared/attributes/text', attribute: :description %> <%= render 'shared/attributes/date_and_time', attribute: :last_used_at %><%= render 'shared/attributes/date_and_time', attribute: :created_at %> <% unless hide_actions %> <% if can? :edit, access_token %> <%= link_to t('.buttons.shorthand.edit'), [:edit, :account, access_token], class: 'button-secondary button-smaller' %> <% end %> <% if can? :destroy, access_token %> <%= button_to t('.buttons.shorthand.destroy'), [:account, access_token], method: :delete, data: { confirm: t('.buttons.confirmations.destroy', model_locales(access_token)) }, class: 'button-secondary button-smaller' %> <% end %> <%# 🚅 super scaffolding will insert new action model buttons above this line. %> <% end %>
<% end %> <% end %> <% box.actions do %> <% unless hide_actions %> <% if context == application %> <% if can? :create, Platform::AccessToken.new(application: application, provisioned: true) %> <%= link_to t('.buttons.new'), [:new, :account, application, :access_token], class: "#{first_button_primary(:access_token)} new" %> <% end %> <% end %> <%# 🚅 super scaffolding will insert new targets one parent action model buttons above this line. %> <%# 🚅 super scaffolding will insert new bulk action model buttons above this line. %> <%= render "shared/bulk_action_select" %> <% unless hide_back %> <%= link_to t('global.buttons.back'), [:account, context], class: "#{first_button_primary(:access_token)} back" %> <% end %> <% end %> <% end %> <% box.raw_footer do %> <%# 🚅 super scaffolding will insert new action model index views above this line. %> <% end %> <% end %> <% end %> <% end %>