You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

_repositories.html.erb 5.7KB

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