Preview now can be use at both ad_banner and ad_image,however it won't run correctly if user change its ad_banner at ad_image.

This commit is contained in:
Matthew K. Fu JuYuan authored and Christophe Vilayphiou committed 2012-04-23 14:07:13 +08:00
1 parent e353afb5ac
commit 81b0046f42
8 files changed
+11 -14

No files matched your search

@@ -1,4 +1,3 @@
<script type="text/javascript" src="/static/jquery.cycle.all.latest.js"></script>
<div class="tab-pane <%= "active" if ad_banner_tab==@active %>" id=<%= ad_banner_tab.title %>>
<p><%= t("admin.ad.banner_best_size") %>:</p>
@@ -13,7 +12,7 @@
<%= render :partial => "ad_image_update", :collection => ad_banner_tab.ad_images,:as => :ad_image,:locals=>{:ad_banner => ad_banner_tab} %>
<%#= render :partial => 'new_add_banner_file', :object => ad_banner_tab.ad_images.build, :locals => { :field_name => "new_ad_images[]", :f => f, :classes => "r_destroy" } %>
<%= link_to t("admin.ad.new_image"),new_admin_ad_banner_ad_image_path(ad_banner_tab) ,:class => "btn btn-primary"%>
<%= link_to t("modal.preview"), realtime_preview_admin_ad_banner_path(ad_banner_tab) , :class=>'preview_trigger btn btn-success'%>
<%= link_to t("modal.preview"), admin_realtime_preview_ad_banner_path(ad_banner_tab.title) , :class=>'preview_trigger btn btn-success'%>
</div>
<% end -%>
@@ -44,9 +44,6 @@ $('#new_ad_banner_tab_but').on('shown', function (e) {
$('#new-a-banner').modal({show: true});
})
$('#new-a-banner').on('shown', function (e) {
alert('show!');
})
$('#new-a-banner').on('hidden', function (e) {
$(".nav.nav-tabs a[id!='new_ad_banner_tab_but']:last").tab('show');
@@ -2,6 +2,7 @@
<%#= stylesheet_link_tag "admin/ad_banner_preview" %>
<% end -%>
<% content_for :page_specific_css do -%>
<%= javascript_include_tag "/static/jquery.cycle.all.latest.js" %>
<%= javascript_include_tag "inc/modal-preview" %>
<% end -%>
+4 -3
View File
@@ -5,6 +5,7 @@
<%= javascript_include_tag "lib/datepicker" %>
<%= javascript_include_tag "lib/date.format" %>
<%= javascript_include_tag "inc/modal-preview" %>
<%= javascript_include_tag "/static/jquery.cycle.all.latest.js" %>
<% end %>
@@ -187,9 +188,9 @@
</div>
<!--Post End-->
<div class="form-actions">
<%= link_to t("modal.preview"), realtime_preview_admin_ad_banner_path(@ad_image.ad_banner) ,:class=>"preview_trigger btn btn-success" rescue nil%>
<button class="btn btn-primary" type="submit"><%= t("submit")%></button>
<button class="btn" type="reset"><%= t("cancel")%></button>
<%= link_to t("modal.preview"), admin_realtime_preview_ad_banner_path(@ad_image.ad_banner.title) ,:class=>"preview_trigger btn btn-success" rescue nil%>
<%= f.submit t("submit"),:class=>"btn btn-primary" %>
<%= f.submit t("cancel"),:class=>"btn ",:type => 'reset' %>
</div>
</form>
</div>