backend/app/views/comable/admin/categories/index.slim
/ TODO: Move to a file.
javascript:
comable_jstree_json = #{raw @categories.to_jstree(state: { opened: true }, icon: 'fa fa-bars')};
comable_new_node_label = '#{Comable.t('admin.categories.new_node')}';
comable_action_new = '#{Comable.t('admin.actions.new')}';
comable_action_edit = '#{Comable.t('admin.actions.edit')}';
comable_action_destroy = '#{Comable.t('admin.actions.destroy')}';
comable_destroied_nodes = [];
.comable-page
.comable-main-fixed-top
.comable-page-heading
ul.pull-right.list-inline
li
= link_to_save
h1.page-header
= Comable.t('admin.nav.category')
.comable-page-body
fieldset
.col-md-3
legend
= Comable.t('admin.note')
.help-block
ul
li
= Comable.t('admin.you_can_drag_and_drop')
li
= Comable.t('admin.you_can_right_click')
li
= Comable.t('admin.link_to_add_new_node')
= link_to Comable.t('admin.actions.new'), 'javascript:void(0)', onclick: 'add_comable_jstree_node()'
.col-md-9
#comable-jstree
= form_tag comable.admin_categories_path do
.hidden
= submit_tag
= hidden_field_tag :jstree_json