publication/app/views/admin/journals/_form.html.erb

100 lines
3.4 KiB
Plaintext
Raw Normal View History

2018-10-04 02:47:23 +00:00
<% 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/bootstrap-datetimepicker" %>
<%= javascript_include_tag "lib/datetimepicker/datetimepicker.js" %>
<%= javascript_include_tag "lib/modal-preview" %>
<%= javascript_include_tag "lib/file-type" %>
<%= javascript_include_tag "validator" %>
<% end %>
<fieldset>
<!-- Input Area -->
<div class="input-area">
<!-- Module Tabs -->
<div class="nav-name">
<strong><%= t(:module) %></strong>
</div>
<ul class="nav nav-pills module-nav">
<li class="active">
<a href="#basic" data-toggle="tab"><%= t(:basic) %></a>
</li>
<li>
<a href="#status" data-toggle="tab"><%= t(:status) %></a>
</li>
<li>
<a href="#imageupload" data-toggle="tab"><%= t("journal.cover") %></a>
</li>
</ul>
<!-- Module -->
<%= render partial: 'module_tag', locals: {f: f} %>
<!-- Language Tabs -->
<div class="nav-name"><strong><%= t(:language) %></strong></div>
<ul class="nav nav-pills language-nav">
<% @site_in_use_locales.each_with_index do |locale, i| %>
<li <%= ( i == 0 ) ? "class=active" : '' %>><a data-toggle="tab" href=".<%= locale %>"><%= t(locale.to_s) %></a></li>
<% end %>
</ul>
<div class="tab-content language-area">
<% @site_in_use_locales.each_with_index do |locale, i| %>
<div class="<%= locale %> fade tab-pane <%= ( i == 0 ) ? "in active" : '' %>">
<%= render partial: 'form_text_locale', locals: {f: f, node: :title, locale: locale, style: nil} %>
</div>
<% end %>
<!-- Date Time Picker -->
<div class="control-group input-title">
<label class="control-label muted"><%= t 'journal.pub_date' %></label>
<div class="controls">
<%= f.datetime_picker :pub_date, no_label: true, new_record: @journal.new_record?, data: {} %>
</div>
</div>
<% @site_in_use_locales.each_with_index do |locale, i| %>
<div class="<%= locale %> fade tab-pane <%= ( i == 0 ) ? "in active" : '' %>">
<%= render partial: 'form_text_locale', locals: {f: f, node: :author, locale: locale, style: nil} %>
</div>
<% end %>
</div>
</div>
<!-- Form Actions -->
<div class="form-actions">
<input type="hidden" name="referer_url" value="<%= request.referer %>">
<%= f.submit t('submit'), class: 'btn btn-primary' %>
</div>
</fieldset>
<% content_for :page_specific_css do %>
<style media="screen">
input, textarea, .uneditable-input {
width: 300px;
}
</style>
<% end %>
<% content_for :page_specific_javascript do %>
<script>
function Appendzero(obj)
{
if(obj<10) return "0" +""+ obj;
else return obj;
}
$(function() {
if (location.pathname.substr(-3)=='new'){
var getDate = new Date();
var toDay = getDate.getFullYear()+"/"+ (Appendzero(getDate.getMonth()+1))+"/"+Appendzero(getDate.getDate())+" "+Appendzero(getDate.getHours())+":"+Appendzero(getDate.getMinutes());
$('input[name="journal[pub_date]"]').val(toDay);
}
$("#main-wrap").after("");
});
</script>
<% end %>