public
Description: Radiant Image and Assets Extension
Homepage: http://github.com/kbingman/assets_extension/wikis
Clone URL: git://github.com/kbingman/assets_extension.git
Search Repo:
Don't really know what I updated here, the bucket I suspect
Keith Bingman (author)
Sun Mar 30 02:57:21 -0700 2008
commit  ca1f33daa6648d846e25251afecb89d6b57ff70d
tree    1000e839cd8b180526ab660552bb4ef340018a0b
parent  96e829366c80e00084033e3e68119b028be7e2f7
...
26
27
28
29
30
31
32
 
 
 
 
33
34
35
...
38
39
40
41
42
 
 
43
44
45
46
47
48
49
 
50
51
 
52
53
54
...
26
27
28
 
 
 
 
29
30
31
32
33
34
35
...
38
39
40
 
 
41
42
43
44
45
46
47
48
 
49
50
 
51
52
53
54
0
@@ -26,10 +26,10 @@ module AssetTags
0
     result = []
0
     # all = tag.attr['all']
0
     # all == 'true' ? assets = Asset.find(:all) : assets = tag.locals.page.assets
0
- associations = tag.locals.page.attachments.sort_by{ |a| a.position }
0
- tag.locals.assets = associations
0
- associations.each do |assoc|
0
- tag.locals.asset = assoc.asset
0
+ attachments = tag.locals.page.attachments
0
+ tag.locals.assets = attachments
0
+ attachments.each do |attachment|
0
+ tag.locals.asset = attachment.asset
0
       result << tag.expand
0
     end
0
     result
0
@@ -38,17 +38,17 @@ module AssetTags
0
   tag 'asset:first' do |tag|
0
      # all = tag.attr['all']
0
      # all == 'true' ? assets = Asset.find(:all) :
0
- associations = tag.locals.page.attachments.sort_by{ |a| a.position }
0
- if first = associations.first
0
+ attachmentss = tag.locals.page.attachments
0
+ if first = attachmentss.first
0
        tag.locals.asset = first.asset
0
        tag.expand
0
      end
0
    end
0
    
0
    tag 'asset:if_first' do |tag|
0
- associations = tag.locals.assets
0
+ attachments = tag.locals.assets
0
      asset = tag.locals.asset
0
- if asset == associations.first.asset
0
+ if asset == attachments.first.asset
0
        tag.expand
0
      end
0
    end
...
7
8
9
10
11
12
13
14
15
16
17
18
19
20
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
22
 
23
24
...
7
8
9
 
 
 
 
 
 
 
 
 
 
 
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
 
27
28
29
0
@@ -7,18 +7,23 @@
0
     = image_tag(asset.public_filename(:thumbnail))
0
 
0
   .image_info{ :id => info_id, :style => "display: none" }
0
- %p
0
- %strong= asset.title
0
- %p= link_to "Edit", asset_edit_url(asset)
0
- %p= link_to "Thumbnail Url", asset.public_filename(:thumbnail)
0
- %p= link_to "Original Url", asset.public_filename
0
- - if @page and @page.id
0
- - if @page.assets.include?(asset)
0
- %p= link_to_remote "Remove Image", :url => remove_asset_url(:asset => asset.id, :page => @page.id), |
0
- :after => "Effect.Fade('#{dom_id}', { duration: 0.8 })", :complete => "Element.remove('#{dom_id}')" if id_name == 'attachment' |
0
- - else
0
- %p= link_to_remote "Attach Image", :url => attach_asset_url(:asset => asset.id, :page => @page.id)
0
+ %h4= asset.title
0
+ %div.image_links
0
+ - if @page and @page.id
0
+ %p
0
+ %strong
0
+ - if @page.assets.include?(asset)
0
+ = link_to_remote "Remove Image", :url => remove_asset_url(:asset => asset.id, :page => @page.id), |
0
+ :confirm => "Are you sure you want to remove this asset from the page?", |
0
+ :after => "Effect.Fade('#{dom_id}', { duration: 0.8 })", :complete => "Element.remove('#{dom_id}')" if id_name == 'attachment' |
0
+
0
+ - else
0
+ = link_to_remote "Attach Image", :url => attach_asset_url(:asset => asset.id, :page => @page.id)
0
+
0
+ %p= link_to "Edit", asset_edit_url(asset)
0
+ %p= link_to "Thumbnail Url", asset.public_filename(:thumbnail)
0
+ %p= link_to "Original Url", asset.public_filename
0
       
0
- %p
0
+ %div
0
       %a{ :href => "#", :onclick => "Effect.Fade('#{info_id}', { duration: 0.4 }); return false; " }
0
         Close
...
20
21
22
23
 
 
24
25
26
...
20
21
22
 
23
24
25
26
27
0
@@ -20,7 +20,8 @@
0
   %h4
0
     Bucket&nbsp;
0
     %span.note Items placed here can be used in your pages, layouts and snippets.
0
- = link_to_remote('Clear Bucket', {:url => clear_bucket_url}, :id => 'clear-bucket')
0
+ %span#clear-bucket
0
+ = link_to_remote('Clear Bucket', {:url => clear_bucket_url} )
0
   
0
   = render :partial => "admin/asset/bucket"
0
 
...
6
7
8
9
10
 
11
12
13
...
6
7
8
 
 
9
10
11
12
0
@@ -6,8 +6,7 @@
0
       = render :partial => "admin/asset/asset", :locals => { :asset => asset, :id_name => 'asset' }
0
   - else
0
     %li
0
- %p
0
- %em Your bucket is empty
0
+ %p.note Your bucket is empty
0
       
0
 
0
 
...
4
5
6
7
8
 
9
10
11
...
4
5
6
 
 
7
8
9
10
0
@@ -4,8 +4,7 @@
0
     
0
 - else
0
   %li
0
- %p
0
- %em You have no attached assets.
0
+ %p.note You have no attached assets.
0
     
0
 
0
 

Comments

    No one has commented yet.