<% provide(:sidebar_title, t('sidebar.templates.sidebar_title')) %>
<%= content_for :sidebar do %>
  <%= render partial: "/shared/sidebar/templates_sidebar", locals: {active: :protocol} %>
<% end %>
 <% provide(:container_class, 'no-second-nav-container') %>
<div class="content-pane protocols-show flexible with-grey-background pb-4" >
  <div class="content-header sticky-header">
    <div class="title-row">
      <h1 data-e2e="e2e-TX-protocolTemplates-protocol-title">
        <% if @inline_editable_title_config.present? %>
          <%= render partial: "shared/inline_editing",
                      locals: {
                        initial_value: @protocol.name,
                        config: @inline_editable_title_config
                      } %>
        <% else %>
          <div class="name-readonly-placeholder">
            <% if @protocol.archived %>
              <span class="w-12"><%= t('labels.archived')%></span>&nbsp;
            <% end %>
            <% if @protocol.in_repository_draft? %>
              <span title="<%= t('protocols.draft_name', name: @protocol.name ) %>"><%= t('protocols.draft_name', name: @protocol.name ) %></span>
            <% else %>
              <span title="<%= @protocol.name %>"><%= @protocol.name %></span>
            <% end %>
          </div>
        <% end %>
      </h1>
    </div>
  </div>
  <div
    id="protocolContainer"
    data-protocol-url="<%= protocol_path(@protocol) %>"
    data-date-format="<%= datetime_picker_format_date_only %>"
    data-user-utc-offset="<%= ActiveSupport::TimeZone.find_tzinfo(current_user.time_zone).utc_offset %>"
    data-e2e="e2e-CO-protocolTemplates-protocol"
  >
    <protocol-container
    :protocol-url="protocolUrl"
    />
  </div>
</div>

<!-- Create new office file modal -->
<%= render partial: 'assets/wopi/create_wopi_file_modal' %>
<%= render partial: "my_modules/protocols/print_protocol_modal", locals: { protocol: @protocol, comments_enabled: true} %>


<%= javascript_include_tag "handsontable.full" %>
<%= render partial: "shared/formulas_libraries" %>
<%= javascript_include_tag 'pdf_js' %>
<%= stylesheet_link_tag 'pdf_js_styles' %>

<%= render 'shared/tiny_mce_packs' %>
<%= javascript_include_tag 'vue_protocol' %>
