<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', :media => 'all' %>
<%= error_messages_for 'bid' %>
<%= hidden_field_tag 'course_id', @course.id %>
<div class="project_r_h">
  <h2 class="project_h2"><%= l(:label_course_homework_new)%></h2>
</div>
<div class="hwork_new">
  <ul>
    <li  class="ml45">
      <label><span class="c_red">*</span>&nbsp;<%= l(:field_name)%>&nbsp;&nbsp;：</label>
      <input  type="text" name="bid[name]" id="bid_name" class="hwork_input" maxlength="<%= Bid::NAME_LENGTH_LIMIT%>" onkeyup="regex_bid_name();" value="<%= bid.name%>" >
      <p id="bid_name_span" class="c_red" style="padding-left: 55px;"></p>
    </li>
    <li class="ml45 mb10">
      <label class="fl" >&nbsp;&nbsp;<%= l(:field_quote)%>&nbsp;&nbsp;：</label>
      <!--<textarea  name="bid[description]" placeholder="最多3000个汉字(或6000个英文字符)"  class="hwork_text fl"></textarea>-->
      <% if edit_mode %>
        <%= f.kindeditor :description,:width=>'91%',:editor_id => 'bid_description_editor',:owner_id => bid.id,:owner_type =>OwnerTypeHelper::BID,:resizeType => 0,act_id: @course.id, act_type: @course.class.to_s %>
      <% else %>
          <%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %>
          <%= f.kindeditor :description,:width=>'91%',:editor_id => 'bid_description_editor',:resizeType => 0, act_id: @course.id, act_type: @course.class.to_s %>
      <% end %>
    </li>
    <div class="cl"></div>
    <li class="ml21">
      <label class="fl"><span class="c_red">*</span>&nbsp;<%= l(:label_limit_time)%>&nbsp;&nbsp;：</label>
      <input  type="text" name="bid[deadline]" id="bid_deadline" class="hwork_input02 fl" onchange="regexDeadLine();" readonly="readonly" value="<%= bid.deadline%>" >
      <%= calendar_for('bid_deadline')%>
      <div class="cl"></div>
    </li>
    <li class=" mb5 ml30">
      <label ><%= l(:label_open_anonymous_evaluation)%>&nbsp;&nbsp;：</label>
      <input type="checkbox" name="bid[open_anonymous_evaluation]" id="bid_open_anonymous_evaluation" <%= bid.open_anonymous_evaluation == 1 ? 'checked' : ''%>  >
      <div class="cl"></div>
    </li>
    <li class="ml9" id="bid_evaluation_num_li"  style="display: <%= bid.open_anonymous_evaluation == 1 ? 'block' : 'none'%>;">
      <label><span class="c_red">*</span>&nbsp;<%= l(:field_evaluation_num)%>&nbsp;&nbsp;：</label>
      <input  type="text" name="bid[evaluation_num]" id="bid_evaluation_num"  class="hwork_input02" onkeyup="regex_evaluation_num();" value="<%= bid.evaluation_num%>" maxlength="3">
      <span><%= l(:label_evaluation_description)%></span>
      <p id="bid_evaluation_num_span" class="c_red" style="padding-left: 90px;"></p>
    </li>
    <li class="ml45">
      <label class="fl">&nbsp;&nbsp;<%= l(:label_attachment_plural) %>&nbsp;&nbsp;：</label>
      <%= render :partial => 'attachments/new_form', :locals => {:container => bid} %>
      <div class="cl"></div>
    </li>
    <li class=" ml90" >
      <a class="blue_btn fl c_white" onclick="submit_new_bid('<%= bid_id%>');" href="javascript:void(0)"><%= l(:button_create)%></a>
      <%= link_to l(:button_cancel), homework_course_path(@course), :class => "blue_btn grey_btn fl c_white"%>
      <div class="cl"></div>
    </li>
  </ul>
</div>
<div class="cl"></div>
