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