<%= bootstrap_form_for(@new, url: copy_to_repository_protocol_path(@protocol, format: :json), remote: true, data: { role: "copy-to-repository" }) do |f| %>
  <%= f.text_field :name, label: t("my_modules.protocols.copy_to_repository_modal.name_label"), placeholder: t("my_modules.protocols.copy_to_repository_modal.name_placeholder") %>

  <div class="form-group">
    <label for="protocol_protocol_type"><%= t("my_modules.protocols.copy_to_repository_modal.type_label") %></label><br>
    <div class="btn-group" data-toggle="buttons">
      <label class="btn btn-toggle active">
        <input type="radio" value="in_repository_public" name="protocol[protocol_type]" id="protocol_protocol_type_in_repository_public" checked="checked">
        <%= t("my_modules.protocols.copy_to_repository_modal.type_public") %>
      </label>
      <label class="btn btn-toggle">
        <input type="radio" value="in_repository_private" name="protocol[protocol_type]" id="protocol_protocol_type_in_repository_private">
        <%= t("my_modules.protocols.copy_to_repository_modal.type_private") %>
      </label>
    </div>
  </div>

  <em><%= t("my_modules.protocols.copy_to_repository_modal.type_text") %></em>

  <% if can_manage_protocol_in_module?(@protocol) && can_create_protocols_in_repository?(@protocol.team) %>
    <div class="checkbox">
      <label>
        <input type="checkbox" name="link" id ="link" data-role="link-check"> <%= t("my_modules.protocols.copy_to_repository_modal.link_label") %>
      </label>
    </div>

    <% if @protocol.linked? %>
      <div class="alert alert-warning" role="alert" data-role="link-text" style="display: none;">
        <%= t("my_modules.protocols.copy_to_repository_modal.link_text").html_safe %>
      </div>
    <% end %>
  <% end %>

<% end %>
