<% # encoding: utf-8 %> <% content_for :page_specific_css do %> <%= stylesheet_link_tag "lib/main-forms" %> <%= stylesheet_link_tag "lib/fileupload" %> <%= stylesheet_link_tag "lib/main-list" %> <%= stylesheet_link_tag "lib/main-form-col2" %> <% end %> <% content_for :page_specific_javascript do %> <%= javascript_include_tag "lib/bootstrap-datetimepicker" %> <%= javascript_include_tag "lib/datetimepicker/datetimepicker.js" %> <%= javascript_include_tag "lib/bootstrap-fileupload" %> <%= javascript_include_tag "lib/file-type" %> <%= javascript_include_tag "lib/module-area" %> <% end %>
<% @site_in_use_locales.each_with_index do |locale, i| %>
">
<%= f.fields_for :name_translations do |f| %> <%= f.text_field locale, class: "input-block-level", placeholder: t("personal_course.name"), value: (@course_assignment.name_translations[locale] rescue nil) %> <% end %>
<%= f.fields_for :detail_translations do |f| %> <%= f.text_field locale, class: "input-block-level", placeholder: t("personal_course.detail"), value: (@course_assignment.detail_translations[locale] rescue nil) %> <% end %>
<% end %>
<% if params[:id].present? %> <%= f.hidden_field :course_id, :value => params[:id] %> <% end %>
<%= f.datetime_picker :assign_date, :no_label => true, :new_record => @course_assignment.new_record?, :data=>{"picker-type" => "range", "range" => "start"} %>
<%= f.datetime_picker :deadline, :no_label => true, :new_record => @course_assignment.new_record?, :data=>{"picker-type" => "range", "range" => "start"} %>
<% files_hash = {} ["course_attachment"].each do |file| hash = {} hash["html"] = add_attribute("form_file", f, file.pluralize.to_sym) hash["count"] = @course_assignment.send(file.pluralize).count rescue 0 files_hash[file] = hash %>
<% if !@course_assignment.new_record? && hash["count"] > 0 %>
<% @course_assignment.send(file.pluralize).each_with_index do |obj, i| %> <% if !obj.new_record? %> <%= f.fields_for file.pluralize.to_sym, obj do |f| %> <%= render :partial => "form_file", :object => obj, :locals => {:f => f, :i => i} %> <% end %> <% end %> <% end %>
<% end %>

<%= t(:add) %>

<% end %>
<%= f.hidden_field :user_id, :value => params[:user_id] if !params[:user_id].blank? %> <%= f.submit t('submit'), class: 'btn btn-primary' %> <%= link_to t('cancel'), request.referer, :class=>"btn" %>