radiant-clipped-extension 1.0.8 → 1.0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/radiant-clipped-extension.rb +1 -1
- data/spec/datasets/assets_dataset.rb +5 -3
- data/spec/lib/asset_tags_spec.rb +19 -19
- metadata +5 -7
@@ -3,8 +3,8 @@ class AssetsDataset < Dataset::Base
|
|
3
3
|
|
4
4
|
def load
|
5
5
|
create_page "pictured", :slug => 'pictured' do
|
6
|
-
create_asset "test1", :caption => "testing"
|
7
|
-
create_asset "test2", :caption => "also testing"
|
6
|
+
create_asset "test1", :caption => "testing", :position => 1
|
7
|
+
create_asset "test2", :caption => "also testing", :position => 2
|
8
8
|
end
|
9
9
|
create_asset "video", :asset_content_type => 'video/mpeg', :asset_file_name => 'asset.mpg'
|
10
10
|
create_asset "audio", :asset_content_type => 'audio/mp3', :asset_file_name => 'asset.mp3'
|
@@ -13,6 +13,7 @@ class AssetsDataset < Dataset::Base
|
|
13
13
|
|
14
14
|
helpers do
|
15
15
|
def create_asset(name, attributes={})
|
16
|
+
pos = attributes.delete(:position)
|
16
17
|
create_record :asset, name.symbolize, {
|
17
18
|
:title => name,
|
18
19
|
:asset_file_name => 'asset.jpg',
|
@@ -25,7 +26,8 @@ class AssetsDataset < Dataset::Base
|
|
25
26
|
if @current_page_id
|
26
27
|
create_record :page_attachment, "#{name}_attachment".symbolize, {
|
27
28
|
:page_id => @current_page_id,
|
28
|
-
:asset_id => asset_id(name.symbolize)
|
29
|
+
:asset_id => asset_id(name.symbolize),
|
30
|
+
:position => pos
|
29
31
|
}
|
30
32
|
end
|
31
33
|
end
|
data/spec/lib/asset_tags_spec.rb
CHANGED
@@ -43,58 +43,58 @@ describe AssetTags do
|
|
43
43
|
end
|
44
44
|
|
45
45
|
it "asset:name" do
|
46
|
-
page.should render(
|
46
|
+
page.should render(%{<r:asset:name id="#{asset_id(:test1)}" />}).as( asset.title )
|
47
47
|
end
|
48
48
|
|
49
49
|
it "asset:filename" do
|
50
|
-
page.should render(
|
50
|
+
page.should render(%{<r:asset:filename id="#{asset_id(:test1)}" />}).as( asset.asset_file_name )
|
51
51
|
end
|
52
52
|
|
53
53
|
it "asset:url" do
|
54
|
-
page.should render(
|
55
|
-
page.should render(
|
54
|
+
page.should render(%{<r:asset:url id="#{asset_id(:test1)}" />}).as( asset.thumbnail )
|
55
|
+
page.should render(%{<r:asset:url size="icon" id="#{asset_id(:test1)}" />}).as( asset.thumbnail('icon') )
|
56
56
|
end
|
57
57
|
|
58
58
|
it "asset:link" do
|
59
|
-
page.should render(
|
60
|
-
page.should render(
|
59
|
+
page.should render(%{<r:asset:link id="#{asset_id(:test1)}" />}).as( %{<a href="#{asset.thumbnail}">#{asset.title}</a>} )
|
60
|
+
page.should render(%{<r:asset:link size="icon" id="#{asset_id(:test1)}" />}).as( %{<a href="#{asset.thumbnail('icon')}">#{asset.title}</a>} )
|
61
61
|
end
|
62
62
|
|
63
63
|
it "asset:image" do
|
64
|
-
page.should render(
|
65
|
-
page.should render(
|
64
|
+
page.should render(%{<r:asset:image id="#{asset_id(:test1)}" />}).as( %{<img src="#{asset.thumbnail}" alt='#{asset.title}' />} )
|
65
|
+
page.should render(%{<r:asset:image size="icon" id="#{asset_id(:test1)}" />}).as( %{<img src="#{asset.thumbnail('icon')}" alt='#{asset.title}' />} )
|
66
66
|
end
|
67
67
|
|
68
68
|
it "asset:caption" do
|
69
|
-
page.should render(
|
69
|
+
page.should render(%{<r:asset:caption id="#{asset_id(:test1)}" />}).as( asset.caption )
|
70
70
|
end
|
71
71
|
|
72
72
|
it "asset:top_padding" do
|
73
|
-
page.should render(
|
73
|
+
page.should render(%{<r:asset:top_padding id="#{asset_id(:test1)}" container="500" />}).as( "229" )
|
74
74
|
end
|
75
75
|
|
76
76
|
it "asset:top_padding for a specified style" do
|
77
|
-
page.should render(
|
77
|
+
page.should render(%{<r:asset:top_padding id="#{asset_id(:test1)}" container="500" size="thumbnail" />}).as( "200" )
|
78
78
|
end
|
79
79
|
|
80
80
|
it "asset:width" do
|
81
|
-
page.should render(
|
82
|
-
page.should render(
|
81
|
+
page.should render(%{<r:asset:width id="#{asset_id(:test1)}" />}).as( "400" )
|
82
|
+
page.should render(%{<r:asset:width id="#{asset_id(:test1)}" size="icon" />}).as( "42" )
|
83
83
|
end
|
84
84
|
|
85
85
|
it "asset:height" do
|
86
|
-
page.should render(
|
87
|
-
page.should render(
|
86
|
+
page.should render(%{<r:asset:height id="#{asset_id(:test1)}" container="500" />}).as( "200" )
|
87
|
+
page.should render(%{<r:asset:height id="#{asset_id(:test1)}" size="icon" />}).as( "42" )
|
88
88
|
end
|
89
89
|
|
90
90
|
it "asset:orientation" do
|
91
|
-
page.should render(
|
92
|
-
page.should render(
|
91
|
+
page.should render(%{<r:asset:orientation id="#{asset_id(:test1)}" />}).as( "horizontal" )
|
92
|
+
page.should render(%{<r:asset:orientation id="#{asset_id(:test1)}" size="icon" />}).as( "square" )
|
93
93
|
end
|
94
94
|
|
95
95
|
it "asset:aspect" do
|
96
|
-
page.should render(
|
97
|
-
page.should render(
|
96
|
+
page.should render(%{<r:asset:aspect id="#{asset_id(:test1)}" />}).as( 2.to_f.to_s )
|
97
|
+
page.should render(%{<r:asset:aspect id="#{asset_id(:test1)}" size="icon" />}).as( 1.to_f.to_s )
|
98
98
|
end
|
99
99
|
|
100
100
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: radiant-clipped-extension
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 5
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 9
|
10
|
+
version: 1.0.9
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Keith Bingman
|
@@ -18,8 +18,7 @@ autorequire:
|
|
18
18
|
bindir: bin
|
19
19
|
cert_chain: []
|
20
20
|
|
21
|
-
date: 2011-09-
|
22
|
-
default_executable:
|
21
|
+
date: 2011-09-10 00:00:00 Z
|
23
22
|
dependencies:
|
24
23
|
- !ruby/object:Gem::Dependency
|
25
24
|
name: acts_as_list
|
@@ -201,7 +200,6 @@ files:
|
|
201
200
|
- wireframes/edit-page-assets.png
|
202
201
|
- wireframes/edit-page.bmml
|
203
202
|
- wireframes/edit-page.png
|
204
|
-
has_rdoc: true
|
205
203
|
homepage: http://radiantcms.org
|
206
204
|
licenses: []
|
207
205
|
|
@@ -231,7 +229,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
231
229
|
requirements: []
|
232
230
|
|
233
231
|
rubyforge_project:
|
234
|
-
rubygems_version: 1.
|
232
|
+
rubygems_version: 1.8.10
|
235
233
|
signing_key:
|
236
234
|
specification_version: 3
|
237
235
|
summary: Assets for Radiant CMS
|