2010-05-12 00:16:39 +00:00
|
|
|
module Admin
|
|
|
|
class AssetCollectionsController < BaseController
|
|
|
|
|
|
|
|
sections 'assets'
|
|
|
|
|
|
|
|
before_filter :set_collections
|
2010-07-13 00:46:17 +00:00
|
|
|
|
2010-05-12 00:16:39 +00:00
|
|
|
def index
|
2010-07-13 00:46:17 +00:00
|
|
|
if not @asset_collections.empty?
|
|
|
|
redirect_to(edit_admin_asset_collection_url(@asset_collections.first)) and return
|
2010-05-12 00:16:39 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def show
|
2010-07-13 00:46:17 +00:00
|
|
|
@asset_collection = current_site.asset_collections.find(params[:id])
|
2010-05-12 00:16:39 +00:00
|
|
|
render :action => 'edit'
|
|
|
|
end
|
|
|
|
|
|
|
|
protected
|
|
|
|
|
|
|
|
def set_collections
|
2010-07-13 00:46:17 +00:00
|
|
|
@asset_collections = current_site.asset_collections.order_by([[:name, :asc]])
|
2010-05-12 00:16:39 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|