comparison .svn/pristine/97/97b4e567903dafea6c9d77e2eab8984459d170a4.svn-base @ 1517:dffacf8a6908 redmine-2.5

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