<div class="repository-info">
  <% if repository.checkout_description.present? %>
  <div class="wiki<%= ' bottomline' if protocols.present? %>"><%= textilizable repository.checkout_description %></div>
  <% end %>
  <% if protocols.present? %>
  <div id="checkout_box">
    <ul id="checkout_protocols">
    <% protocols.each do |p| -%>
      <li>
        <a <%= 'class="selected"' if p == default_protocol %> id="checkout_protocol_<%= p.protocol.to_s.underscore %>" data-permission="<%= p.access_rw(User.current) %>" href="<%= URI.escape p.url(checkout_path) %>"><%=h p.protocol %></a>
      </li>
    <% end -%>
    </ul>
    <%= text_field_tag :checkout_url, h(default_protocol.full_command(checkout_path)), :readonly => true %>
    <%- if Setting.checkout_use_zero_clipboard? %>
    <div id="clipboard_container" title="<%= l(:label_copy_to_clipboard) %>" style="display: none;">
       <div id="clipboard_button"><%= image_tag 'paste.png', :plugin => 'redmine_checkout' %></div>
    </div>
    <% end -%>
    <% if default_protocol %><p><%=l :label_access_type, :type => l(default_protocol.access_label(User.current)) %></p><% end %>
  
    <% javascript_tag do %>
      var checkout_access   = $H({<%= protocols.inject([]){|r,p| r << "'checkout_protocol_#{p.protocol.to_s.underscore}': '#{l(p.access_label(User.current))}'"}.join(', ') %>});
      var checkout_commands = $H({<%= protocols.inject([]){|r,p| r << "'checkout_protocol_#{p.protocol.to_s.underscore}': '#{escape_javascript(p.full_command(checkout_path))}'"}.join(', ') %>});
      <%- if Setting.checkout_use_zero_clipboard? %>ZeroClipboard.setMoviePath( '<%= image_path('ZeroClipboard.swf', :plugin => 'redmine_checkout') %>' );<% end %>
    <% end %>
  </div>
  <% end%>
</div>
<div style="clear: left"></div>

<% content_for :header_tags do %>
  <%= stylesheet_link_tag 'checkout', :plugin => 'redmine_checkout' %>
  <%= javascript_include_tag 'checkout', :plugin => 'redmine_checkout' %>
  <%= (javascript_include_tag 'ZeroClipboard', :plugin => 'redmine_checkout') if Setting.checkout_use_zero_clipboard? %>
<% end %>