Fix mobile page 500 error when there's no adbanner named "Home"
This commit is contained in:
parent
748813aae2
commit
251f539de5
|
@ -1,8 +1,11 @@
|
|||
<% unless @ad_banner.nil? %>
|
||||
<div id='slideshow-<%= @ad_banner.title.dehumanize %>' class="orbit-cycle-slideshow" data-cycle-timeout="<%= @ad_banner.timeout_millisecond %>" data-cycle-fx="<%= @ad_banner.ad_fx %>" data-cycle-random='true' style="z-index: 0">
|
||||
<% @ad_banner.ad_images.can_display.each do |image| %>
|
||||
<%= image_tag image.file.url, width: @ad_banner.width, height: @ad_banner.height %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="newlist clear">
|
||||
<% @bulletins.each do |bulletin| %>
|
||||
<div class="newitem">
|
||||
|
@ -17,6 +20,8 @@
|
|||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% unless @ad_banner.nil? %>
|
||||
<script type='text/javascript'>
|
||||
$(function(){
|
||||
if($("#slideshow-<%= @ad_banner.title.dehumanize %> img").length > 1){
|
||||
|
@ -33,3 +38,4 @@
|
|||
}
|
||||
});
|
||||
</script>
|
||||
<% end %>
|
||||
|
|
Loading…
Reference in New Issue