.container-fluid.summary-documents-page .row .col-md-3 = render partial: "respondent_categories/sidebar" .col-md-9 = render_breadcrumbs([ \ { name: 'Home', path: projects_path }, \ { name: @project.title, path: project_path(@project) }, \ { name: @respondent_category.name, path: [@project, @respondent_category] }, \ { name: "Summary Documents", path: project_respondent_category_summary_documents_path(@project, @respondent_category) }, \ { name: @summary_document.name } \ ]) .doc-header .d-flex.align-items-start.gap-3 .doc-header-icon i.bi.bi-file-earmark-text div .doc-header-title = @summary_document.name .doc-header-meta - if @summary_document.last_edited_by | Edited by #{@summary_document.last_edited_by.name} ยท #{time_ago_in_words(@summary_document.updated_at)} ago - else | Not yet edited .d-flex.gap-2 = link_to project_respondent_category_summary_documents_path(@project, @respondent_category), class: "btn-pill btn-pill-light" do i.bi.bi-arrow-left | Back = link_to export_project_respondent_category_summary_document_path(@project, @respondent_category, @summary_document), class: "btn-pill btn-pill-light" do i.bi.bi-download | Export = link_to edit_project_respondent_category_summary_document_path(@project, @respondent_category, @summary_document), class: "btn-pill btn-pill-primary" do i.bi.bi-pencil | Edit - if @summary_document.locked? .doc-banner.doc-banner-warning span.d-flex.align-items-center.justify-content-between.w-100 div i.bi.bi-lock-fill.me-2 | #{@summary_document.locked_by.name} is currently editing this document. - if @summary_document.locked_by_other?(current_user) = button_to "Take over", takeover_project_respondent_category_summary_document_path(@project, @respondent_category, @summary_document), method: :post, class: "btn-pill btn-pill-warning", form: { data: { turbo_confirm: "#{@summary_document.locked_by.name} is currently editing this document. Taking over will discard any unsaved changes they have. Continue?" } } .doc-viewer-card - if @summary_document.content_html.present? .doc-viewer-content == sanitize(@summary_document.content_html, tags: Rails::HTML5::SafeListSanitizer.allowed_tags + ["u", "s"], attributes: Rails::HTML5::SafeListSanitizer.allowed_attributes + ["style"]) - else .doc-empty-inline i.bi.bi-file-earmark-text.fs-1 p.mt-2.mb-0 This document is empty.