.page-header
.row
.col-md-6
%h1
Page Templates
%small
edit page templates
.col-md-4
=link_to 'New template', new_template_path(:parent_id=>@parent_id), :class=>'btn btn-sm btn-primary'
=link_to 'Attach template', newattach_templates_path(:parent_id=>@parent_id), :class=>'btn btn-sm btn-primary'
=link_to 'New folder', newfolder_templates_path(:parent_id=>@parent_id, :is_folder=>1), :class=>'btn btn-sm btn-default'
.filter
= form_tag(search_templates_url(:action=>'index'), method: "post", :class=>'form-inline', :name=>'formFilter', :id=>'formFilter') do
= hidden_field_tag 'cmd', 'apply'
= render :partial=>'tableview/filter_fields', :locals => {:filter=>@filter}
= render :partial=>'tableview/buttons_apply_clear', :locals => {:filter=>@filter}
- if @parent
=link_to 'HOME', templates_path(:parent_id=>0)
#{"/"}
- @parent.ancestors.each do |r|
=link_to r.title, templates_path(:parent_id=>r.id)
#{"/"}
=link_to @parent.title, templates_path(:parent_id=>@parent.id)
%table.table.table-striped.table-bordered
%tr
%th
= link_to 'Title', pages_path(:cmd=>'order', :orderby=>'title', :orderdir=>@filter.get_opposite_order_dir_for_column('title'))
%th Path
%th Commands
- @items.each do |item|
%tr
%td
- if item.is_folder
=link_to templates_path(:parent_id=>item.id) do
=item.title
- else
=link_to item.title, edit_template_path(item)
%td
=item.basepath
%td
- if !item.is_folder
=link_to 'Edit', edit_template_path(item)
=link_to 'Delete', template_path(item), :method => :delete, data: { confirm: 'Are you sure?' }
- else
=link_to 'Edit', editfolder_template_path(item)
=link_to 'Delete', template_path(item), :method => :delete, data: { confirm: 'Are you sure?' }
=paginate @items