beef-has_assets 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/app/helpers/assets_helper.rb +12 -0
- data/has_assets.gemspec +3 -2
- data/rails/init.rb +2 -1
- metadata +3 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.2.0
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module AssetsHelper
|
2
|
+
|
3
|
+
def gallery(assets, size = :square)
|
4
|
+
images_items = assets.images.collect { |asset| content_tag( :li, link_to(image_tag(asset.public_filename(size), :alt => asset.description), asset.public_filename, :title => asset.description, :rel => 'gallery' ) ) }
|
5
|
+
content_tag :ul, images_items.join, :class => 'gallery' unless images_items.empty?
|
6
|
+
end
|
7
|
+
|
8
|
+
def documents(assets)
|
9
|
+
documents_items = assets.documents.collect { |asset| content_tag( :li, link_to("Download #{asset.filename} (#{number_to_human_size(asset.size)})", asset.public_filename, :title => asset.description ) ) }
|
10
|
+
content_tag :ul, documents_items.join, :class => 'documents' unless documents_items.empty?
|
11
|
+
end
|
12
|
+
end
|
data/has_assets.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{has_assets}
|
5
|
-
s.version = "0.
|
5
|
+
s.version = "0.2.0"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Steve England"]
|
9
|
-
s.date = %q{2009-
|
9
|
+
s.date = %q{2009-07-10}
|
10
10
|
s.email = %q{steve@wearebeef.co.uk}
|
11
11
|
s.extra_rdoc_files = [
|
12
12
|
"LICENSE",
|
@@ -21,6 +21,7 @@ Gem::Specification.new do |s|
|
|
21
21
|
"VERSION",
|
22
22
|
"app/controllers/admin/assets_controller.rb",
|
23
23
|
"app/helpers/admin/assets_helper.rb",
|
24
|
+
"app/helpers/assets_helper.rb",
|
24
25
|
"app/models/asset.rb",
|
25
26
|
"app/models/asseting.rb",
|
26
27
|
"app/views/admin/assets/_browser.html.erb",
|
data/rails/init.rb
CHANGED
@@ -8,8 +8,9 @@ config.to_prepare do
|
|
8
8
|
# Rack middleware for fixing flash's issues with sessions
|
9
9
|
# http://thewebfellas.com/blog/2008/12/22/flash-uploaders-rails-cookie-based-sessions-and-csrf-rack-middleware-to-the-rescue
|
10
10
|
ActionController::Dispatcher.middleware.use FlashSessionCookieMiddleware, ActionController::Base.session_options[:key]
|
11
|
-
# Add the asset management helpers
|
11
|
+
# Add the asset management helpers
|
12
12
|
Admin::BaseController.helper(Admin::AssetsHelper)
|
13
|
+
ApplicationController.helper(AssetsHelper)
|
13
14
|
end
|
14
15
|
ActiveRecord::Base.send :include, Beef::Has::Assets
|
15
16
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: beef-has_assets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steve England
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-07-10 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -31,6 +31,7 @@ files:
|
|
31
31
|
- VERSION
|
32
32
|
- app/controllers/admin/assets_controller.rb
|
33
33
|
- app/helpers/admin/assets_helper.rb
|
34
|
+
- app/helpers/assets_helper.rb
|
34
35
|
- app/models/asset.rb
|
35
36
|
- app/models/asseting.rb
|
36
37
|
- app/views/admin/assets/_browser.html.erb
|