class Pettanr.FoldersController extends Pettanr.AppController index: () -> @filer_list() root: () -> @set_model() @item = new Pettanr.Folder.Root() _this = this @item.fetch({cache: true}).done -> _this.children_html() show_html_format: (format) -> children_html: () -> collection = new Pettanr.Folder.Children({id: @item.get('id')}) collection.fetch({cache: true}).done -> f = new Locmare.Filer({ item_name: 'folder', items: collection.models, pager: null, operators: window.operators }) $("#pettanr").html(f.render().el) show: () -> console.log(@params) id = @params['id'] if @params['format'] == 'prof' @set_show() @show_prof() else @item = new Pettanr.FolderWatch({id: id}) _this = this @item.fetch({cache: true}).done () -> if _this.item.is_remote() c = _this.item.get('controller_name') a = if Pettanr.is_blank(_this.item.get('action_name')) 'index' else _this.item.get('action_name') window.router['c_i'](c, a, '') # call action event in router for redirect else _this.children_html() count: () -> new: () -> @form_new() edit: () -> @form_edit()