def root
set_model
@item = Folder.root
- respond_to do |format|
- show_html_format format
- show_json_format format
+ if params[:ref]
+ respond_to do |format|
+ show_json_format format
+ end
+ else
+ respond_to do |format|
+ children_html_format format
+ children_json_format format
+ end
end
end
filer_list
end
- def show_html_format format
+ def children_html_format format
format.html {
@filer = Locmare::Filer.new self.class.model.item_name, @item.children, nil, :none, @operators
render :action => :show
}
end
- def show_json_format format
+ def children_json_format format
format.json {
@items = @item.children
render json: @items.to_json(self.class.model.list_json_opt)
def show
set_show
- if @item.category_id == 10
- redirect_to @item.remote_name
- else
+ if params[:ref]
respond_to do |format|
- show_html_format format
- show_prof_format format
show_json_format format
end
+ else
+ if params[:format] == 'prof'
+ respond_to do |format|
+ show_prof_format format
+ end
+ else
+ if @item.category_id == 10
+ redirect_to @item.remote_name
+ else
+ respond_to do |format|
+ children_html_format format
+ children_json_format format
+ end
+ end
+ end
end
end