Sha256: eb948fd098461875e439f5ef19449fc5fb65faa028851807da3bc7a2fbd1685c
Contents?: true
Size: 1.06 KB
Versions: 14
Compression:
Stored size: 1.06 KB
Contents
module Udongo::Pages class TreeNode # Context should contain accessible routes. def initialize(context, page) @context = context @page = page end def data { text: @page.description, type: :file, li_attr: list_attributes, data: { id: @page.id, url: @context.edit_backend_page_path(@page), delete_url: @context.backend_page_path(@page, format: :json), deletable: @page.deletable?, draggable: @page.draggable?, update_position_url: @context.tree_drag_and_drop_backend_page_path(@page), visible: @page.visible?, toggle_visibility_url: @context.toggle_visibility_backend_page_path(@page, format: :json) }, children: [] # This gets filled through Udongo::Pages::Tree } end def list_attributes return if @page.visible? { class: 'jstree-node-invisible', title: I18n.t('b.msg.pages.invisible') } end def state { selected: false } end end end
Version data entries
14 entries across 14 versions & 1 rubygems