From ead3a47243926746afe252d77147a59b1a204f5c Mon Sep 17 00:00:00 2001 From: Rueshyna Date: Thu, 29 Nov 2012 12:13:56 +0800 Subject: [PATCH] have done multiple file --- .../desktop/journal_pages/_form.html.erb | 2 +- .../desktop/journal_pages/_form_file.html.erb | 28 ++++--------------- 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/app/views/desktop/journal_pages/_form.html.erb b/app/views/desktop/journal_pages/_form.html.erb index 5eb26a76..05ba4219 100644 --- a/app/views/desktop/journal_pages/_form.html.erb +++ b/app/views/desktop/journal_pages/_form.html.erb @@ -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(); }); diff --git a/app/views/desktop/journal_pages/_form_file.html.erb b/app/views/desktop/journal_pages/_form_file.html.erb index 29d21664..afba08b7 100644 --- a/app/views/desktop/journal_pages/_form_file.html.erb +++ b/app/views/desktop/journal_pages/_form_file.html.erb @@ -1,35 +1,19 @@ -" class='list_item'> +" class="list_item"> -
-
- <%= 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)} ) : '' %> -
+
+ <%= 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)} ) : '' %>
- -
- <% @site_valid_locales.each_with_index do |locale, i| %> -
"> - <%= f.fields_for :file_title_translations do |f| %> -
- -
- <%= f.text_field locale, :class=>'s_grid_1 s_grid', :value => (form_file.file_title_translations[locale] rescue nil) %> -
-
- <% end %> -
- <% end %> -
+ <%= f.text_field :title, :class=>'s_grid_1 s_grid' %> <% if form_file.new_record? %> - <% else %> + <% else %> <%= f.hidden_field :id %> <%= f.hidden_field :should_destroy, :value => nil, :class => 'should_destroy' %>