<% content_for :title, "Log #{@log.id}" %> <% content_for :breadcrumbs, govuk_breadcrumbs(breadcrumbs: { "Logs" => @log.lettings? ? lettings_logs_path : sales_logs_path, content_for(:title) => "", }) %>

<%= content_for(:title) %>

<% if @log.status == "in_progress" %>

<%= get_subsections_count(@log, :completed) %> of <%= get_subsections_count(@log) %> subsections completed.

<% next_incomplete_section = get_next_incomplete_section(@log) %>

<% if next_incomplete_section.present? %> Skip to next incomplete section: <%= next_incomplete_section.label %> <% end %>

<% elsif @log.status == "not_started" %>

This log has not been started.

<% elsif @log.status == "completed" %>

<%= status_tag(@log.status) %>

<%= review_log_text(@log) %>

<% end %> <%= render "tasklist" %> <% if @log.completed? %> <% if @log.bulk_uploaded? %> <% if @log.lettings? %> <%= govuk_button_link_to "Back to uploaded logs", resume_bulk_upload_lettings_result_path(@log.bulk_upload) %> <% else %> <%= govuk_button_link_to "Back to uploaded logs", resume_bulk_upload_sales_result_path(@log.bulk_upload) %> <% end %> <% elsif @log.lettings? %> <%= govuk_button_link_to "Back to lettings logs", lettings_logs_path %> <% elsif @log.sales? %> <%= govuk_button_link_to "Back to sales logs", sales_logs_path %> <% end %> <% end %>