2010-05-12 00:16:39 +00:00
|
|
|
module Admin
|
|
|
|
class AssetCollectionsController < BaseController
|
2010-07-23 20:09:54 +00:00
|
|
|
|
|
|
|
sections 'assets'
|
|
|
|
|
2010-05-12 00:16:39 +00:00
|
|
|
before_filter :set_collections
|
2010-07-23 20:09:54 +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
|
2010-07-23 20:09:54 +00:00
|
|
|
|
2010-05-12 00:16:39 +00:00
|
|
|
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
|
2010-07-23 20:09:54 +00:00
|
|
|
|
|
|
|
protected
|
|
|
|
|
2010-05-12 00:16:39 +00:00
|
|
|
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
|