Chris@1464
|
1 <%= form_tag({:action => 'edit', :tab => 'repositories'}) do %>
|
Chris@1464
|
2
|
Chris@1464
|
3 <fieldset class="box settings enabled_scm">
|
Chris@1464
|
4 <legend><%= l(:setting_enabled_scm) %></legend>
|
Chris@1464
|
5 <%= hidden_field_tag 'settings[enabled_scm][]', '' %>
|
Chris@1464
|
6 <table>
|
Chris@1464
|
7 <tr>
|
Chris@1464
|
8 <th></th>
|
Chris@1464
|
9 <th><%= l(:text_scm_command) %></th>
|
Chris@1464
|
10 <th><%= l(:text_scm_command_version) %></th>
|
Chris@1464
|
11 </tr>
|
Chris@1464
|
12 <% Redmine::Scm::Base.all.collect do |choice| %>
|
Chris@1464
|
13 <% scm_class = "Repository::#{choice}".constantize %>
|
Chris@1464
|
14 <% text, value = (choice.is_a?(Array) ? choice : [choice, choice]) %>
|
Chris@1464
|
15 <% setting = :enabled_scm %>
|
Chris@1464
|
16 <% enabled = Setting.send(setting).include?(value) %>
|
Chris@1464
|
17 <tr>
|
Chris@1464
|
18 <td class="scm_name">
|
Chris@1464
|
19 <label>
|
Chris@1464
|
20 <%= check_box_tag("settings[#{setting}][]", value, enabled, :id => nil) %>
|
Chris@1464
|
21 <%= text.to_s %>
|
Chris@1464
|
22 </label>
|
Chris@1464
|
23 </td>
|
Chris@1464
|
24 <td>
|
Chris@1464
|
25 <% if enabled %>
|
Chris@1464
|
26 <%=
|
Chris@1464
|
27 image_tag(
|
Chris@1464
|
28 (scm_class.scm_available ? 'true.png' : 'exclamation.png'),
|
Chris@1464
|
29 :style => "vertical-align:bottom;"
|
Chris@1464
|
30 )
|
Chris@1464
|
31 %>
|
Chris@1464
|
32 <%= scm_class.scm_command %>
|
Chris@1464
|
33 <% end %>
|
Chris@1464
|
34 </td>
|
Chris@1464
|
35 <td>
|
Chris@1464
|
36 <%= scm_class.scm_version_string if enabled %>
|
Chris@1464
|
37 </td>
|
Chris@1464
|
38 </tr>
|
Chris@1464
|
39 <% end %>
|
Chris@1464
|
40 </table>
|
Chris@1464
|
41 <p><em class="info"><%= l(:text_scm_config) %></em></p>
|
Chris@1464
|
42 </fieldset>
|
Chris@1464
|
43
|
Chris@1464
|
44 <div class="box tabular settings">
|
Chris@1464
|
45 <p><%= setting_check_box :autofetch_changesets %></p>
|
Chris@1464
|
46
|
Chris@1464
|
47 <p><%= setting_check_box :sys_api_enabled,
|
Chris@1464
|
48 :onclick =>
|
Chris@1464
|
49 "if (this.checked) { $('#settings_sys_api_key').removeAttr('disabled'); } else { $('#settings_sys_api_key').attr('disabled', true); }" %></p>
|
Chris@1464
|
50
|
Chris@1464
|
51 <p><%= setting_text_field :sys_api_key,
|
Chris@1464
|
52 :size => 30,
|
Chris@1464
|
53 :id => 'settings_sys_api_key',
|
Chris@1464
|
54 :disabled => !Setting.sys_api_enabled?,
|
Chris@1464
|
55 :label => :setting_mail_handler_api_key %>
|
Chris@1464
|
56 <%= link_to_function l(:label_generate_key),
|
Chris@1464
|
57 "if (!$('#settings_sys_api_key').attr('disabled')) { $('#settings_sys_api_key').val(randomKey(20)) }" %>
|
Chris@1464
|
58 </p>
|
Chris@1464
|
59
|
Chris@1464
|
60 <p><%= setting_text_field :repository_log_display_limit, :size => 6 %></p>
|
Chris@1464
|
61 </div>
|
Chris@1464
|
62
|
Chris@1464
|
63 <fieldset class="box tabular settings">
|
Chris@1464
|
64 <legend><%= l(:text_issues_ref_in_commit_messages) %></legend>
|
Chris@1464
|
65 <p><%= setting_text_field :commit_ref_keywords, :size => 30 %>
|
Chris@1464
|
66 <em class="info"><%= l(:text_comma_separated) %></em></p>
|
Chris@1464
|
67
|
Chris@1464
|
68 <p><%= setting_check_box :commit_cross_project_ref %></p>
|
Chris@1464
|
69
|
Chris@1464
|
70 <p><%= setting_check_box :commit_logtime_enabled,
|
Chris@1464
|
71 :onclick =>
|
Chris@1464
|
72 "if (this.checked) { $('#settings_commit_logtime_activity_id').removeAttr('disabled'); } else { $('#settings_commit_logtime_activity_id').attr('disabled', true); }"%></p>
|
Chris@1464
|
73
|
Chris@1464
|
74 <p><%= setting_select :commit_logtime_activity_id,
|
Chris@1464
|
75 [[l(:label_default), 0]] +
|
Chris@1464
|
76 TimeEntryActivity.shared.active.collect{|activity| [activity.name, activity.id.to_s]},
|
Chris@1464
|
77 :disabled => !Setting.commit_logtime_enabled?%></p>
|
Chris@1464
|
78 </fieldset>
|
Chris@1464
|
79
|
Chris@1464
|
80 <table class="list" id="commit-keywords">
|
Chris@1464
|
81 <thead>
|
Chris@1464
|
82 <tr>
|
Chris@1464
|
83 <th><%= l(:label_tracker) %></th>
|
Chris@1464
|
84 <th><%= l(:setting_commit_fix_keywords) %></th>
|
Chris@1464
|
85 <th><%= l(:label_applied_status) %></th>
|
Chris@1464
|
86 <th><%= l(:field_done_ratio) %></th>
|
Chris@1464
|
87 <th class="buttons"></th>
|
Chris@1464
|
88 </tr>
|
Chris@1464
|
89 </thead>
|
Chris@1464
|
90 <tbody>
|
Chris@1464
|
91 <% @commit_update_keywords.each do |rule| %>
|
Chris@1464
|
92 <tr class="commit-keywords">
|
Chris@1464
|
93 <td><%= select_tag "settings[commit_update_keywords][if_tracker_id][]", options_for_select([[l(:label_all), ""]] + Tracker.sorted.all.map {|t| [t.name, t.id.to_s]}, rule['if_tracker_id']) %></td>
|
Chris@1464
|
94 <td><%= text_field_tag "settings[commit_update_keywords][keywords][]", rule['keywords'], :size => 30 %></td>
|
Chris@1464
|
95 <td><%= select_tag "settings[commit_update_keywords][status_id][]", options_for_select([["", 0]] + IssueStatus.sorted.all.collect{|status| [status.name, status.id.to_s]}, rule['status_id']) %></td>
|
Chris@1464
|
96 <td><%= select_tag "settings[commit_update_keywords][done_ratio][]", options_for_select([["", ""]] + (0..10).to_a.collect {|r| ["#{r*10} %", "#{r*10}"] }, rule['done_ratio']) %></td>
|
Chris@1464
|
97 <td class="buttons"><%= link_to image_tag('delete.png'), '#', :class => 'delete-commit-keywords' %></td>
|
Chris@1464
|
98 </tr>
|
Chris@1464
|
99 <% end %>
|
Chris@1464
|
100 <tr>
|
Chris@1464
|
101 <td></td>
|
Chris@1464
|
102 <td><em class="info"><%= l(:text_comma_separated) %></em></td>
|
Chris@1464
|
103 <td></td>
|
Chris@1464
|
104 <td></td>
|
Chris@1464
|
105 <td class="buttons"><%= link_to image_tag('add.png'), '#', :class => 'add-commit-keywords' %></td>
|
Chris@1464
|
106 </tr>
|
Chris@1464
|
107 </tbody>
|
Chris@1464
|
108 </table>
|
Chris@1464
|
109
|
Chris@1464
|
110 <p><%= submit_tag l(:button_save) %></p>
|
Chris@1464
|
111 <% end %>
|
Chris@1464
|
112
|
Chris@1464
|
113 <%= javascript_tag do %>
|
Chris@1464
|
114 $('#commit-keywords').on('click', 'a.delete-commit-keywords', function(e){
|
Chris@1464
|
115 e.preventDefault();
|
Chris@1464
|
116 if ($('#commit-keywords tbody tr.commit-keywords').length > 1) {
|
Chris@1464
|
117 $(this).parents('#commit-keywords tr').remove();
|
Chris@1464
|
118 } else {
|
Chris@1464
|
119 $('#commit-keywords tbody tr.commit-keywords').find('input, select').val('');
|
Chris@1464
|
120 }
|
Chris@1464
|
121 });
|
Chris@1464
|
122 $('#commit-keywords').on('click', 'a.add-commit-keywords', function(e){
|
Chris@1464
|
123 e.preventDefault();
|
Chris@1464
|
124 var row = $('#commit-keywords tr.commit-keywords:last');
|
Chris@1464
|
125 row.clone().insertAfter(row).find('input, select').val('');
|
Chris@1464
|
126 });
|
Chris@1464
|
127 <% end %>
|