<%= error_messages_for 'project' %>

<%= f.text_field :name, :required => true %>

<% if admin_loggedin? and !@root_projects.empty? %>

<%= f.select :parent_id, (@root_projects.collect {|p| [p.name, p.id]}), { :include_blank => true } %>

<% end %>

<%= f.text_area :description, :required => true, :cols => 60, :rows => 3 %>

<%= f.text_field :homepage, :size => 40 %>

<%= f.check_box :is_public %>

<% for @custom_value in @custom_values %>

<%= custom_field_tag_with_label @custom_value %>

<% end %> <% unless @custom_fields.empty? %>

<% for custom_field in @custom_fields %> <%= check_box_tag "custom_field_ids[]", custom_field.id, ((@project.custom_fields.include? custom_field) or custom_field.is_for_all?), (custom_field.is_for_all? ? {:disabled => "disabled"} : {}) %> <%= custom_field.name %> <% end %>

<% end %>

<%= check_box_tag "repository_enabled", 1, !@project.repository.nil?, :onclick => "Element.toggle('repository');" %> <%= l(:label_repository) %>

<%= hidden_field_tag "repository_enabled", 0 %>
<% fields_for :repository, @project.repository, { :builder => TabularFormBuilder, :lang => current_language} do |repository| %>

<%= repository.text_field :url, :size => 60, :required => true, :disabled => (@project.repository && !@project.repository.root_url.blank?) %>
(http://, https://, svn://, file:///)

<%= repository.text_field :login, :size => 30 %>

<%= repository.password_field :password, :size => 30 %>

<% end %>
<%= javascript_tag "Element.hide('repository');" if @project.repository.nil? %>

<%= check_box_tag "wiki_enabled", 1, !@project.wiki.nil?, :onclick => "Element.toggle('wiki');" %> <%= l(:label_wiki) %>

<%= hidden_field_tag "wiki_enabled", 0 %>
<% fields_for :wiki, @project.wiki, { :builder => TabularFormBuilder, :lang => current_language} do |wiki| %>

<%= wiki.text_field :start_page, :size => 60, :required => true %>

<% # content_tag("div", "", :id => "wiki_start_page_auto_complete", :class => "auto_complete") + # auto_complete_field("wiki_start_page", { :url => { :controller => 'wiki', :action => 'auto_complete_for_wiki_page', :id => @project } }) %> <% end %>
<%= javascript_tag "Element.hide('wiki');" if @project.wiki.nil? %>
<% content_for :header_tags do %> <%= javascript_include_tag 'calendar/calendar' %> <%= javascript_include_tag "calendar/lang/calendar-#{current_language}.js" %> <%= javascript_include_tag 'calendar/calendar-setup' %> <%= stylesheet_link_tag 'calendar' %> <% end %>