app/views/workgroup_outputs/show.html.slim
/ PageHeader
- breadcrumb :workgroup_output, @workgroup
- content_for :page_header_title, t('.title')
- content_for :page_header_meta do
- if @workgroup.aggregated_at
= "#{Workgroup.tmf(:aggregated_at)}: #{l(@workgroup.aggregated_at)}"
- content_for :page_header_content do
.row.mb-sm
.col-lg-12.text-right
= link_to t('.see_current_output'), referential_path(@workgroup.output.current), class: 'btn btn-primary' if @workgroup.output&.current
- if policy(@workgroup).aggregate?
= link_to t('aggregates.actions.create'), new_workgroup_aggregate_path(@workgroup), class: 'btn btn-primary'
.page_content
.container-fluid
.row
.col-lg-12
= table_builder_2 @aggregates,
[ \
TableBuilderHelper::Column.new( \
key: :status, \
attribute: Proc.new { |n| aggregate_status(n) }, \
), \
TableBuilderHelper::Column.new( \
key: :name, \
attribute: Proc.new { |n| "#{Aggregate.model_name.human} #{n.name}" },\
link_to: lambda do |aggregate| \
workgroup_aggregate_path aggregate.workgroup, aggregate \
end \
), \
TableBuilderHelper::Column.new( \
key: :started_at, \
attribute: Proc.new { |n| l(n.started_at, format: :short_with_time) if n.started_at }, \
), \
TableBuilderHelper::Column.new( \
key: :duration, \
attribute: Proc.new { |object| object.ended_at.presence && object.started_at.presence && duration_in_words(object.ended_at - object.started_at)}, \
sortable: false, \
), \
TableBuilderHelper::Column.new( \
key: :creator, \
attribute: 'creator' \
) \
],
links: [],
cls: 'table has-search',
action: :index
= new_pagination @aggregates, 'pull-right'