<%
# handle freeze deadline
if (@deadline) and (Time.now > @deadline) and (current_user.role != "admin")
  flash[:notice] = "Pipeline not available due to post-freeze processing<br>(as of #{@deadline.strftime('%Y-%m-%d %H:%M')})."
  %> Press the back button on your browser <%
else
%>

<p>
<b>Create new submission:</b>
<p>

<%= error_messages_for 'project' -%>

<% form_tag(:action => 'create') do %>

  <p><label for="project_name">Name</label><br/>
  <%= text_field 'project', 'name'  %>
  <br><i>Please supply a readable name that includes the data type and lab (e.g.:  Duke Dnase-Seq Sep08)</i>
  </p>
 
<%
=begin %>
    Maybe I can use code like this for the "type"
    if we ever have a "types" table
  <p><label for="project_category">Category</label><br/>
  <%= collection_select(:project, :category_id, @categories, :id, :name) %></p>

  <p><label for="project_project_type_id">Type</label><br/>
  <%= collection_select(:project, :project_type_id, @projectTypesColl, :id, :name) %></p>

  <p><label for="project_project_type_id">Type</label><br/>
  <%= text_field 'project', 'project_type_id'  %></p>

<%
=end %>

<!-- Project type dropdown menu, now only for 'admin' user -->
<% if current_user.login == "admin" %>
  <p><label for="project_project_type_id">Type</label><br/>
  <select id="project_project_type_id" name="project[project_type_id]">
  <% @projectTypes.each do |t| %>
  <option value="<%= t.id -%>"><%= t.short_label -%></option>
  <% end %>
  </select></p>
<% else %>
   <% @project.project_type_id = @projectTypes[0].id %>
   <%= hidden_field :project, :project_type_id %>
<% end %>


<table><tr>
<td > <%= submit_tag 'Create' -%></td>
<td > <%= submit_tag 'Cancel' -%></td>
</tr></table>

<% end %>

<% end %>
