Class: Lcms::Engine::CurriculumPresenter

Inherits:
Object
  • Object
show all
Defined in:
app/presenters/lcms/engine/curriculum_presenter.rb

Overview

Simple presenter for Curriculum (resources tree)

Constant Summary collapse

UNIT_LEVEL =
Lcms::Engine::Resource.hierarchy.index(:unit)

Instance Method Summary collapse

Instance Method Details

#editor_propsObject



9
10
11
12
13
# File 'app/presenters/lcms/engine/curriculum_presenter.rb', line 9

def editor_props
  @editor_props ||= {
    form_url: routes.admin_curriculum_path
  }
end

#parse_jstree_node(node) ⇒ Object



15
16
17
18
19
20
21
22
# File 'app/presenters/lcms/engine/curriculum_presenter.rb', line 15

def parse_jstree_node(node)
  {
    id: node.id,
    text: element_text(node),
    children: node.children.any?,
    li_attr: { title: node.title }
  }
end

#routesObject



24
25
26
# File 'app/presenters/lcms/engine/curriculum_presenter.rb', line 24

def routes
  Lcms::Engine::Engine.routes.url_helpers
end