##// END OF EJS Templates
Do not show warnings for disabled scm....
Jean-Philippe Lang -
r7911:655dc18d71af
parent child
Show More
@@ -1,91 +1,94
1 <% form_tag({:action => 'edit', :tab => 'repositories'}) do %>
1 <% form_tag({:action => 'edit', :tab => 'repositories'}) do %>
2
2
3 <fieldset class="box settings enabled_scm">
3 <fieldset class="box settings enabled_scm">
4 <legend><%= l(:setting_enabled_scm) %></legend>
4 <legend><%= l(:setting_enabled_scm) %></legend>
5 <table>
5 <table>
6 <tr>
6 <tr>
7 <th></th>
7 <th></th>
8 <th><%= l(:text_scm_command) %></th>
8 <th><%= l(:text_scm_command) %></th>
9 <th><%= l(:text_scm_command_version) %></th>
9 <th><%= l(:text_scm_command_version) %></th>
10 </tr>
10 </tr>
11 <% Redmine::Scm::Base.all.collect do |choice| %>
11 <% Redmine::Scm::Base.all.collect do |choice| %>
12 <% scm_class = "Repository::#{choice}".constantize %>
12 <% scm_class = "Repository::#{choice}".constantize %>
13 <% text, value = (choice.is_a?(Array) ? choice : [choice, choice]) %>
13 <% text, value = (choice.is_a?(Array) ? choice : [choice, choice]) %>
14 <% setting = :enabled_scm %>
14 <% setting = :enabled_scm %>
15 <% enabled = Setting.send(setting).include?(value) %>
15 <tr>
16 <tr>
16 <td class="scm_name">
17 <td class="scm_name">
17 <%=
18 <%=
18 check_box_tag(
19 check_box_tag(
19 "settings[#{setting}][]",
20 "settings[#{setting}][]",
20 value,
21 value,
21 Setting.send(setting).include?(value))
22 enabled)
22 %>
23 %>
23 <%= text.to_s %>
24 <%= text.to_s %>
24 </td>
25 </td>
25 <td>
26 <td>
27 <% if enabled %>
26 <%=
28 <%=
27 image_tag(
29 image_tag(
28 (scm_class.scm_available ? 'true.png' : 'exclamation.png'),
30 (scm_class.scm_available ? 'true.png' : 'exclamation.png'),
29 :style => "vertical-align:bottom;"
31 :style => "vertical-align:bottom;"
30 )
32 )
31 %>
33 %>
32 <%= scm_class.scm_command %>
34 <%= scm_class.scm_command %>
35 <% end %>
33 </td>
36 </td>
34 <td>
37 <td>
35 <%= scm_class.scm_version_string %>
38 <%= scm_class.scm_version_string if enabled %>
36 </td>
39 </td>
37 </tr>
40 </tr>
38 <% end %>
41 <% end %>
39 </table>
42 </table>
40 <p><em><%= l(:text_scm_config) %></em></p>
43 <p><em><%= l(:text_scm_config) %></em></p>
41 </fieldset>
44 </fieldset>
42
45
43 <div class="box tabular settings">
46 <div class="box tabular settings">
44 <p><%= setting_check_box :autofetch_changesets %></p>
47 <p><%= setting_check_box :autofetch_changesets %></p>
45
48
46 <p><%= setting_check_box :sys_api_enabled,
49 <p><%= setting_check_box :sys_api_enabled,
47 :onclick =>
50 :onclick =>
48 "if (this.checked) { Form.Element.enable('settings_sys_api_key'); } else { Form.Element.disable('settings_sys_api_key'); }" %></p>
51 "if (this.checked) { Form.Element.enable('settings_sys_api_key'); } else { Form.Element.disable('settings_sys_api_key'); }" %></p>
49
52
50 <p><%= setting_text_field :sys_api_key,
53 <p><%= setting_text_field :sys_api_key,
51 :size => 30,
54 :size => 30,
52 :id => 'settings_sys_api_key',
55 :id => 'settings_sys_api_key',
53 :disabled => !Setting.sys_api_enabled?,
56 :disabled => !Setting.sys_api_enabled?,
54 :label => :setting_mail_handler_api_key %>
57 :label => :setting_mail_handler_api_key %>
55 <%= link_to_function l(:label_generate_key),
58 <%= link_to_function l(:label_generate_key),
56 "if ($('settings_sys_api_key').disabled == false) { $('settings_sys_api_key').value = randomKey(20) }" %>
59 "if ($('settings_sys_api_key').disabled == false) { $('settings_sys_api_key').value = randomKey(20) }" %>
57 </p>
60 </p>
58
61
59 <p><%= setting_text_field :repository_log_display_limit, :size => 6 %></p>
62 <p><%= setting_text_field :repository_log_display_limit, :size => 6 %></p>
60 </div>
63 </div>
61
64
62 <fieldset class="box tabular settings">
65 <fieldset class="box tabular settings">
63 <legend><%= l(:text_issues_ref_in_commit_messages) %></legend>
66 <legend><%= l(:text_issues_ref_in_commit_messages) %></legend>
64 <p><%= setting_text_field :commit_ref_keywords, :size => 30 %><br />
67 <p><%= setting_text_field :commit_ref_keywords, :size => 30 %><br />
65 <em><%= l(:text_comma_separated) %></em></p>
68 <em><%= l(:text_comma_separated) %></em></p>
66
69
67 <p><%= setting_text_field :commit_fix_keywords, :size => 30 %>
70 <p><%= setting_text_field :commit_fix_keywords, :size => 30 %>
68 &nbsp;<%= l(:label_applied_status) %>: <%= setting_select :commit_fix_status_id,
71 &nbsp;<%= l(:label_applied_status) %>: <%= setting_select :commit_fix_status_id,
69 [["", 0]] +
72 [["", 0]] +
70 IssueStatus.find(:all).collect{
73 IssueStatus.find(:all).collect{
71 |status| [status.name, status.id.to_s]
74 |status| [status.name, status.id.to_s]
72 },
75 },
73 :label => false %>
76 :label => false %>
74 &nbsp;<%= l(:field_done_ratio) %>: <%= setting_select :commit_fix_done_ratio,
77 &nbsp;<%= l(:field_done_ratio) %>: <%= setting_select :commit_fix_done_ratio,
75 (0..10).to_a.collect {|r| ["#{r*10} %", "#{r*10}"] },
78 (0..10).to_a.collect {|r| ["#{r*10} %", "#{r*10}"] },
76 :blank => :label_no_change_option,
79 :blank => :label_no_change_option,
77 :label => false %>
80 :label => false %>
78 <br /><em><%= l(:text_comma_separated) %></em></p>
81 <br /><em><%= l(:text_comma_separated) %></em></p>
79
82
80 <p><%= setting_check_box :commit_logtime_enabled,
83 <p><%= setting_check_box :commit_logtime_enabled,
81 :onclick =>
84 :onclick =>
82 "if (this.checked) { Form.Element.enable('settings_commit_logtime_activity_id'); } else { Form.Element.disable('settings_commit_logtime_activity_id'); }"%></p>
85 "if (this.checked) { Form.Element.enable('settings_commit_logtime_activity_id'); } else { Form.Element.disable('settings_commit_logtime_activity_id'); }"%></p>
83
86
84 <p><%= setting_select :commit_logtime_activity_id,
87 <p><%= setting_select :commit_logtime_activity_id,
85 [[l(:label_default), 0]] +
88 [[l(:label_default), 0]] +
86 TimeEntryActivity.shared.active.collect{|activity| [activity.name, activity.id.to_s]},
89 TimeEntryActivity.shared.active.collect{|activity| [activity.name, activity.id.to_s]},
87 :disabled => !Setting.commit_logtime_enabled?%></p>
90 :disabled => !Setting.commit_logtime_enabled?%></p>
88 </fieldset>
91 </fieldset>
89
92
90 <%= submit_tag l(:button_save) %>
93 <%= submit_tag l(:button_save) %>
91 <% end %>
94 <% end %>
General Comments 0
You need to be logged in to leave comments. Login now