<% if action.is_a?(Actions::TracksCreator) %>
<%= render "shared/memberships/photo", membership: action.created_by, size: 7 %>
<% end %>
<%= action.label_string %>
<%= partial.actions if partial.actions? %> <% if action.is_a?(Actions::RequiresApproval) %> <% if !action.approved? && can?(:approve, action) %> <%= button_to t("#{action.class.name.pluralize.underscore}.buttons.shorthand.approve"), [:approve, :account, action], method: :post, class: 'button-secondary button-smaller' %> <% end %> <% end %> <% if can? :read, action %> <%= link_to t("#{action.class.name.pluralize.underscore}.buttons.shorthand.show"), build_action_model_path(action), class: 'button-secondary button-smaller' %> <% end %> <% if can?(:edit, action) && !action.started? %> <%= link_to t("#{action.class.name.pluralize.underscore}.buttons.shorthand.edit"), build_action_model_path(action, type: :edit), class: 'button-secondary button-smaller' %> <% end %> <% if can? :destroy, action %> <%= button_to t("#{action.class.name.pluralize.underscore}.buttons.shorthand.destroy"), build_action_model_path(action), method: :delete, data: { confirm: t("#{action.class.name.pluralize.underscore}.buttons.confirmations.destroy", model_locales(action)) }, class: 'button-secondary button-smaller' %> <% end %>
<% if action.completed? %> <% if action.is_a?(Actions::HasProgress) %>
<%= t('action_models.processed_of', performed_count: action.performed_count, target_count: action.target_count, at: display_date_and_time(action.completed_at)) %>
<% else %>
<%= t('action_models.processed', at: display_date_and_time(action.completed_at)) %>
<% end %> <% elsif action.is_a?(Actions::RequiresApproval) && !action.approved? %>
<%= t('action_models.awaiting') %>
<% elsif action.is_a?(Actions::SupportsScheduling) && action.scheduled_for && !action.started? %>
<%= t('action_models.scheduled_for', at: display_date_and_time(action.scheduled_for)) %>
<% elsif action.is_a?(Actions::HasProgress) && action.started? %>
<%= render "shared/attributes/progress_bar", object: action, attribute: :performed_count, total: :target_count %>
<%= t('action_models.processing_of', performed_count: action.performed_count, target_count: action.target_count) %>
<% elsif action.is_a?(Actions::HasProgress) %>
<%= t('action_models.preparing_to_process_of', performed_count: action.performed_count, target_count: action.target_count) %>
<% else %>
<%= t('action_models.preparing_to_process') %>
<% end %>