_repositories.html.erb
158 lines
| 5.6 KiB
| text/plain
|
TextLexer
|
r9346 | <%= form_tag({:action => 'edit', :tab => 'repositories'}) do %> | ||
|
r1033 | |||
|
r7812 | <fieldset class="box settings enabled_scm"> | ||
|
r5832 | <legend><%= l(:setting_enabled_scm) %></legend> | ||
|
r9947 | <%= hidden_field_tag 'settings[enabled_scm][]', '' %> | ||
|
r5832 | <table> | ||
<tr> | ||||
<th></th> | ||||
<th><%= l(:text_scm_command) %></th> | ||||
<th><%= l(:text_scm_command_version) %></th> | ||||
</tr> | ||||
<% Redmine::Scm::Base.all.collect do |choice| %> | ||||
<% scm_class = "Repository::#{choice}".constantize %> | ||||
<% text, value = (choice.is_a?(Array) ? choice : [choice, choice]) %> | ||||
<% setting = :enabled_scm %> | ||||
|
r11395 | <% enabled = Setting.send(setting).include?(value) %> | ||
|
r5832 | <tr> | ||
|
r5840 | <td class="scm_name"> | ||
|
r9943 | <label> | ||
|
r11395 | <%= check_box_tag("settings[#{setting}][]", value, enabled, :id => nil) %> | ||
<%= text.to_s %> | ||||
|
r9943 | </label> | ||
|
r5832 | </td> | ||
<td> | ||||
|
r11395 | <% if enabled %> | ||
|
r14686 | <span class="icon <%= (scm_class.scm_available ? 'icon-ok' : 'icon-error') %>"></span> | ||
|
r5832 | <%= scm_class.scm_command %> | ||
|
r11395 | <% end %> | ||
</td> | ||||
<td> | ||||
<%= scm_class.scm_version_string if enabled %> | ||||
</td> | ||||
</tr> | ||||
|
r5832 | <% end %> | ||
</table> | ||||
|
r8634 | <p><em class="info"><%= l(:text_scm_config) %></em></p> | ||
|
r5832 | </fieldset> | ||
|
r1033 | <div class="box tabular settings"> | ||
|
r3084 | <p><%= setting_check_box :autofetch_changesets %></p> | ||
|
r5766 | <p><%= setting_check_box :sys_api_enabled, | ||
|
r5831 | :onclick => | ||
|
r9885 | "if (this.checked) { $('#settings_sys_api_key').removeAttr('disabled'); } else { $('#settings_sys_api_key').attr('disabled', true); }" %></p> | ||
|
r5831 | |||
<p><%= setting_text_field :sys_api_key, | ||||
:size => 30, | ||||
:id => 'settings_sys_api_key', | ||||
|
r14764 | :disabled => !Setting.sys_api_enabled? %> | ||
|
r5831 | <%= link_to_function l(:label_generate_key), | ||
|
r9885 | "if (!$('#settings_sys_api_key').attr('disabled')) { $('#settings_sys_api_key').val(randomKey(20)) }" %> | ||
|
r3087 | </p> | ||
|
r3084 | |||
<p><%= setting_text_field :repository_log_display_limit, :size => 6 %></p> | ||||
|
r1033 | </div> | ||
|
r5831 | <fieldset class="box tabular settings"> | ||
<legend><%= l(:text_issues_ref_in_commit_messages) %></legend> | ||||
|
r8634 | <p><%= setting_text_field :commit_ref_keywords, :size => 30 %> | ||
<em class="info"><%= l(:text_comma_separated) %></em></p> | ||||
|
r1033 | |||
|
r8630 | <p><%= setting_check_box :commit_cross_project_ref %></p> | ||
|
r4356 | <p><%= setting_check_box :commit_logtime_enabled, | ||
|
r5831 | :onclick => | ||
|
r9885 | "if (this.checked) { $('#settings_commit_logtime_activity_id').removeAttr('disabled'); } else { $('#settings_commit_logtime_activity_id').attr('disabled', true); }"%></p> | ||
|
r4356 | |||
|
r5766 | <p><%= setting_select :commit_logtime_activity_id, | ||
|
r5831 | [[l(:label_default), 0]] + | ||
|
r5952 | TimeEntryActivity.shared.active.collect{|activity| [activity.name, activity.id.to_s]}, | ||
|
r5831 | :disabled => !Setting.commit_logtime_enabled?%></p> | ||
|
r1033 | </fieldset> | ||
|
r11967 | <table class="list" id="commit-keywords"> | ||
<thead> | ||||
<tr> | ||||
|
r11978 | <th><%= l(:label_tracker) %></th> | ||
|
r11967 | <th><%= l(:setting_commit_fix_keywords) %></th> | ||
<th><%= l(:label_applied_status) %></th> | ||||
<th><%= l(:field_done_ratio) %></th> | ||||
<th class="buttons"></th> | ||||
</tr> | ||||
</thead> | ||||
<tbody> | ||||
|
r11978 | <% @commit_update_keywords.each do |rule| %> | ||
|
r11967 | <tr class="commit-keywords"> | ||
|
r12334 | <td> | ||
<%= select_tag( | ||||
"settings[commit_update_keywords][if_tracker_id][]", | ||||
options_for_select( | ||||
[[l(:label_all), ""]] + | ||||
|
r12338 | Tracker.sorted.map {|t| [t.name, t.id.to_s]}, | ||
|
r13262 | rule['if_tracker_id']), | ||
:id => nil | ||||
|
r12334 | ) %> | ||
</td> | ||||
<td> | ||||
<%= text_field_tag("settings[commit_update_keywords][keywords][]", | ||||
|
r13262 | rule['keywords'], :id => nil, :size => 30) %> | ||
|
r12334 | </td> | ||
<td> | ||||
<%= select_tag("settings[commit_update_keywords][status_id][]", | ||||
options_for_select( | ||||
[["", 0]] + | ||||
|
r12338 | IssueStatus.sorted. | ||
|
r12334 | collect{|status| [status.name, status.id.to_s]}, | ||
|
r13262 | rule['status_id']), | ||
:id => nil | ||||
|
r12334 | ) %> | ||
</td> | ||||
<td> | ||||
<%= select_tag("settings[commit_update_keywords][done_ratio][]", | ||||
options_for_select( | ||||
[["", ""]] + | ||||
(0..10).to_a.collect {|r| ["#{r*10} %", "#{r*10}"] }, | ||||
|
r13262 | rule['done_ratio']), | ||
:id => nil | ||||
|
r12334 | ) %> | ||
</td> | ||||
<td class="buttons"> | ||||
|
r14889 | <%= link_to(l(:button_delete), '#', | ||
:class => 'delete-commit-keywords icon-only icon-del', | ||||
:title => l(:button_delete)) %> | ||||
|
r12334 | </td> | ||
|
r11967 | </tr> | ||
<% end %> | ||||
<tr> | ||||
|
r11978 | <td></td> | ||
|
r11967 | <td><em class="info"><%= l(:text_comma_separated) %></em></td> | ||
<td></td> | ||||
<td></td> | ||||
|
r14686 | <td class="buttons"> | ||
|
r14889 | <%= link_to(l(:button_add), '#', | ||
:class => 'add-commit-keywords icon-only icon-add', | ||||
:title => l(:button_add)) %> | ||||
|
r14686 | </td> | ||
|
r11967 | </tr> | ||
</tbody> | ||||
</table> | ||||
<p><%= submit_tag l(:button_save) %></p> | ||||
<% 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(''); | ||||
}); | ||||
|
r1033 | <% end %> | ||