Sha256: 15de4e2d972c5862b3b98970bee4d877d767616a7d46d7b83d316e11d899403b

Contents?: true

Size: 1.84 KB

Versions: 1

Compression:

Stored size: 1.84 KB

Contents

<%
  output = {
    :iTotalDisplayRecords => @pages.total_entries || 0,
    :aaData => @pages.collect do |page|
      link_id = "page_#{page.id}"
      # status = [['published', 'published'], ['draft', 'draft'], ['to validate', 'to-validate']]
      status = [[I18n.t('page.published'), 'published'], [I18n.t('page.draft'), 'draft']]

      if params[:mode] && params[:mode].eql?('menu_link')
        [
          content_tag(:div, tag(:div, :class=>'handler')+tag(:div, :class=>'small-icons page'), :id => link_id, :class => 'handler_container'),
          content_tag(:div, page.title, :class => 'page-name'),
          page.id,
          link_to(page.title, [forgeos_cms, :admin, page])
        ]
      else
        [
          content_tag(:div, tag(:div, :class=>'handler')+tag(:div, :class=>'small-icons page'), :id => link_id, :class => 'handler_container'),
          content_tag(:div, link_to(page.title, [forgeos_cms, :admin, page]), :class => 'page-name'),
          '',
          '',
          page.updated_at.to_s,
          select_tag(:status, options_for_select(status, page.active ? 'published' : 'draft'), :class => 'customize published', :onchange => "jQuery.ajax({url: '#{forgeos_cms.activate_admin_page_path(page)}', data: { active: this.value }});"),
          link_to('', [forgeos_cms, :duplicate, :admin, page], :class => 'small-icons duplicate-link') +
          link_to('', [forgeos_cms, :edit, :admin, page], :class => 'small-icons edit-link') +
          link_to('', "jQuery.ajax(url: '#{url_for([forgeos_cms, :admin, page])}',\
              method: 'delete',
              confirm: '#{I18n.t('page.destroy.confirm').capitalize}',
              success: removedataTablesRow('#destroy_#{link_id}')});",
              :class => 'small-icons destroy-link', :id => "destroy_#{link_id}"
          )
        ]
      end
    end
  }
-%>
<%= raw output.to_json -%>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
forgeos_cms-1.9.0 app/views/admin/pages/index.json.erb