view plugins/redmine_checkout/app/views/settings/_checkout_scm.html.erb @ 1519:afce8026aaeb redmine-2.4-integration

Merge from branch "live"
author Chris Cannam
date Tue, 09 Sep 2014 09:34:53 +0100
parents b4b72f1eb644
children
line wrap: on
line source
<div>
  <p><%= setting_check_box "checkout_overwrite_description_#{scm}", :label => :setting_checkout_overwrite_description, :onclick => <<-EOF
    Effect.toggle($('settings_checkout_description_#{scm}').up("div").up("div"), 'slide', {duration:0.2});
  EOF
  %></p>
  
  <div>
    <p><%= setting_text_area "checkout_description_#{scm}", :cols => 60, :rows => 5, :class => 'wiki-edit', :label => :field_description %></p>
    <%= wikitoolbar_for "settings_checkout_description_#{scm}" %>
  </div>
  
  <% if scm == 'Subversion' %>
  <p><%= setting_select "checkout_display_login",[
            [l(:label_display_login_username), 'username'],
            [l(:label_display_login_password), 'password']
          ],
          :blank => :label_display_login_none %></p>
  <% end %>
  
  <p><%= setting_check_box "checkout_display_command_#{scm}", :label => :field_checkout_display_command %></p>

  <% javascript_tag do %>
    <% repo = "Repository::#{scm}".constantize %>
    var subform = new Subform('<%= escape_javascript(render(:partial => "checkout_protocol", :locals => {:protocol => Checkout::Protocol.new({:protocol => repo.scm_name, :append_path => (repo.allow_subtree_checkout? ? '1' : '0'), :command => repo.checkout_default_command}), :scm => scm})) %>',<%= Setting.send("checkout_protocols_#{scm}").length %>,'settings_checkout_protocols_<%= scm %>');
    protocolForms.set('<%= scm %>', subform);
  <% end %>
  <p><label><%=l :label_protocol_plural %></label><%=l :help_checkout_protocols %></p>
  <table class="list checkout_protocol_table">
    <thead><tr>
      <th class="protocol_protocol"         ><%= l(:setting_protocol)%></th>
      <th class="protocol_command"          ><%= l(:setting_checkout_command)%></th>
      <th class="protocol_regex"            ><%= l(:setting_checkout_url_regex) %></th>
      <th class="protocol_regex_replacement"><%= l(:setting_checkout_url_regex_replacement) %></th>
      <th class="protocol_access"           ><%= l(:label_permissions) %></th>
      <th class="protocol_append_path"      ><%= l(:label_append_path) %></th>
      <th class="protocol_is_default"       ><%= l(:label_default) %></th>
      <th class="protocol_delete"           ></th>
    </tr></thead>
    <tbody id="settings_checkout_protocols_<%= scm %>">
      <% Setting.send("checkout_protocols_#{scm}").each_with_index do |protocol, index| %>
        <%= render :partial => 'checkout_protocol', :locals => {:protocol => Checkout::Protocol.new(protocol), :scm => scm, :index => index, :classes => cycle('odd', 'even')} %>
      <% end %>
    </tbody>
  </table>
  <div style="text-align: right"><%= link_to_function l(:button_add_protocol), "protocolForms.get('#{scm}').add()", {:class => "icon icon-add"} %></div>
</div>