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