2013-03-06 07:16:20 +00:00
|
|
|
class Admin::ItemsController < OrbitBackendController
|
2010-01-14 10:30:53 +00:00
|
|
|
|
2013-04-11 19:13:03 +00:00
|
|
|
layout "structure"
|
2013-04-25 04:34:06 +00:00
|
|
|
|
|
|
|
# TODO = put back ========================
|
2013-04-11 19:13:03 +00:00
|
|
|
# before_filter :authenticate_user!
|
|
|
|
# before_filter :find_parent_item
|
|
|
|
# before_filter :is_admin?
|
|
|
|
# before_filter :set_current_item
|
2013-04-25 04:34:06 +00:00
|
|
|
#=========================================
|
2010-01-14 10:30:53 +00:00
|
|
|
|
|
|
|
def index
|
2011-05-09 10:49:57 +00:00
|
|
|
if params[:item_id]
|
2011-05-13 01:08:42 +00:00
|
|
|
@item = Item.find(params[:item_id])
|
2011-05-09 10:49:57 +00:00
|
|
|
else
|
2011-09-01 01:12:41 +00:00
|
|
|
@item = get_homepage
|
2011-05-09 10:49:57 +00:00
|
|
|
end
|
2010-02-22 08:10:13 +00:00
|
|
|
end
|
2012-05-11 02:00:45 +00:00
|
|
|
|
2013-04-11 19:13:03 +00:00
|
|
|
def destroy
|
|
|
|
@item = Item.find(params[:id])
|
|
|
|
@item.destroy
|
|
|
|
respond_to do |format|
|
|
|
|
format.js { render 'admin/items/reload_items' }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2012-05-11 02:00:45 +00:00
|
|
|
def update_position
|
2012-05-11 09:56:26 +00:00
|
|
|
item = Item.find(params[:id])
|
|
|
|
item.shift_to(params[:parent_id], params[:position])
|
2012-05-11 02:00:45 +00:00
|
|
|
render :nothing => true
|
|
|
|
end
|
2010-02-22 08:10:13 +00:00
|
|
|
|
2010-01-14 10:30:53 +00:00
|
|
|
end
|