<% content_for :header_tags do %> <%= javascript_include_tag('scm_utils_jquery', :plugin => 'redmine_scm') %> <% end %> <% if ScmConfig['force_repository'] %> <%= hidden_field_tag('project[enabled_module_names][]', 'repository') %> <%= javascript_tag("$(document).ready(force_repository_module);") %> <% end %> <% if project.new_record? && ScmConfig['auto_create'] %> <% count = [ SubversionCreator, GitCreator, MercurialCreator, BazaarCreator, GithubCreator ].inject(0) do |sum, scm| sum += 1 if scm.enabled? sum end %> <% if (count > 1) || (ScmConfig['auto_create'] != 'force') %> <% options = [] options << [ '' ] if ScmConfig['auto_create'] != 'force' options << [ 'Subversion' ] if SubversionCreator.enabled? options << [ 'Mercurial' ] if MercurialCreator.enabled? options << [ 'Bazaar' ] if BazaarCreator.enabled? options << [ 'Git' ] if GitCreator.enabled? options << [ 'Github' ] if GithubCreator.enabled? %>

<%= select_tag('project[scm]', options_for_select(options, (request.params[:project] ? request.params[:project][:scm] : nil))) %>
<% if ScmConfig['auto_create'] == 'force' %> <%= l(:text_cannot_be_changed_later) %> <% end %>

<% else %> <% if SubversionCreator.enabled? %> <%= hidden_field_tag('project[scm]', 'Subversion') %> <% elsif GitCreator.enabled? %> <%= hidden_field_tag('project[scm]', 'Git') %> <% elsif MercurialCreator.enabled? %> <%= hidden_field_tag('project[scm]', 'Mercurial') %> <% elsif BazaarCreator.enabled? %> <%= hidden_field_tag('project[scm]', 'Bazaar') %> <% elsif GithubCreator.enabled? %> <%= hidden_field_tag('project[scm]', 'Github') %> <% end %> <% end %> <% end %>