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/module-area" %>
|
|
|
|
<%= javascript_include_tag "validator" %>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<fieldset>
|
|
|
|
<div class="input-area">
|
|
|
|
<input type="hidden" name="chapter[journal_id]" value="<%= @journal.id.to_s %>">
|
|
|
|
<!-- File Upload -->
|
|
|
|
<div class="control-group">
|
|
|
|
<label class="control-label muted"><%= t('chapter.file') %></label>
|
|
|
|
<div class="controls">
|
|
|
|
<div class="fileupload fileupload-new clearfix <%= 'fileupload-edit' if @chapter.file.file %>" data-provides="fileupload">
|
|
|
|
<div class="fileupload-preview fileupload-exists thumbnail pull-left"></div>
|
|
|
|
<span class="btn btn-file">
|
|
|
|
<span class="fileupload-new"><%= t('chapters.select_file') %></span>
|
|
|
|
<span class="fileupload-exists"><%= t(:change) %></span>
|
|
|
|
<%= f.file_field :file %>
|
|
|
|
</span>
|
|
|
|
<a href="#" class="btn fileupload-exists" data-dismiss="fileupload"><%= t(:cancel) %></a>
|
|
|
|
<div class="controls" data-toggle="buttons-checkbox">
|
|
|
|
<label class="checkbox inline btn btn-danger fileupload-remove">
|
|
|
|
<%= f.check_box :remove_file %><%= t(:remove) %>
|
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<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>
|
|
|
|
|
|
|
|
<% @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: 'long'}%>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<%= render partial: 'form_text_org', locals: {f: f, node: :page} %>
|
|
|
|
|
|
|
|
<% @site_in_use_locales.each_with_index do |locale, i| %>
|
|
|
|
<div class="<%= locale %> fade tab-pane <%= ( i == 0 ) ? "in active" : '' %>">
|
2018-10-04 05:29:27 +00:00
|
|
|
<%= render partial: 'form_text_locale', locals: {f: f, node: :author, locale: locale, style: 'long'}%>
|
|
|
|
<%= render partial: 'form_text_area', locals: {f: f, node: :author_description, locale: locale} %>
|
2018-10-04 02:47:23 +00:00
|
|
|
<%= render partial: 'form_text_area', locals: {f: f, node: :text, locale: locale} %>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
</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">
|
|
|
|
.tab-pane.active {
|
|
|
|
display: block;
|
|
|
|
}
|
|
|
|
.tab-pane {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
input, textarea, .uneditable-input {
|
|
|
|
width: 300px;
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
var form = new FormValidator($("#new_chapter"));
|
|
|
|
</script>
|