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