Skip to content

Commit

Permalink
Namespaced AssetsHelper and moved it to an admin subfolder.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Stalker committed Jun 20, 2011
1 parent 3fbb69f commit 027e14d
Showing 1 changed file with 1 addition and 25 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,4 @@
module AssetsHelper
def asset_listing(asset)
asset_icon(asset) +
content_tag(:span, asset.to_s, :class=>'title')
end

def asset_grid_item(asset)
asset_icon(asset, 120) +
content_tag(:span, "ID: #{asset.id}", :class => 'id') +
content_tag(:span, asset.to_s, :class => 'caption')
end

module Admin::AssetsHelper
def asset_icon(asset, size=30)
asset.image? ? square_thumb(asset, size) : text_icon(asset, size)
end
Expand Down Expand Up @@ -52,17 +41,4 @@ def video_player(asset)
def audio_player(asset)
%Q{<audio src="#{asset.upload.url}" type="#{asset.upload.mime_type}" controls="controls">}
end

def link_to_remove(asset)
link_to 'Remove', remove_admin_asset_path(asset), :class => 'action remove', :title => 'Remove Asset'
end

def list_view?
params[:view] == 'list'
end

def view_toggle
other = list_view? ? 'grid' : 'list'
link_to "Switch to #{other} view", admin_assets_path(:view => other)
end
end

0 comments on commit 027e14d

Please sign in to comment.