%= form_tag({:action => 'edit', :tab => 'repositories'}) do %>
<%= setting_check_box :autofetch_changesets %>
<%= setting_check_box :sys_api_enabled, :onclick => "if (this.checked) { $('#settings_sys_api_key').removeAttr('disabled'); } else { $('#settings_sys_api_key').attr('disabled', true); }" %>
<%= setting_text_field :sys_api_key, :size => 30, :id => 'settings_sys_api_key', :disabled => !Setting.sys_api_enabled? %> <%= link_to_function l(:label_generate_key), "if (!$('#settings_sys_api_key').attr('disabled')) { $('#settings_sys_api_key').val(randomKey(20)) }" %>
<%= setting_text_field :repository_log_display_limit, :size => 6 %>
<%= l(:label_tracker) %> | <%= l(:setting_commit_fix_keywords) %> | <%= l(:label_applied_status) %> | <%= l(:field_done_ratio) %> | |
---|---|---|---|---|
<%= select_tag( "settings[commit_update_keywords][if_tracker_id][]", options_for_select( [[l(:label_all), ""]] + Tracker.sorted.map {|t| [t.name, t.id.to_s]}, rule['if_tracker_id']), :id => nil ) %> | <%= text_field_tag("settings[commit_update_keywords][keywords][]", rule['keywords'], :id => nil, :size => 30) %> | <%= select_tag("settings[commit_update_keywords][status_id][]", options_for_select( [["", 0]] + IssueStatus.sorted. collect{|status| [status.name, status.id.to_s]}, rule['status_id']), :id => nil ) %> | <%= select_tag("settings[commit_update_keywords][done_ratio][]", options_for_select( [["", ""]] + (0..10).to_a.collect {|r| ["#{r*10} %", "#{r*10}"] }, rule['done_ratio']), :id => nil ) %> | <%= link_to(l(:button_delete), '#', :class => 'delete-commit-keywords icon-only icon-del', :title => l(:button_delete)) %> |
<%= l(:text_comma_separated) %> | <%= link_to(l(:button_add), '#', :class => 'add-commit-keywords icon-only icon-add', :title => l(:button_add)) %> |
<%= submit_tag l(:button_save) %>
<% end %> <%= javascript_tag do %> $('#commit-keywords').on('click', 'a.delete-commit-keywords', function(e){ e.preventDefault(); if ($('#commit-keywords tbody tr.commit-keywords').length > 1) { $(this).parents('#commit-keywords tr').remove(); } else { $('#commit-keywords tbody tr.commit-keywords').find('input, select').val(''); } }); $('#commit-keywords').on('click', 'a.add-commit-keywords', function(e){ e.preventDefault(); var row = $('#commit-keywords tr.commit-keywords:last'); row.clone().insertAfter(row).find('input, select').val(''); }); <% end %>