33 lines
1.3 KiB
Plaintext
33 lines
1.3 KiB
Plaintext
<% if form_file.nil? %>
|
|
<div class="fileupload fileupload-new start-line" data-provides="fileupload">
|
|
<% else %>
|
|
<div class="fileupload fileupload-exist start-line" data-provides="fileupload">
|
|
<% if form_file.temp_file.blank? %>
|
|
<%= t(:no_file) %>
|
|
<% else %>
|
|
<%= 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} %>
|
|
<% end %>
|
|
<% end %>
|
|
<%= f.fields_for key do |f|%>
|
|
<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 :temp_file %>
|
|
</span>
|
|
<div class="uneditable-input input-medium">
|
|
<i class="icon-file fileupload-exists"></i>
|
|
<span class="fileupload-preview"><%= (form_file.nil? || form_file.temp_file.blank?) ? t(:select_file) : t(:change_file) %></span>
|
|
</div>
|
|
</label>
|
|
</span>
|
|
<% if !form_file.nil? %>
|
|
<span class="remove_existing_record add-on btn" title="<%= t(:remove) %>">
|
|
<%= f.hidden_field :id,:value=>(form_file.id) %>
|
|
<a class="icon-remove"></a>
|
|
<%= f.hidden_field :_destroy, :value => nil, :class => 'should_destroy' %>
|
|
</span>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
<% end %> |