<% # 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" %> <% end %> <% content_for :page_specific_javascript do %> <%= javascript_include_tag "lib/bootstrap-fileupload" %> <%= javascript_include_tag "lib/file-type" %> <%= javascript_include_tag "lib/module-area" %> <%= javascript_include_tag "lib/bootstrap-datetimepicker.js" %> <%= javascript_include_tag "lib/bootstrap-typeahead.js" %> <%= javascript_include_tag "lib/datetimepicker/date.time.picker.js" %> <%= javascript_include_tag "lib/datetimepicker/datetimepicker" %> <% end %>
<%= @member.name rescue ''%> <%= f.hidden_field :member_profile_id, :value => @member.id if !@member.nil? %>
<% @author_types.each do |author_type| %> <%= content_tag :label,:class => "checkbox inline" do -%> <%= check_box_tag 'book[book_author_type_ids][]', author_type.id, @book.book_author_type_ids.include?(author_type.id)%> <%= author_type.title %> <% end %> <% end %>
<%= f.text_field :number_of_authors, :class=>'span1' %>
<%= f.select :book_type_id, @book_types.collect {|t| [ t.title, t.id ]} %>
<%= select_year((@book.year ? @book.year.to_i : DateTime.now.year), {:start_year => DateTime.now.year, :end_year => 1930}, {:name => 'book[year]',:class => 'span1'} ) %>
<%= f.datetime_picker :publish_date, :no_label => true,:format=>"yyyy/MM/dd", :placeholder=>"YYYY/MM/DD" %>
<%= f.datetime_picker :publication_date, :no_label => true,:format=>"yyyy/MM/dd", :placeholder=>"YYYY/MM/DD" %>
<%= f.text_field :url , :class => "span6" %>
<%= f.text_field :keywords %>
<%= f.text_field :pages %>
<%= f.text_field :isbn %>
<%= f.text_area :note, rows: 2, class: "input-block-level" %>
<% @site_in_use_locales.each_with_index do |locale, i| %>
">
<%= f.fields_for :book_title_translations do |f| %> <%= f.text_field locale, class: "input-block-level", placeholder: t("personal_book.book_title"), value: (@book.book_title_translations[locale] rescue nil) %> <% end %>
<%= f.fields_for :extracted_chapters_translations do |f| %> <%= f.text_field locale, class: "input-block-level", placeholder: t("personal_book.extracted_chapters"), value: (@book.extracted_chapters_translations[locale] rescue nil) %> <% end %>
<%= f.fields_for :publisher_translations do |f| %> <%= f.text_field locale, class: "input-block-level", placeholder: t("personal_book.publisher"), value: (@book.publisher_translations[locale] rescue nil) %> <% end %>
<%= f.fields_for :editor_translations do |f| %> <%= f.text_field locale, class: "input-block-level", placeholder: t("personal_book.editor"), value: (@book.editor_translations[locale] rescue nil) %> <% end %>
<% end %>
<%= f.fields_for :authors_translations do |f| %> <%= f.text_area locale, class: "input-block-level", placeholder: t("personal_book.authors"), value: (@book.authors_translations[locale] rescue nil) %> <% end %>
<% if @book && !@book.book_files.blank? %>
<% @book.book_files.each_with_index do |book_file, i| %> <%= f.fields_for :book_files, book_file do |f| %> <%= render :partial => 'form_file', :object => book_file, :locals => {:f => f, :i => i} %> <% end %> <% end %>
<% end %>

<%= hidden_field_tag 'plugin_file_field_count', @book.book_files.count %> <%= t(:add) %>

<%= f.submit t('submit'), class: 'btn btn-primary' %> <%= link_to t('cancel'), get_go_back, :class=>"btn" %>
<% content_for :page_specific_javascript do %> <% end %>