personal-journal1/app/views/admin/journal_papers/_form_file.html.erb

45 lines
2.0 KiB
Plaintext
Raw Permalink Normal View History

2014-06-12 10:27:26 +00:00
<% if form_file.new_record? %>
<div class="fileupload fileupload-new start-line" data-provides="fileupload">
<% else %>
<div class="fileupload fileupload-exist start-line" data-provides="fileupload">
<% if form_file.journal_file.blank? %>
<%= t(:no_file) %>
<% else %>
2014-08-11 11:16:52 +00:00
<%= link_to content_tag(:i) + form_file.journal_file_identifier, form_file.journal_file.url, {:class => 'file-link file-type', :target => '_blank', :title => form_file.journal_file_identifier} %>
2014-06-12 10:27:26 +00:00
<% end %>
<% end %>
<div class="input-prepend input-append">
<label>
<span class="add-on btn btn-file" title='<%= t(:file_) %>'>
<i class="icons-paperclip"></i>
<%= f.file_field :journal_file %>
</span>
<div class="uneditable-input input-medium">
<i class="icon-file fileupload-exists"></i>
<span class="fileupload-preview"><%= (form_file.new_record? || form_file.journal_file.blank?) ? t(:select_file) : t(:change_file) %></span>
</div>
</label>
<span class="add-on icons-pencil" title='<%= t(:alternative) %>'></span>
<span class="tab-content">
<% @site_in_use_locales.each_with_index do |locale, i| %>
<span class="tab-pane fade <%= ( i == 0 ) ? "in active" : '' %> <%= locale %>">
<%= f.fields_for :title_translations do |f| %>
<%= f.text_field locale, :class => "input-medium", placeholder: t(:alternative), :value => (form_file.title_translations[locale] rescue nil) %>
<% end %>
</span>
<% end %>
</span>
</span>
<% if form_file.new_record? %>
<span class="delete_file add-on btn" title="<%= t(:delete_) %>">
<a class="icon-trash"></a>
</span>
<% else %>
<span class="remove_existing_record add-on btn" title="<%= t(:remove) %>">
<%= f.hidden_field :id %>
<a class="icon-remove"></a>
2019-08-19 07:31:04 +00:00
<%= f.hidden_field :_destroy, :value => nil, :class => 'should_destroy' %>
2014-06-12 10:27:26 +00:00
</span>
<% end %>
</div>
</div>