<%= t('headings.sections', "Reports") %>

<% @available_reports.sort_by {|_, details| details.title}.each do |report, details| title = details.title description_partial = details[:description_partial] description_partial = report + '_description' if description_partial == true parameters_partial = details[:parameters_partial] parameters_partial = report + '_parameters' if parameters_partial == true last_complete = @last_complete_reports[report] last_report = @last_reports[report] in_progress = last_report && last_report.in_progress? #the extra text is added so that you can give more than the date for the last run report extra_text = last_complete.try(:parameters).try(:[], "extra_text") %> <% end %>
<%= t 'headers.report_name', 'Name' %> <%= t 'headers.report_last_run', 'Last Run' %> <%= t 'Run Report' %>
<%= title %> <% if description_partial %>
" style="display: none" class="report_description"> <%= render(partial: description_partial, locals: { report: report, report_details: details, }) %>
<% end %>
<% if last_complete %> <%= datetime_string(last_complete.created_at) %> <%#the extra text is added so that you can give more than the date for the last run report %> <% if extra_text %> (<%= extra_text %>) <% end %> <% if last_complete.workflow_state == 'complete' %> <%= link_to "".html_safe, context_url(last_complete.account, :context_file_download_url, last_complete.attachment.id, download_frd: 1), 'aria-label' => t('Download Report'), 'title' => t('Download Report') %> <% end %> <% else %> <%= t 'report_last_run_never', 'Never' %> <% end %> <% if parameters_partial %>
<%= render(partial: parameters_partial, locals: { report: report, report_details: details, }) %>

<%= t('report_running', 'The report is running.*You\'ll receive an email when it is done.*', :wrapper => '
\1
') %>
<% else %>
<%= t('report_running', 'The report is running.*You\'ll receive an email when it is done.*', :wrapper => '
\1
') %>
<% end %>