have done multiple file

This commit is contained in:
Rueshyna 2012-11-29 12:13:56 +08:00 committed by chris
parent 4a0cc61852
commit d806e8cf82
2 changed files with 7 additions and 23 deletions

View File

@ -244,7 +244,7 @@
$(this).parents('table').append(("<%= escape_javascript(add_attribute 'form_file', f, :writing_journal_files) %>").replace(old_id, new_id));
});
$('.add_plugin_files_block a.delete').live('click', function(){
$('.action a.delete').live('click', function(){
$(this).parents('.list_item').remove();
});

View File

@ -1,28 +1,12 @@
<tr id="<%= "plugin_file_#{form_file.id}" if !form_file.new_record? %>" class='list_item'>
<tr id="<%= "plugin_file_#{form_file.id}" if !form_file.new_record? %>" class="list_item">
<td>
<div class="control-group">
<div class="controls">
<div>
<%= f.file_field :file, class: "s_grid_1 s_grid" %>
<%= form_file.file.file ? ( link_to t(:view), form_file.file.url, {:class => 'btn s_grid_1 s_grid', :target => '_blank', :title => t(:view)} ) : '' %>
</div>
</div>
</td>
<td>
<div class="tab-content">
<% @site_valid_locales.each_with_index do |locale, i| %>
<div class="<%= locale %> fade tab-pane <%= ( i == 0 ) ? "in active" : '' %>">
<%= f.fields_for :file_title_translations do |f| %>
<div class="control-group">
<label for="link-<%= locale %>" class="control-label"><%= I18nVariable.from_locale(locale) %></label>
<div class="controls">
<%= f.text_field locale, :class=>'s_grid_1 s_grid', :value => (form_file.file_title_translations[locale] rescue nil) %>
</div>
</div>
<% end %>
</div>
<% end %>
</div>
<%= f.text_field :title, :class=>'s_grid_1 s_grid' %>
</td>
<td>