<% set_default_index do 
  objects @ad_banners
  quick_edit_link type: 'edit',
                  class: 'open-slide',
                  data: "{form: {"
                        .concat("width: object.width")
                        .concat(", height: object.height")
                        .concat(", ad_fx: object.ad_fx")
                        .concat(", name: object.title")
                        .concat(", timeout: object.timeout")
                        .concat(", speed: object.speed")
                        .concat("}.to_json")
                        .concat(", title: t('ad_banner.edit_banner')")
                        .concat(", id: object.id.to_s")
                        .concat(", fx: object.ad_fx")
                        .concat("}")

                        # '{"#first":{"equal":"Yes"}}'
  quick_edit_link type: 'detail'
  quick_edit_link type: 'delete',
                  link: 'admin_ad_banner_path'
                  # can have: title, warning, cancel and submit values
  field db_field: 'title',
        translation: 'ad_banner.banner_name',
        sort: 'title',
        quick_edit: true,
        header_class: 'span4',
        sort: 'title'
  field db_field: 'ad_fx',
        translation: 'ad_banner.effect',
        hide: 'phone',
        sort: 'effect'
  field db_field: 'timeout',
        translation: 'ad_banner.transition_interval',
        hide: 'phone',
        sort: 'timeout'
  field db_field: 'speed',
        translation: 'ad_banner.transition_speed',
        hide: 'phone',
        sort: 'speed'
  field db_field: 'size',
        translation: 'ad_banner.size',
        hide: 'phone',
        sort: 'size'
  field type: 'standalone',
        translation: 'preview',
        display_option: "link_to(t(:preview), '#', data: {w: object.width, h: object.height, fx: object.ad_fx, time: object.timeout_millisecond, speed: object.speed, name: object.title}, class: 'btn btn-success open-modal')",
        need_value: true,
        hide: 'phone'
  footer 	link: '',
  				link_class: 'btn btn-primary open-slide',
  				link_data: {title: t('ad_banner.new_banner'), id: 'new', fx: 'fade'}	
end %>

<%= render 'admin/default_index/index' %>

<% content_for :page_specific_javascript do %>
  <%= javascript_include_tag "cycle2" %>
  <%= javascript_include_tag "lib/ad_banner/banner_preview" %>
<% end %>

<div id="preview" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="ModalLabel" aria-hidden="true">
    <div class="modal-header">
      <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
      <h3 id="ModalLabel"><%= t(:preview) %></h3>
    </div>
    <div class="modal-body">
      <div class="preview">
          <%= image_tag "slideshow_preview_A.png", class: 'hide' %>
          <%= image_tag "slideshow_preview_B.png", class: 'hide' %>
      </div>
    </div>
    <div class="modal-footer">
    </div>
</div>