<% # 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 %>
<% if !params[:user_id].blank? %>
<%= User.from_id(params[:user_id]).name rescue ''%>
<% end %>
<%= select_year((@journal_paper.year ? @journal_paper.year.to_i : DateTime.now.year), {:start_year => DateTime.now.year, :end_year => 1930}, {:name => 'journal_paper[year]', :class => "span1"} ) %>
<%= f.select :language, @site_valid_locales, :prompt => 'Select', :class => "span3" %>
<% @journal_levels.each do |level_type| %> <%= content_tag :label,:class => "checkbox inline" do -%> <%= check_box_tag 'journal_paper[journal_level_ids][]', level_type.id, @journal_paper.journal_level_ids.include?(level_type.id)%> <%= level_type.title %> <%= hidden_field_tag 'journal_paper[journal_level_ids][]', '' %> <% end %> <% end %>
<%= f.select :journal_paper_type_id, @paper_types.collect {|t| [ t.title, t.id ]}, :class => "span3" %>
<%= f.text_field :member_profile_id, id: "search", autocomplete: "off", data: { provide: "typeahead"}, class: "input-block-level", value: (@journal_paper.member_profile.name rescue nil), placeholder: t("personal_journal.author")%> <%= f.hidden_field :member_profile_id, value: (@journal_paper.member_profile_id ? @journal_paper.member_profile_id : ""), id: "member_value" %>
<% @author_types.each do |author_type| %> <%= content_tag :label,:class => "checkbox inline" do -%> <%= check_box_tag 'journal_paper[journal_paper_author_type_ids][]', author_type.id, @journal_paper.journal_paper_author_ids.include?(author_type.id)%> <%= author_type.title %> <%= hidden_field_tag 'journal_paper[journal_paper_author_type_ids][]', '' %> <% end %> <% end %>
<%= f.text_field :vol_no %>
<%= f.text_field :issue_no %>
<%= f.text_field :form_to_start, :class=>'span1' %> ~ <%= f.text_field :form_to_end, :class=>'span1' %>
<%= f.text_field :total_pages %>
<%= f.text_field :isbn %>
<%= f.text_field :keywords %>
<%= f.datetime_picker :publication_date, :no_label => true %>
<%= f.text_field :url , :class => "span6" %>
<%= f.text_area :abstract, rows: 2, class: "input-block-level" %>
<%= f.text_area :note, rows: 2, class: "input-block-level" %>
<% @site_in_use_locales.each_with_index do |locale, i| %>
">
<%= f.fields_for :paper_title_translations do |f| %> <%= f.text_field locale, class: "input-block-level", placeholder: t("personal_journal.paper_title"), value: (@journal_paper.paper_title_translations[locale] rescue nil) %> <% end %>
<%= f.fields_for :journal_title_translations do |f| %> <%= f.text_field locale, class: "input-block-level", placeholder: t("personal_journal.journal_title"), value: (@journal_paper.journal_title_translations[locale] rescue nil) %> <% end %>
<% end %>
<% if @journal_paper && !@journal_paper.journal_paper_authors.blank? %>
<% @journal_paper.journal_paper_authors.each_with_index do |author, i| %> <%= f.fields_for :journal_paper_authors, author do |f| %> <%= render :partial => 'form_author', :object => author, :locals => {:f => f, :i => i} %> <% end %> <% end %>
<% end %>

<%= t(:add) %>

<% if @journal_paper && !@journal_paper.journal_paper_files.blank? %>
<% @journal_paper.journal_paper_files.each_with_index do |writing_journal_file, i| %> <%= f.fields_for :journal_paper_files, writing_journal_file do |f| %> <%= render :partial => 'form_file', :object => writing_journal_file, :locals => {:f => f, :i => i} %> <% end %> <% end %>
<% end %>

<%= hidden_field_tag 'plugin_file_field_count', @journal_paper.journal_paper_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 %> <%= render 'author_autocomplete'%> <% end %>