diff --git a/app/assets/javascripts/ad_banner.js b/app/assets/javascripts/ad_banner.js index bab55a67..e803f695 100644 --- a/app/assets/javascripts/ad_banner.js +++ b/app/assets/javascripts/ad_banner.js @@ -1,5 +1,5 @@ $("button.multi_files").live("click", function(){ - $(this).parent().prev("ul").append("
  • " + $(this).val() +'Time:'+ $(this).siblings('.ad_time').val()+'Link:'+$(this).siblings('.ad_out_link').val()+ "
  • "); + $("#new_add_banner_file_holder").append("
  • " + $(this).val() +'Time:'+ $(this).siblings('.ad_time').val()+'Link:'+$(this).siblings('.ad_out_link').val()+ "
  • "); new_node = $(this).parent().clone(); $(this).parent().css("display","none"); new_node.children('input.multi_files').val(""); diff --git a/app/views/admin/ad_banners/_ad_image_show.html.erb b/app/views/admin/ad_banners/_ad_image_show.html.erb new file mode 100644 index 00000000..e724a47f --- /dev/null +++ b/app/views/admin/ad_banners/_ad_image_show.html.erb @@ -0,0 +1,8 @@ +
    + <%= image_tag ad_image.file %> +

    + Time to next: <%= ad_image.time_to_next %> + Intro: <%= ad_image.picture_intro %> + Out Link <%= link_to ad_image.out_link %> by <%= ad_image.link_open %> +

    +
    diff --git a/app/views/admin/ad_banners/_ad_image_update.html.erb b/app/views/admin/ad_banners/_ad_image_update.html.erb index d2234ac5..e3d53b15 100644 --- a/app/views/admin/ad_banners/_ad_image_update.html.erb +++ b/app/views/admin/ad_banners/_ad_image_update.html.erb @@ -1,8 +1,9 @@ <%= fields_for "ad_banner[existing_ad_images][#{ad_image.id}]", ad_image do |f| %> -

    - Destroy?<%= f.check_box :to_destroy %> - <%= render :partial => "ad_image_form", :locals => { :f => f } %> -

    + <%= image_tag ad_image.file %> +
    + Destroy?<%= f.check_box :to_destroy %> + <%= render :partial => "ad_image_form", :locals => { :f => f } %> +
    <% end %> diff --git a/app/views/admin/ad_banners/_form.html.erb b/app/views/admin/ad_banners/_form.html.erb index 619bed11..c29d9aef 100644 --- a/app/views/admin/ad_banners/_form.html.erb +++ b/app/views/admin/ad_banners/_form.html.erb @@ -1,8 +1,6 @@ <% content_for :page_specific_css do %> - <%= stylesheet_link_tag "ad_banner" %> -<% end %> -<% content_for :page_specific_javascript do %> - <%= javascript_include_tag "ad_banner" %> + <%#= javascript_include_tag "ad_banner" #this line wont work %> + <% end %> @@ -38,12 +36,13 @@ <%= f.select :ad_fx ,AdBanner::FX_TYPES %>

    - <%= f.label :ad_images, t('admin.ad_images') %> -

    + <%#= f.label :ad_images, t('admin.ad_images') %> + + <%# @ad_banner.ad_images.each do |ad_image| %> + <%#= render :partial => 'ad_image_update', :object => ad_image, :locals => { :field_name => "ad_images", :f => f, :classes => "r_destroy, r_edit" } %> + <%# end %> + <%= render :partial => "ad_image_update", :collection => @ad_banner.ad_images,:as => :ad_image, %> + <%= render :partial => 'new_add_banner_file', :object => @ad_banner.ad_images.build, :locals => { :field_name => "new_ad_images[]", :f => f, :classes => "r_destroy" } %>

    diff --git a/app/views/admin/ad_banners/show.html.erb b/app/views/admin/ad_banners/show.html.erb index 35deffa2..1af4a50e 100644 --- a/app/views/admin/ad_banners/show.html.erb +++ b/app/views/admin/ad_banners/show.html.erb @@ -10,9 +10,8 @@
  • <%=t('admin.ad_banner.unpost_date') %> <%= @ad_banner.unpost_date %>
  • <%=t('admin.ad_banner.context') %> <%= @ad_banner.context %>
  • <%=t('admin.ad_banner.direct_to_after_click') %> <%= @ad_banner.direct_to_after_click %>
  • -
  • <%=t('admin.ad_banner.ad_style') %> <%= @ad_banner.ad_style %>
  • - +
  • <%=t('admin.ad_banner.ad_fx') %> <%= @ad_banner.ad_fx %>
  • - <%= render :partial => "admin/ad_banners/ad_image", :collection => @ad_banner.ad_images %> + <%= render :partial => "admin/ad_banners/ad_image_show", :collection => @ad_banner.ad_images,:as => :ad_image %>