<% height = 140 %>
<% @banners.each_with_index do |banner,i| %> <% if (i+1)%3==1 %>
<% end %>
<%= banner.title %>
<% if !banner.ad_images.can_display.blank? %> <% banner.ad_images.can_display.desc(:created_at).each do |image| %> <% if image.exchange_item == '1' %>
<% elsif image.video_snapshot %>
<% elsif image.exchange_item == '2' %>
<% end %> <% end %> <% else %>
<% end %>
<% if can_edit_or_delete?(banner) %> <% end %>
<%= t("ad_banner.size") %> : <%= banner.size %> <%= t("ad_banner.effect") %> : <%= banner.ad_fx %> <%= t("ad_banner.transition_interval") %> : <%= banner.timeout %> <%= t("ad_banner.transition_speed") %> : <%= banner.speed %>
<% if can_edit_or_delete?(banner) && current_user.is_admin? or current_user.is_manager?(@module_app) or current_user.is_sub_manager?(@module_app) %>
<%= t("ad_banner.new_image") %> <% banner.ad_images.desc(:created_at).each_with_index do |image,idx| %>
<% if image.exchange_item == '1' %>
" style="background: url('<%= image.file.thumb.url %>'); background-size: cover; background-position: center;"> <% if image.expired? %>
<%= t("ad_banner.expired") %>
<% end %> <% if (image.postdate > Time.now rescue false) %>
<%= t("start_date")+': '+(format_value image.postdate) %>
<% end %> <%= t('image') %> <%= t(:edit) %> <%= t(:delete_) %>
<% else %>
" style="background: url('https://img.youtube.com/vi/<%= image.youtube.to_s[-11,11] %>/hqdefault.jpg'); background-size: cover; background-position: center;"> <% if image.expired? %>
<%= t("ad_banner.expired") %>
<% end %> <% if (image.postdate > Time.now rescue false) %>
<%= t("start_date")+': '+(format_value image.postdate) %>
<% end %> <%= t('video') %> <%= t(:edit) %> <%= t(:delete_) %>
<% end %>
<%= t("title") %> : <%= image.title %>
<%= t("start_date") %> : <%= format_value image.postdate %>
<%= t("end_date") %> : <%= format_value image.deadline %>
<%= t("link") %> : <%= image.out_link rescue " " %>
<% end %>
<% end %>
<% if ((i+1)%3==0) or (i+1 == @banners.count) %>

<% end %> <% end %>