Revision 918:04114f36670d vendor/plugins/redmine_checkout/app/views/settings

View differences:

vendor/plugins/redmine_checkout/app/views/settings/_checkout.erb
1
<% form_tag({:action => 'edit', :tab => 'checkout'}) do %>
2

  
3
<% javascript_tag do %>
4
protocolForms = $H();
5

  
6
document.observe("dom:loaded", function() {
7
  $('tab-content-checkout').select('fieldset.collapsed').each(function(e){
8
    e.down('div').hide();
9
  });
10
  <%
11
    CheckoutHelper.supported_scm.select{|scm| Setting.enabled_scm.include?(scm)}.each do |scm| 
12
      next if Setting.send("checkout_overwrite_description_#{scm}?")
13
  -%>
14
  $('settings_checkout_description_<%= scm %>').up('div').up('div').hide();
15
  <%- end %>
16
});
17
<% end %>
18

  
19

  
20
<div class="box tabular settings">
21
<p><%= setting_check_box :checkout_display_checkout_info %></p>
22

  
23
<p><%= setting_text_area :checkout_description_Abstract, :cols => 60, :rows => 5, :class => 'wiki-edit', :label => :field_description %></p>
24
<%= wikitoolbar_for 'settings_checkout_description_Abstract' %>
25

  
26
<p><%= setting_check_box :checkout_use_zero_clipboard %></p>
27

  
28
<% CheckoutHelper.supported_scm.select{|scm| Setting.enabled_scm.include?(scm)}.each do |scm| -%>
29
<fieldset class="collapsible collapsed">
30
  <legend onclick="toggleFieldset(this);"><%= "Repository::#{scm}".constantize.scm_name %></legend>
31
  <div><%= render :partial => 'checkout_scm', :locals => {:scm => scm} %></div>
32
</fieldset>
33
<%- end %>
34

  
35
</div>
36

  
37
<%= submit_tag l(:button_save) %>
38
<%- end %>
39

  
40
<% content_for :header_tags do %>
41
  <%= javascript_include_tag 'subform', :plugin => 'redmine_checkout' %>
42
  <%= stylesheet_link_tag 'checkout', :plugin => 'redmine_checkout' %>
43
<% end %>
vendor/plugins/redmine_checkout/app/views/settings/_checkout.html.erb
1
<% form_tag({:action => 'edit', :tab => 'checkout'}) do %>
2

  
3
<% javascript_tag do %>
4
protocolForms = $H();
5

  
6
document.observe("dom:loaded", function() {
7
  $('tab-content-checkout').select('fieldset.collapsed').each(function(e){
8
    e.down('div').hide();
9
  });
10
  <%
11
    CheckoutHelper.supported_scm.select{|scm| Setting.enabled_scm.include?(scm)}.each do |scm| 
12
      next if Setting.send("checkout_overwrite_description_#{scm}?")
13
  -%>
14
  $('settings_checkout_description_<%= scm %>').up('div').up('div').hide();
15
  <%- end %>
16
});
17
<% end %>
18

  
19

  
20
<div class="box tabular settings">
21
<p><%= setting_check_box :checkout_display_checkout_info %></p>
22

  
23
<p><%= setting_text_area :checkout_description_Abstract, :cols => 60, :rows => 5, :class => 'wiki-edit', :label => :field_description %></p>
24
<%= wikitoolbar_for 'settings_checkout_description_Abstract' %>
25

  
26
<p><%= setting_check_box :checkout_use_zero_clipboard %></p>
27

  
28
<% CheckoutHelper.supported_scm.select{|scm| Setting.enabled_scm.include?(scm)}.each do |scm| -%>
29
<fieldset class="collapsible collapsed">
30
  <legend onclick="toggleFieldset(this);"><%= "Repository::#{scm}".constantize.scm_name %></legend>
31
  <div><%= render :partial => 'checkout_scm', :locals => {:scm => scm} %></div>
32
</fieldset>
33
<%- end %>
34

  
35
</div>
36

  
37
<%= submit_tag l(:button_save) %>
38
<%- end %>
39

  
40
<% content_for :header_tags do %>
41
  <%= javascript_include_tag 'subform', :plugin => 'redmine_checkout' %>
42
  <%= stylesheet_link_tag 'checkout', :plugin => 'redmine_checkout' %>
43
<% end %>
vendor/plugins/redmine_checkout/app/views/settings/_checkout_protocol.erb
1
<%
2
  index ||= "--INDEX--"
3
  classes ||= ""
4
  
5
  protocol = Checkout::Protocol.new(protocol) unless protocol.is_a? Checkout::Protocol
6
%>
7
<tr id="<%= "checkout_protocols_#{scm}_#{index}" %>" class="<%= classes %>" <%= 'style="display:none"' if index == '--INDEX--' %>>
8
  <td class="protocol_protocol"         ><%= text_field_tag "settings[checkout_protocols_#{scm}][#{index}][protocol]", protocol.protocol, :size => 10 %></td>
9
  <td class="protocol_command"          ><%= text_field_tag "settings[checkout_protocols_#{scm}][#{index}][command]", protocol.command, :size => 15 %></td>
10
  <td class="protocol_regex"            ><%= text_field_tag "settings[checkout_protocols_#{scm}][#{index}][regex]", protocol.regex, :size => 30 %></td>
11
  <td class="protocol_regex_replacement"><%= text_field_tag "settings[checkout_protocols_#{scm}][#{index}][regex_replacement]", protocol.regex_replacement, :size => 30 %></td>
12
  <td class="protocol_access"           ><%= select_tag "settings[checkout_protocols_#{scm}][#{index}][access]", options_for_select([
13
    [l(:label_access_read_write), 'read+write'],
14
    [l(:label_access_read_only), 'read-only'],
15
    [l(:label_access_permission), 'permission']], protocol.access) %></td>
16
  <td class="protocol_append_path"><%= check_box_tag "settings[checkout_protocols_#{scm}][#{index}][append_path]", 1, protocol.append_path? %></td>
17
  <td class="protocol_is_default"><%= check_box_tag "settings[checkout_protocols_#{scm}][#{index}][is_default]", 1, protocol.default? %></td>
18
  <td class="protocol_delete"><%= image_to_function 'delete.png', "var e=$('checkout_protocols_#{scm}_#{index}');var parent=e.up(\"tbody\");e.remove();recalculate_even_odd(parent);return false" %></td>
19
</tr>
vendor/plugins/redmine_checkout/app/views/settings/_checkout_protocol.html.erb
1
<%
2
  index ||= "--INDEX--"
3
  classes ||= ""
4
  
5
  protocol = Checkout::Protocol.new(protocol) unless protocol.is_a? Checkout::Protocol
6
%>
7
<tr id="<%= "checkout_protocols_#{scm}_#{index}" %>" class="<%= classes %>" <%= 'style="display:none"' if index == '--INDEX--' %>>
8
  <td class="protocol_protocol"         ><%= text_field_tag "settings[checkout_protocols_#{scm}][#{index}][protocol]", protocol.protocol, :size => 10 %></td>
9
  <td class="protocol_command"          ><%= text_field_tag "settings[checkout_protocols_#{scm}][#{index}][command]", protocol.command, :size => 15 %></td>
10
  <td class="protocol_regex"            ><%= text_field_tag "settings[checkout_protocols_#{scm}][#{index}][regex]", protocol.regex, :size => 30 %></td>
11
  <td class="protocol_regex_replacement"><%= text_field_tag "settings[checkout_protocols_#{scm}][#{index}][regex_replacement]", protocol.regex_replacement, :size => 30 %></td>
12
  <td class="protocol_access"           ><%= select_tag "settings[checkout_protocols_#{scm}][#{index}][access]", options_for_select([
13
    [l(:label_access_read_write), 'read+write'],
14
    [l(:label_access_read_only), 'read-only'],
15
    [l(:label_access_permission), 'permission']], protocol.access) %></td>
16
  <td class="protocol_append_path"><%= check_box_tag "settings[checkout_protocols_#{scm}][#{index}][append_path]", 1, protocol.append_path? %></td>
17
  <td class="protocol_is_default"><%= check_box_tag "settings[checkout_protocols_#{scm}][#{index}][is_default]", 1, protocol.default? %></td>
18
  <td class="protocol_delete"><%= image_to_function 'delete.png', "var e=$('checkout_protocols_#{scm}_#{index}');var parent=e.up(\"tbody\");e.remove();recalculate_even_odd(parent);return false" %></td>
19
</tr>
vendor/plugins/redmine_checkout/app/views/settings/_checkout_scm.erb
1
<div>
2
  <p><%= setting_check_box "checkout_overwrite_description_#{scm}", :label => :setting_checkout_overwrite_description, :onclick => <<-EOF
3
    Effect.toggle($('settings_checkout_description_#{scm}').up("div").up("div"), 'slide', {duration:0.2});
4
  EOF
5
  %></p>
6
  
7
  <div>
8
    <p><%= setting_text_area "checkout_description_#{scm}", :cols => 60, :rows => 5, :class => 'wiki-edit', :label => :field_description %></p>
9
    <%= wikitoolbar_for "settings_checkout_description_#{scm}" %>
10
  </div>
11
  
12
  <% if scm == 'Subversion' %>
13
  <p><%= setting_select "checkout_display_login",[
14
            [l(:label_display_login_username), 'username'],
15
            [l(:label_display_login_password), 'password']
16
          ],
17
          :blank => :label_display_login_none %></p>
18
  <% end %>
19
  
20
  <p><%= setting_check_box "checkout_display_command_#{scm}", :label => :field_checkout_display_command %></p>
21

  
22
  <% javascript_tag do %>
23
    <% repo = "Repository::#{scm}".constantize %>
24
    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 %>');
25
    protocolForms.set('<%= scm %>', subform);
26
  <% end %>
27
  <p><label><%=l :label_protocol_plural %></label><%=l :help_checkout_protocols %></p>
28
  <table class="list checkout_protocol_table">
29
    <thead><tr>
30
      <th class="protocol_protocol"         ><%= l(:setting_protocol)%></th>
31
      <th class="protocol_command"          ><%= l(:setting_checkout_command)%></th>
32
      <th class="protocol_regex"            ><%= l(:setting_checkout_url_regex) %></th>
33
      <th class="protocol_regex_replacement"><%= l(:setting_checkout_url_regex_replacement) %></th>
34
      <th class="protocol_access"           ><%= l(:label_permissions) %></th>
35
      <th class="protocol_append_path"      ><%= l(:label_append_path) %></th>
36
      <th class="protocol_is_default"       ><%= l(:label_default) %></th>
37
      <th class="protocol_delete"           ></th>
38
    </tr></thead>
39
    <tbody id="settings_checkout_protocols_<%= scm %>">
40
      <% Setting.send("checkout_protocols_#{scm}").each_with_index do |protocol, index| %>
41
        <%= render :partial => 'checkout_protocol', :locals => {:protocol => Checkout::Protocol.new(protocol), :scm => scm, :index => index, :classes => cycle('odd', 'even')} %>
42
      <% end %>
43
    </tbody>
44
  </table>
45
  <div style="text-align: right"><%= link_to_function l(:button_add_protocol), "protocolForms.get('#{scm}').add()", {:class => "icon icon-add"} %></div>
46
</div>
vendor/plugins/redmine_checkout/app/views/settings/_checkout_scm.html.erb
1
<div>
2
  <p><%= setting_check_box "checkout_overwrite_description_#{scm}", :label => :setting_checkout_overwrite_description, :onclick => <<-EOF
3
    Effect.toggle($('settings_checkout_description_#{scm}').up("div").up("div"), 'slide', {duration:0.2});
4
  EOF
5
  %></p>
6
  
7
  <div>
8
    <p><%= setting_text_area "checkout_description_#{scm}", :cols => 60, :rows => 5, :class => 'wiki-edit', :label => :field_description %></p>
9
    <%= wikitoolbar_for "settings_checkout_description_#{scm}" %>
10
  </div>
11
  
12
  <% if scm == 'Subversion' %>
13
  <p><%= setting_select "checkout_display_login",[
14
            [l(:label_display_login_username), 'username'],
15
            [l(:label_display_login_password), 'password']
16
          ],
17
          :blank => :label_display_login_none %></p>
18
  <% end %>
19
  
20
  <p><%= setting_check_box "checkout_display_command_#{scm}", :label => :field_checkout_display_command %></p>
21

  
22
  <% javascript_tag do %>
23
    <% repo = "Repository::#{scm}".constantize %>
24
    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 %>');
25
    protocolForms.set('<%= scm %>', subform);
26
  <% end %>
27
  <p><label><%=l :label_protocol_plural %></label><%=l :help_checkout_protocols %></p>
28
  <table class="list checkout_protocol_table">
29
    <thead><tr>
30
      <th class="protocol_protocol"         ><%= l(:setting_protocol)%></th>
31
      <th class="protocol_command"          ><%= l(:setting_checkout_command)%></th>
32
      <th class="protocol_regex"            ><%= l(:setting_checkout_url_regex) %></th>
33
      <th class="protocol_regex_replacement"><%= l(:setting_checkout_url_regex_replacement) %></th>
34
      <th class="protocol_access"           ><%= l(:label_permissions) %></th>
35
      <th class="protocol_append_path"      ><%= l(:label_append_path) %></th>
36
      <th class="protocol_is_default"       ><%= l(:label_default) %></th>
37
      <th class="protocol_delete"           ></th>
38
    </tr></thead>
39
    <tbody id="settings_checkout_protocols_<%= scm %>">
40
      <% Setting.send("checkout_protocols_#{scm}").each_with_index do |protocol, index| %>
41
        <%= render :partial => 'checkout_protocol', :locals => {:protocol => Checkout::Protocol.new(protocol), :scm => scm, :index => index, :classes => cycle('odd', 'even')} %>
42
      <% end %>
43
    </tbody>
44
  </table>
45
  <div style="text-align: right"><%= link_to_function l(:button_add_protocol), "protocolForms.get('#{scm}').add()", {:class => "icon icon-add"} %></div>
46
</div>
vendor/plugins/redmine_checkout/app/views/settings/_redmine_checkout.erb
1
<%=l(:help_moved_settings, :link => link_to(l(:label_settings_location), {:controller => 'settings', :action => 'index', :tab => 'checkout'})) %>
vendor/plugins/redmine_checkout/app/views/settings/_redmine_checkout.html.erb
1
<%=l(:help_moved_settings, :link => link_to(l(:label_settings_location), {:controller => 'settings', :action => 'index', :tab => 'checkout'})) %>

Also available in: Unified diff