<% creative_concept = @creative_concept %> <% context ||= creative_concept %> <% collection ||= :collaborators %> <% hide_actions ||= false %> <% hide_back ||= false %> <%= render 'account/shared/box' do |p| %> <% p.content_for :title do %> <%= t(".contexts.#{context.class.name.underscore}.header") %> <% end %> <% p.content_for :description do %> <%= t(".contexts.#{context.class.name.underscore}.description") %> <% end %> <% p.content_for :table do %> <% if collaborators.any? %> <%# 🚅 super scaffolding will insert new field headers above this line. %> <% collaborators.each do |collaborator| %> <%# 🚅 super scaffolding will insert new fields above this line. %> <% end %>
<%= t('.fields.membership_id.heading') %> <%= t('.fields.role_ids.heading') %>
<%= link_to collaborator.membership.label_string, [:account, collaborator] %> <% if collaborator.roles_without_defaults.present? %> <%= collaborator.roles_without_defaults.map { |role| t("#{collaborator.class.to_s.pluralize.underscore}.fields.role_ids.options.#{role.key}.label") }.to_sentence %> <% else %> <%= t(".fields.role_ids.none") %> <% end %> <% unless hide_actions %> <% if can? :edit, collaborator %> <%= link_to t('.buttons.shorthand.edit'), [:edit, :account, collaborator], class: 'button-secondary button-smaller' %> <% end %> <% if can? :destroy, collaborator %> <%= button_to t('.buttons.shorthand.destroy'), [:account, collaborator], method: :delete, data: { confirm: t('.buttons.confirmations.destroy', model_locales(collaborator)) }, class: 'button-secondary button-smaller' %> <% end %> <% end %>
<% end %> <% end %> <% p.content_for :actions do %> <% unless hide_actions %> <% if context == creative_concept %> <% if can? :create, Scaffolding::AbsolutelyAbstract::CreativeConcepts::Collaborator.new(creative_concept: creative_concept) %> <%= link_to t('.buttons.new'), [:new, :account, creative_concept, :collaborator], class: 'button' %> <% end %> <% end %> <% unless hide_back %> <%= link_to t('global.buttons.back'), [:account, context], class: 'button-secondary' %> <% end %> <% end %> <% end %> <% end %>