orbit-basic/app/controllers/admin/items_controller.rb

35 lines
765 B
Ruby
Raw Normal View History

class Admin::ItemsController < OrbitBackendController
layout "structure"
# TODO = put back ========================
# before_filter :authenticate_user!
# before_filter :find_parent_item
# before_filter :is_admin?
# before_filter :set_current_item
#=========================================
def index
if params[:item_id]
2011-05-13 01:08:42 +00:00
@item = Item.find(params[:item_id])
else
2011-09-01 01:12:41 +00:00
@item = get_homepage
end
end
def destroy
@item = Item.find(params[:id])
@item.destroy
respond_to do |format|
format.js { render 'admin/items/reload_items' }
end
end
def update_position
item = Item.find(params[:id])
2013-10-04 07:07:24 +00:00
item.shift_to(params[:parent_id], params[:position].to_i - 1)
render :nothing => true
end
end