<div class="modal" id="newProtocolModal" tabindex="-1" role="dialog">
  <%= form_with model: @protocol || Protocol.new,
                url: type == 'new' ? protocols_path : copy_to_repository_protocol_path(@protocol),
                method: :post,
                html: { data: { action: type, remote: true } }  do |f| %>
    <div class="modal-dialog" role="document">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" aria-label="<%= t('general.close') %>"><i class="sn-icon sn-icon-close"></i></button>
          <h4 class="modal-title">
            <%= t("protocols.new_protocol_modal.title_#{type}") %>
          </h4>
        </div>
        <div class="modal-body">
          <div class="sci-input-container">
            <%= f.label :name, t("protocols.new_protocol_modal.name_label") %>
            <%= f.text_field :name, placeholder: t("protocols.new_protocol_modal.name_placeholder"), class: 'sci-input-field' %>
          </div>
          <% if type == 'copy' %>
          <p class="description">
            <%= t("protocols.new_protocol_modal.description") %>
          </p>
          <% end %>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-secondary" data-dismiss="modal"><%= t('general.cancel') %></button>
          <%= f.submit t("protocols.new_protocol_modal.create_#{type}") , class: "btn btn-primary create-protocol-button", disabled: true %>
        </div>
      </div>
    </div>
  <% end %>
</div>
