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.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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. <%=
  26. image_tag(
  27. (scm_class.scm_available ? 'true.png' : 'exclamation.png'),
  28. :style => "vertical-align:bottom;"
  29. )
  30. %>
  31. <%= scm_class.scm_command %>
  32. <% end %>
  33. </td>
  34. <td>
  35. <%= scm_class.scm_version_string if enabled %>
  36. </td>
  37. </tr>
  38. <% end %>
  39. </table>
  40. <p><em class="info"><%= l(:text_scm_config) %></em></p>
  41. </fieldset>
  42. <div class="box tabular settings">
  43. <p><%= setting_check_box :autofetch_changesets %></p>
  44. <p><%= setting_check_box :sys_api_enabled,
  45. :onclick =>
  46. "if (this.checked) { $('#settings_sys_api_key').removeAttr('disabled'); } else { $('#settings_sys_api_key').attr('disabled', true); }" %></p>
  47. <p><%= setting_text_field :sys_api_key,
  48. :size => 30,
  49. :id => 'settings_sys_api_key',
  50. :disabled => !Setting.sys_api_enabled?,
  51. :label => :setting_mail_handler_api_key %>
  52. <%= link_to_function l(:label_generate_key),
  53. "if (!$('#settings_sys_api_key').attr('disabled')) { $('#settings_sys_api_key').val(randomKey(20)) }" %>
  54. </p>
  55. <p><%= setting_text_field :repository_log_display_limit, :size => 6 %></p>
  56. </div>
  57. <fieldset class="box tabular settings">
  58. <legend><%= l(:text_issues_ref_in_commit_messages) %></legend>
  59. <p><%= setting_text_field :commit_ref_keywords, :size => 30 %>
  60. <em class="info"><%= l(:text_comma_separated) %></em></p>
  61. <p><%= setting_check_box :commit_cross_project_ref %></p>
  62. <p><%= setting_check_box :commit_logtime_enabled,
  63. :onclick =>
  64. "if (this.checked) { $('#settings_commit_logtime_activity_id').removeAttr('disabled'); } else { $('#settings_commit_logtime_activity_id').attr('disabled', true); }"%></p>
  65. <p><%= setting_select :commit_logtime_activity_id,
  66. [[l(:label_default), 0]] +
  67. TimeEntryActivity.shared.active.collect{|activity| [activity.name, activity.id.to_s]},
  68. :disabled => !Setting.commit_logtime_enabled?%></p>
  69. </fieldset>
  70. <table class="list" id="commit-keywords">
  71. <thead>
  72. <tr>
  73. <th><%= l(:label_tracker) %></th>
  74. <th><%= l(:setting_commit_fix_keywords) %></th>
  75. <th><%= l(:label_applied_status) %></th>
  76. <th><%= l(:field_done_ratio) %></th>
  77. <th class="buttons"></th>
  78. </tr>
  79. </thead>
  80. <tbody>
  81. <% @commit_update_keywords.each do |rule| %>
  82. <tr class="commit-keywords">
  83. <td><%= select_tag "settings[commit_update_keywords][if_tracker_id][]", options_for_select([[l(:label_all), ""]] + Tracker.sorted.all.map {|t| [t.name, t.id.to_s]}, rule['if_tracker_id']) %></td>
  84. <td><%= text_field_tag "settings[commit_update_keywords][keywords][]", rule['keywords'], :size => 30 %></td>
  85. <td><%= select_tag "settings[commit_update_keywords][status_id][]", options_for_select([["", 0]] + IssueStatus.sorted.all.collect{|status| [status.name, status.id.to_s]}, rule['status_id']) %></td>
  86. <td><%= select_tag "settings[commit_update_keywords][done_ratio][]", options_for_select([["", ""]] + (0..10).to_a.collect {|r| ["#{r*10} %", "#{r*10}"] }, rule['done_ratio']) %></td>
  87. <td class="buttons"><%= link_to image_tag('delete.png'), '#', :class => 'delete-commit-keywords' %></td>
  88. </tr>
  89. <% end %>
  90. <tr>
  91. <td></td>
  92. <td><em class="info"><%= l(:text_comma_separated) %></em></td>
  93. <td></td>
  94. <td></td>
  95. <td class="buttons"><%= link_to image_tag('add.png'), '#', :class => 'add-commit-keywords' %></td>
  96. </tr>
  97. </tbody>
  98. </table>
  99. <p><%= submit_tag l(:button_save) %></p>
  100. <% end %>
  101. <%= javascript_tag do %>
  102. $('#commit-keywords').on('click', 'a.delete-commit-keywords', function(e){
  103. e.preventDefault();
  104. if ($('#commit-keywords tbody tr.commit-keywords').length > 1) {
  105. $(this).parents('#commit-keywords tr').remove();
  106. } else {
  107. $('#commit-keywords tbody tr.commit-keywords').find('input, select').val('');
  108. }
  109. });
  110. $('#commit-keywords').on('click', 'a.add-commit-keywords', function(e){
  111. e.preventDefault();
  112. var row = $('#commit-keywords tr.commit-keywords:last');
  113. row.clone().insertAfter(row).find('input, select').val('');
  114. });
  115. <% end %>