2022-01-26 06:05:57 +00:00
|
|
|
<% if form_file.nil? %>
|
2019-11-15 00:44:28 +00:00
|
|
|
<div class="fileupload fileupload-new start-line" data-provides="fileupload">
|
|
|
|
<% else %>
|
|
|
|
<div class="fileupload fileupload-exist start-line" data-provides="fileupload">
|
2022-01-26 06:05:57 +00:00
|
|
|
<% if form_file.temp_file.blank? %>
|
2019-11-15 00:44:28 +00:00
|
|
|
<%= t(:no_file) %>
|
|
|
|
<% else %>
|
2022-01-26 06:05:57 +00:00
|
|
|
<%= link_to content_tag(:i) + form_file.file_identifier, form_file.temp_file.url, {:class => 'file-link file-type', :target => '_blank', :title => form_file.file_identifier} %>
|
2019-11-15 00:44:28 +00:00
|
|
|
<% end %>
|
|
|
|
<% end %>
|
2022-01-26 06:05:57 +00:00
|
|
|
<%= f.fields_for key do |f|%>
|
2019-11-15 00:44:28 +00:00
|
|
|
<div class="input-prepend input-append">
|
|
|
|
<label>
|
|
|
|
<span class="add-on btn btn-file" title='<%= t(:file_) %>'>
|
|
|
|
<i class="icons-paperclip"></i>
|
2022-01-26 06:05:57 +00:00
|
|
|
<%= f.file_field :temp_file %>
|
2019-11-15 00:44:28 +00:00
|
|
|
</span>
|
|
|
|
<div class="uneditable-input input-medium">
|
|
|
|
<i class="icon-file fileupload-exists"></i>
|
2022-01-26 06:05:57 +00:00
|
|
|
<span class="fileupload-preview"><%= (form_file.nil? || form_file.temp_file.blank?) ? t(:select_file) : t(:change_file) %></span>
|
2019-11-15 00:44:28 +00:00
|
|
|
</div>
|
|
|
|
</label>
|
|
|
|
</span>
|
2022-01-26 06:05:57 +00:00
|
|
|
<% if !form_file.nil? %>
|
2019-11-15 00:44:28 +00:00
|
|
|
<span class="remove_existing_record add-on btn" title="<%= t(:remove) %>">
|
2022-01-26 06:05:57 +00:00
|
|
|
<%= f.hidden_field :id,:value=>(form_file.id) %>
|
2019-11-15 00:44:28 +00:00
|
|
|
<a class="icon-remove"></a>
|
|
|
|
<%= f.hidden_field :_destroy, :value => nil, :class => 'should_destroy' %>
|
|
|
|
</span>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
2022-01-26 06:05:57 +00:00
|
|
|
</div>
|
|
|
|
<% end %>
|