radiant-clipped-extension 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/app/models/asset.rb CHANGED
@@ -45,7 +45,7 @@ class Asset < ActiveRecord::Base
45
45
  :access_key_id => Radiant.config["paperclip.s3.key"],
46
46
  :secret_access_key => Radiant.config["paperclip.s3.secret"]
47
47
  },
48
- :s3_host_alias => Radiant.config["paperclip.s3.host_alias"] || Radiant.config["assets.s3.bucket"],
48
+ :s3_host_alias => Radiant.config["paperclip.s3.host_alias"] || Radiant.config["paperclip.s3.bucket"],
49
49
  :bucket => Radiant.config["paperclip.s3.bucket"],
50
50
  :url => Radiant.config["paperclip.url"],
51
51
  :path => Radiant.config["paperclip.path"]
@@ -7,7 +7,7 @@
7
7
  - css_class += ' unsaved' if attachment.new_record?
8
8
 
9
9
  %li{:class => css_class, :id => "attachment_#{asset.uuid}"}
10
- - fields_for @page do |f|
10
+ - fields_for :page, @page do |f|
11
11
  - f.fields_for :page_attachments, attachment, :child_index => asset.uuid do |paf|
12
12
  - if attachment.new_record?
13
13
  = paf.hidden_field :asset_id, :class => 'attacher'
data/clipped_extension.rb CHANGED
@@ -1,5 +1,7 @@
1
1
  require_dependency 'application_controller'
2
+
2
3
  require 'radiant-clipped-extension'
4
+ require 'acts_as_list'
3
5
  require 'uuidtools'
4
6
 
5
7
  class ClippedExtension < Radiant::Extension
@@ -8,13 +10,13 @@ class ClippedExtension < Radiant::Extension
8
10
  url RadiantClippedExtension::URL
9
11
 
10
12
  extension_config do |config|
11
- config.gem "uuidtools", :version => "~> 2.1.2"
12
- config.gem 'paperclip', :version => "~> 2.3.11"
13
- config.gem 'acts_as_list', :version => "~> 0.1.2"
13
+ config.gem "acts_as_list", :version => "~> 0.1.2"
14
+ config.gem "paperclip", :version => "~> 2.3.11"
15
+ config.gem "uuidtools", :version => "~> 2.1.2"
14
16
  end
15
-
17
+
16
18
  migrate_from 'Paperclipped', 20100327111216
17
-
19
+
18
20
  def activate
19
21
  require 'paperclip/geometry_transformation'
20
22
  if Asset.table_exists?
@@ -23,7 +25,7 @@ class ClippedExtension < Radiant::Extension
23
25
  Admin::PagesController.send :helper, Admin::AssetsHelper # currently only provides a description of asset sizes
24
26
  Page.send :include, AssetTags # radius tags for selecting sets of assets and presenting each one
25
27
  UserActionObserver.instance.send :add_observer!, Asset # the usual creator- and updater-stamping
26
-
28
+
27
29
  AssetType.new :image, :icon => 'image', :default_radius_tag => 'image', :processors => [:thumbnail], :styles => {:icon => ['42x42#', :png], :thumbnail => ['100x100#', :png]}, :extensions => %w[jpg jpeg png gif], :mime_types => %w[image/png image/x-png image/jpeg image/pjpeg image/jpg image/gif]
28
30
  AssetType.new :video, :icon => 'video', :processors => [:frame_grab], :styles => {:native => ['', :jpg], :icon => ['42x42#', :png], :thumbnail => ['100x100#', :png]}, :mime_types => %w[application/x-mp4 video/mpeg video/quicktime video/x-la-asf video/x-ms-asf video/x-msvideo video/x-sgi-movie video/x-flv flv-application/octet-stream video/3gpp video/3gpp2 video/3gpp-tt video/BMPEG video/BT656 video/CelB video/DV video/H261 video/H263 video/H263-1998 video/H263-2000 video/H264 video/JPEG video/MJ2 video/MP1S video/MP2P video/MP2T video/mp4 video/MP4V-ES video/MPV video/mpeg4 video/mpeg4-generic video/nv video/parityfec video/pointer video/raw video/rtx video/ogg video/webm]
29
31
  AssetType.new :audio, :icon => 'audio', :mime_types => %w[audio/mpeg audio/mpg audio/ogg application/ogg audio/x-ms-wma audio/vnd.rn-realaudio audio/x-wav]
@@ -32,35 +34,35 @@ class ClippedExtension < Radiant::Extension
32
34
  AssetType.new :pdf, :icon => 'pdf', :processors => [:thumbnail], :extensions => %w{pdf}, :mime_types => %w[application/pdf application/x-pdf], :styles => {:icon => ['42x42#', :png], :thumbnail => ['100x100#', :png]}
33
35
  AssetType.new :document, :icon => 'document', :mime_types => %w[application/msword application/rtf application/vnd.ms-excel application/vnd.ms-powerpoint application/vnd.ms-project application/vnd.ms-works text/plain text/html]
34
36
  AssetType.new :other, :icon => 'unknown'
35
-
37
+
36
38
  admin.asset ||= Radiant::AdminUI.load_default_asset_regions # loads the shards defined in AssetsAdminUI
37
39
  admin.page.edit.add :form, 'assets', :after => :edit_page_parts # adds the asset-attachment picker to the page edit view
38
40
  admin.page.edit.add :main, 'asset_popups', :after => :edit_popups # adds the asset-attachment picker to the page edit view
39
41
  admin.page.edit.asset_popups.concat %w{upload_asset attach_asset}
40
- admin.configuration.show.add :config, 'admin/configuration/show', :after => 'defaults'
41
- admin.configuration.edit.add :form, 'admin/configuration/edit', :after => 'edit_defaults'
42
+ admin.configuration.show.add :config, 'admin/configuration/clipped_show', :after => 'defaults'
43
+ admin.configuration.edit.add :form, 'admin/configuration/clipped_edit', :after => 'edit_defaults'
42
44
 
43
45
  if Radiant::Config.table_exists? && Radiant::config["paperclip.command_path"] # This is needed for testing if you are using mod_rails
44
46
  Paperclip.options[:command_path] = Radiant::config["paperclip.command_path"]
45
47
  end
46
-
48
+
47
49
  tab "Assets", :after => "Content" do
48
50
  add_item "All", "/admin/assets/"
49
51
  end
50
-
52
+
51
53
  if RAILS_ENV == 'development'
52
54
  update_sass_each_request
53
55
  update_javascript_each_request
54
56
  end
55
57
  end
56
58
  end
57
-
59
+
58
60
  def deactivate
59
-
61
+
60
62
  end
61
-
63
+
62
64
  private
63
-
65
+
64
66
  def update_sass_each_request
65
67
  ApplicationController.class_eval do
66
68
  prepend_before_filter :update_assets_sass
@@ -74,7 +76,7 @@ class ClippedExtension < Radiant::Extension
74
76
  end
75
77
  end
76
78
  end
77
-
79
+
78
80
  def update_javascript_each_request
79
81
  ApplicationController.class_eval do
80
82
  prepend_before_filter :update_assets_javascript
@@ -88,5 +90,5 @@ class ClippedExtension < Radiant::Extension
88
90
  end
89
91
  end
90
92
  end
91
-
93
+
92
94
  end
@@ -9,6 +9,7 @@ en:
9
9
  others: 'Others'
10
10
  audios: 'Audio'
11
11
  flashes: 'Flash'
12
+ fonts: 'Fonts'
12
13
  videos: 'Video'
13
14
  pdfs: 'PDFs'
14
15
  swfs: 'Flash'
@@ -9,6 +9,7 @@ nl:
9
9
  others: 'Andere'
10
10
  audios: 'Audio'
11
11
  flashes: 'Flash'
12
+ fonts: 'Fonts'
12
13
  videos: 'Video'
13
14
  pdfs: 'PDFs'
14
15
  swfs: 'Flash'
data/lib/asset_tags.rb CHANGED
@@ -38,7 +38,6 @@ module AssetTags
38
38
  end
39
39
  tag 'assets:each' do |tag|
40
40
  options = tag.attr.dup
41
- result = []
42
41
  tag.locals.assets = tag.locals.page.assets.scoped(assets_find_options(tag))
43
42
  tag.render('asset_list', tag.attr.dup, &tag.block)
44
43
  end
@@ -1,5 +1,5 @@
1
1
  module RadiantClippedExtension
2
- VERSION = '1.0.2'
2
+ VERSION = '1.0.3'
3
3
  SUMMARY = %q{Assets for Radiant CMS}
4
4
  DESCRIPTION = %q{Asset-management derived from Keith Bingman's Paperclipped extension.}
5
5
  URL = "http://radiantcms.org"
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: 19
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 2
10
- version: 1.0.2
9
+ - 3
10
+ version: 1.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Keith Bingman
@@ -18,7 +18,8 @@ autorequire:
18
18
  bindir: bin
19
19
  cert_chain: []
20
20
 
21
- date: 2011-07-05 00:00:00 Z
21
+ date: 2011-08-11 00:00:00 +01:00
22
+ default_executable:
22
23
  dependencies:
23
24
  - !ruby/object:Gem::Dependency
24
25
  name: acts_as_list
@@ -97,8 +98,8 @@ files:
97
98
  - app/views/admin/assets/new.html.haml
98
99
  - app/views/admin/assets/refresh.html.haml
99
100
  - app/views/admin/assets/remove.html.haml
100
- - app/views/admin/configuration/_edit.html.haml
101
- - app/views/admin/configuration/_show.html.haml
101
+ - app/views/admin/configuration/_clipped_edit.html.haml
102
+ - app/views/admin/configuration/_clipped_show.html.haml
102
103
  - app/views/admin/page_attachments/_attachment.html.haml
103
104
  - app/views/admin/page_parts/_page_part.html.haml
104
105
  - app/views/admin/pages/_asset_popups.html.haml
@@ -201,10 +202,11 @@ files:
201
202
  - wireframes/edit-page-assets.png
202
203
  - wireframes/edit-page.bmml
203
204
  - wireframes/edit-page.png
205
+ has_rdoc: true
204
206
  homepage: http://radiantcms.org
205
207
  licenses: []
206
208
 
207
- post_install_message: "\n Add this to your radiant project with:\n config.gem 'radiant-clipped-extension', :version => '~>1.0.2'\n "
209
+ post_install_message: "\n Add this to your radiant project with:\n config.gem 'radiant-clipped-extension', :version => '~>1.0.3'\n "
208
210
  rdoc_options: []
209
211
 
210
212
  require_paths:
@@ -230,7 +232,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
230
232
  requirements: []
231
233
 
232
234
  rubyforge_project:
233
- rubygems_version: 1.7.2
235
+ rubygems_version: 1.5.3
234
236
  signing_key:
235
237
  specification_version: 3
236
238
  summary: Assets for Radiant CMS