<% if action.is_a?(Actions::TracksCreator) %>
<%= render "shared/memberships/photo", membership: action.created_by, size: 7 %>
<% end %>
<%= action.label_string %>
<% if action.is_a?(Actions::RequiresApproval) %> <% if 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"), [:account, action], class: 'button-secondary button-smaller' %> <% end %> <% if can? :edit, action %> <%= link_to t("#{action.class.name.pluralize.underscore}.buttons.shorthand.edit"), [:edit, :account, action], class: 'button-secondary button-smaller' %> <% end unless action.started_at # TODO This is the wrong way to do this, we need to do this in `roles.yml` when we can. %> <% if can? :destroy, action %> <%= button_to t("#{action.class.name.pluralize.underscore}.buttons.shorthand.destroy"), [:account, 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) %>
Processed <%= action.performed_count %> of <%= action.target_count %> <%= display_date_and_time(action.completed_at) %>
<% else %>
Processed <%= display_date_and_time(action.completed_at) %>
<% end %> <% elsif action.is_a?(Actions::RequiresApproval) && !action.approved? %>
Awaiting approval
<% elsif action.is_a?(Actions::SupportsScheduling) && action.scheduled_for && !action.started? %>
Scheduled for <%= display_date_and_time(action.scheduled_for) %>
<% elsif action.is_a?(Actions::HasProgress) && action.started? %>
Processing <%= action.performed_count %> of <%= action.target_count %>
<% elsif action.is_a?(Actions::HasProgress) %>
Preparing to process <%= action.performed_count %> of <%= action.target_count %>
<% else %>
Preparing to process
<% end %>