Sha256: e764203c8b1cf5caf6d3d0dcd7d0c589b52938002dfa955eb7ddc4bd94ec02bd

Contents?: true

Size: 1.74 KB

Versions: 3

Compression:

Stored size: 1.74 KB

Contents

<% page_title "Выбрать страницу" %>

<div class="tree-select-page-widget">
<%
    table @page_nodes, style: 'smart-tree-table', lang: @select_lang, html_params: { id: 'treeSelectPage' } do
        column :publication_state, label: '' do |p|
            admin_pages_publication_state_as_icon( p, options[:lang] )
        end
        column :name, label: 'Name' do |p|
          admin_pages_title_as_text( p, options[:lang] )
        end
    end
%>
</div>

<% form nil, html_params: { class: 'select-page-form' } do %>
<%= button :cancel %>
<%= button :select, onclick: "on_click_select();", id: "btn-select-page", disabled: true %>
<% end %>

<script type="text/javascript">
var tree = null;

$(function(){
    tree = new SmartTreeTable( $("#treeSelectPage").first(), {
        column: 2,
        on_select: on_page_select,
        prefix: {
            branch: {
                expanded: '<i class="prefix-expanded fa fa-caret-down"></i>',
                collapsed: '<i class="prefix-collapsed fa fa-caret-right"></i>'
            }
        }

    });
    var selected_page_node_id = '<%= @select_page_node_id %>';
    if ( selected_page_node_id ) {
        tree.select( selected_page_node_id );
        tree.expand( selected_page_node_id );
    } else {
        // expand root
        tree.expand( '<%= PageNode.root.id %>' );
    }
});

var page_id = null;
var page_label = null;

function on_page_select( id, object, el ) {
    $("#btn-select-page").removeAttr('disabled');
    page_node_id = id;
    page_label = object.contents;
}
function on_click_select() {
    console.log("clicked Select: id:"+page_node_id+" label: '"+page_label+"'" );
    admin_modal_select_and_close( { page_node_id: page_node_id, page_label: page_label } );
    return false;
}
</script>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
aerogel-pages-1.4.16 views/admin/pages/edit/select_page.html.erb
aerogel-pages-1.4.14 views/admin/pages/edit/select_page.html.erb
aerogel-pages-1.4.12 views/admin/pages/edit/select_page.html.erb