Fix mobile page 500 error when there's no adbanner named "Home"
This commit is contained in:
parent
7da24174db
commit
73fcefca97
|
@ -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">
|
<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| %>
|
<% @ad_banner.ad_images.can_display.each do |image| %>
|
||||||
<%= image_tag image.file.url, width: @ad_banner.width, height: @ad_banner.height %>
|
<%= image_tag image.file.url, width: @ad_banner.width, height: @ad_banner.height %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<div class="newlist clear">
|
<div class="newlist clear">
|
||||||
<% @bulletins.each do |bulletin| %>
|
<% @bulletins.each do |bulletin| %>
|
||||||
<div class="newitem">
|
<div class="newitem">
|
||||||
|
@ -17,6 +20,8 @@
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<% unless @ad_banner.nil? %>
|
||||||
<script type='text/javascript'>
|
<script type='text/javascript'>
|
||||||
$(function(){
|
$(function(){
|
||||||
if($("#slideshow-<%= @ad_banner.title.dehumanize %> img").length > 1){
|
if($("#slideshow-<%= @ad_banner.title.dehumanize %> img").length > 1){
|
||||||
|
@ -33,3 +38,4 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
<% end %>
|
||||||
|
|
Loading…
Reference in New Issue