radiant-clipped-extension 1.0.14 → 1.0.15

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,132 +1,106 @@
1
- Radiant Clipped Extension
2
- ------------------------
1
+ # Radiant Clipped Extension
3
2
 
4
- This is a new core extension intended for use with Radiant version 1.0 or higher.
5
- It is based on Keith Bingman's excellent Paperclipped extension, for which it is a drop-in replacement.
6
- It should also be an easy upgrade from `page_attachments`, but I haven't tested that yet.
3
+ Asset management for Radiant CMS.
7
4
 
8
- ## Changes
5
+ The Clipped extension comes bundled with the Radiant gem but may be updated separately. Only Radiant versions 1.0 or newer are supported.
9
6
 
10
- * video files frame-grabbed (automatically disabled if FFmpeg is not found)
11
- * pdfs thumbnailed
12
- * new asset-retrieval and page-attachment interface (by John Long)
13
- * new inline upload mechanism that allows several concurrent uploads and attachment to new pages
14
- * easily extended with new asset types and processors
15
- * helpful insert buttons that do the right thing.
7
+ Please file bugs and feature requests on [Github][issues]. If you have questions regarding usage ask on the [mailing list][mailing-list].
16
8
 
17
- ## Still to do
9
+ [issues]: https://github.com/radiant/radiant-clipped-extension/issues
10
+ [mailing-list]: https://groups.google.com/forum/?hl=en#!forum/radiantcms
18
11
 
19
- * progress bars on uploading assets
20
- * warning if you try and save a page while assets are still uploading
21
- * html5 video and audio tags in radius (with sensible flash fallbacks)
12
+ ## Features
22
13
 
23
- Video transcoding support will be in an optional extension with `delayed_job` support.
14
+ * Concurrent uploads
15
+ * Automatic thumbnail generation
16
+ * requiers ImageMagick for images
17
+ * requiers FFmpeg for videos
18
+ * requiers Ghostscript for PDFs
19
+ * In-page and dedicated management interfaces
20
+ * Easily to extended with new asset types and processors
24
21
 
25
- # Known bugs
26
-
27
- At the moment I think uploads probably don't work in IE7. See github for more issues.
28
-
29
- ## Requirements
30
-
31
- The `paperclip`, `uuidtools` and `acts_as_list` gems are required. For cloud storage you need the `fog` gem.
22
+ ## Installation
32
23
 
33
- Paperclip's post-processors require ImageMagick. PDF-thumbnailing also requires ghostscript, which is usually
34
- installed with ImageMagick anyway, and if you want to generate thumbnails from video clips then you also need FFmpeg.
24
+ If you installed the Radiant gem then you already have Clipped installed. You can upgrade to a newer version using `bundle update radiant-clipped-extension`.
35
25
 
36
- On unixy systems there should be packages available to satisfy all these requirements. You don't need to
37
- install development libraries, but you will get a lot of little file-type utilities if you don't have them already.
26
+ Installation of the optional post-processors varies by system but are likely available through your package manager.
38
27
 
39
- On OS X, with macports:
28
+ ### Mac OSX
40
29
 
30
+ brew install ghostscript imagemagick ffmpeg
31
+ # or
41
32
  port install ghostscript imagemagick ffmpeg
42
33
 
43
- On debian-like systems:
34
+ ### Debian
44
35
 
45
36
  apt-get install ghostscript imagemagick ffmpeg
46
37
 
47
- And I expect it's very similar with yum.
48
-
49
- On Windows, you can get binary installers of all the required pieces and apparently these days they're simple
50
- to install and connect:
51
-
52
- * ImageMagick: http://www.imagemagick.org/script/binary-releases.php
53
- * Ghostscript: http://sourceforge.net/projects/ghostscript/
54
- * FFMpeg: http://ffmpeg.zeranoe.com/builds/
55
-
56
- If your paths are strange, or you're running under passenger, you may need to set `Paperclip.options[:command_path]`
57
- to the location of these binaries for each of your environments. On OS X that's usually `/opt/local/bin`.
58
-
59
- ## Installation
38
+ ### Windows
60
39
 
61
- This extension is not currently compatible with versions of radiant earlier than 1.0rc. The incompatibilities
62
- are fairly minor and it may be backported, but for now if you're running a version of radiant which with the assets
63
- extension will work, you will find it is already installed. If you don't have it in your radiant distribution, it
64
- probably wouldn't work anyway.
40
+ [Ghostscript][ghostscript], [ImageMagick][imagemagick] and [FFmpeg][ffmpeg] all
41
+ offer Windows installers that you can install in the usual way.
65
42
 
66
- ## Upgrading from paperclipped
43
+ [ghostscript]: http://sourceforge.net/projects/ghostscript/
44
+ [imagemagick]: http://www.imagemagick.org/script/binary-releases.php
45
+ [ffmpeg]: http://ffmpeg.zeranoe.com/builds/
67
46
 
68
- No special steps are required. Paperclipped migrations are respected. The /images/assets directory is no longer needed.
69
- and can be deleted. See below for some radius tag changes that won't affect you yet but should be borne in mind.
47
+ If the post-processors are not in your `PATH` or you're running Passenger you might need to set `Paperclip.options[:command_path]` to the location where the binaries are installed.
70
48
 
71
- ## Upgrading from page_attachments
49
+ ## Configuration
72
50
 
73
- This is supposed to be straightforward too. In theory once the clipped extension has been migrated all you need is:
51
+ The clipped extension is configured in the usual way, but only its minor settings are exposed in the admin interface. The more architectural settings shouldn't be changed at runtime and some of them will require a lot of sorting out if they're changed at all, so those are only accessible through the console or by editing the database. Eventually they will be made part of the initial radiant installation process.
74
52
 
75
- rake radiant:extensions:clipped:migrate_from_page_attachments
53
+ ### Structural settings
76
54
 
77
- But I haven't tested that theory recently.
55
+ * `paperclip.url` sets the url scheme for attached files. Paperclip interpolations are applied. You probably don't want to change this.
56
+ * `paperclip.path` sets the path scheme for attached files. Paperclip interpolations are applied. You might conceivably want to change this.
57
+ * `paperclip.additional_thumbnails` is a string of comma-separated style definitions that is passed to paperclip for any asset type that has a post-processor (that is, currently, images, pdfs and video clips). The definitions are in the format name=geometry and when assembled the string will look something like `preview=640x640>,square=#260x260`. Thumbnail and icon styles are already defined and don't need to be configured this way.
58
+ * `paperclip.storage` can be 'filesystem' (the default) or 'fog' for cloud storage (such as s3).
59
+ * `paperclip.skip_filetype_validation` is true by default and allows uploads of any mime type.
78
60
 
79
- ## Radius tag changes
61
+ ### Cloud Storage
80
62
 
81
- The full radius tag set of paperclipped is still supported, so your pages should just work. If they worked before.
63
+ Set `paperclip.storage` to 'fog' and add the following line to your `Gemfile`
82
64
 
83
- The preferred syntax is slightly different, though. Where paperlipped used the `r:assets` namespace for everything, the
84
- assets extension has adopted a readable system of singular and plural tags that will be familiar from other bits of radiant:
65
+ `gem "fog", "~> 1.0"`
85
66
 
86
- <r:assets:each>
87
- <a href="<r:asset:url size="download" />">
88
- <r:asset:image size="thumbnail" />
89
- </a>
90
- <span class="caption"><r:asset:caption /></span>
91
- </r:assets:each>
67
+ You also have to provide the following settings:
92
68
 
93
- Anything to do with the collection of assets is plural. Anything to do with a particular asset is singular. The old plural
94
- forms still work but they are deprecated and (as the log messages will keep telling you) likely to removed in version 2.
69
+ * `paperclip.fog.provider` # set to one of "AWS", "Google" or "Rackspace"
95
70
 
96
- ## Configuration
71
+ If set to AWS, provide the following:
97
72
 
98
- The clipped extension is configured in the usual way, but only its minor settings are exposed in the admin interface. The
99
- more architectural settings shouldn't be changed at runtime and some of them will require a lot of sorting out if they're
100
- changed at all, so those are only accessible through the console or by editing the database. Eventually they will be made
101
- part of the initial radiant installation process.
73
+ * `paperclip.s3.bucket`
74
+ * `paperclip.s3.key`
75
+ * `paperclip.s3.secret`
76
+ * `paperclip.s3.region`
102
77
 
103
- ### Structural settings
78
+ If set to "Google", provide the following:
104
79
 
105
- * `clipped.url` sets the url scheme for attached files. Paperclip interpolations are applied. You probably don't want to change this.
106
- * `clipped.path` sets the path scheme for attached files. Paperclip interpolations are applied. You might conceivably want to change this.
107
- * `clipped.additional_thumbnails` is a string of comma-separated style definitions that is passed to paperclip for any asset type that has a post-processor (that is, currently, images, pdfs and video clips). The definitions are in the format name=geometry and when assembled the string will look something like `preview=640x640>,square=#260x260`. Thumbnail and icon styles are already defined and don't need to be configured this way.
108
- * `clipped.storage` can be 'filesystem' (the default) or 's3' for amazon's cloud service.
109
- * `clipped.skip_filetype_validation` is true by default and allows uploads of any mime type.
80
+ * `paperclip.fog.directory`
81
+ * `paperclip.google_storage.access_key_id`
82
+ * `paperclip.google_storage.secret_access_key`
110
83
 
111
- If the storage option is set to 's3' then these settings are also required:
84
+ If set to "Rackspace", provide the following:
112
85
 
113
- * `clipped.s3.bucket`
114
- * `clipped.s3.key`
115
- * `clipped.s3.secret`
86
+ * `paperclip.fog.directory`
87
+ * `paperclip.rackspace.username`
88
+ * `paperclip.rackspace.api_key`
116
89
 
117
90
  And optionally:
118
91
 
119
- * `clipped.s3.host_alias`
92
+ * `paperclip.fog.host`
93
+ * `paperclip.fog.public?`
120
94
 
121
95
  ### Configurable settings
122
96
 
123
97
  If you want to disable a whole category of post-processing, set one of these options to false:
124
98
 
125
- * `clipped.create_image_thumbnails?`
126
- * `clipped.create_video_thumbnails?`
127
- * `clipped.create_pdf_thumbnails?`
99
+ * `assets.create_image_thumbnails?`
100
+ * `assets.create_video_thumbnails?`
101
+ * `assets.create_pdf_thumbnails?`
128
102
 
129
- If we can't find ffmpeg on initialization, video thumbnailing will be disabled automatically by setting `clipped.create_video_thumbnails?` to false.
103
+ If we can't find ffmpeg on initialization, video thumbnailing will be disabled automatically by setting `assets.create_video_thumbnails?` to false.
130
104
 
131
105
  To set a threshold for the size of uploads permitted:
132
106
 
@@ -139,30 +113,24 @@ And you can set some defaults:
139
113
 
140
114
  ## Usage
141
115
 
142
- For most purposes you will probably work with assets while you're working on pages. Click on one of the 'assets' links and a panel will pop up allowing you to find, insert and attach existing assets or upload new ones.
116
+ For most purposes you will probably work with assets while you're working on pages. Click on one of the 'assets' links and a panel will pop up allowing you to find, insert and attach existing assets or upload new ones.
143
117
 
144
118
  For tidying up, replacing files and other admin, click on the 'assets' tab to get a larger version of the same list. Here again you can search for assets and filter the results by type, but the options are 'edit' and 'remove' and on editing you can change name, file and caption while keeping page associations intact.
145
119
 
146
120
  ## Radius Tags
147
121
 
148
- The asset manager has its own family of radius tags. The basic tag is <code><r:asset /></code>,
149
- which can be used either alone or as a double tag. This tag requires a `name` or `id` attribute,
150
- which references the asset. The <code><r:asset /></code> tag can be combined with other tags for a
151
- variety of uses:
122
+ The asset manager has its own family of radius tags. The basic tag is `<r:asset/>`, which can be used either alone or as a double tag. This tag requires a `name` or `id` attribute, which references the asset. The `<r:asset/>` tag can be combined with other tags for a variety of uses:
152
123
 
153
- <r:asset:image name="image.png" /> #=> <img src="/path/to/image.png" />
154
- <r:asset:link name="image.png" /> #=> <a href="/path/to/image.png">image.png</a>
124
+ <r:asset:image name="image.png"/> #=> <img src="/path/to/image.png" />
125
+ <r:asset:link name="image.png"/> #=> <a href="/path/to/image.png">image.png</a>
155
126
 
156
- You could also use:
127
+ You could also use:
157
128
 
158
129
  <r:asset:link name="bar.pdf">Download PDF</r:asset:link>
159
130
 
160
- Asset links are also available, such as content_type, file_size, and url.
131
+ Asset links are also available, such as content_type, file_size, and url.
161
132
 
162
- Another important tag is the <code><r:assets:each>...</r:assets:each></code>.
163
- (Note the plural namespace tag "assets".) If a page has attached assets, the
164
- assets:each tag will cycle through each asset. You can then use an image,
165
- link or url tag to display and connect your assets. Usage:
133
+ Another important tag is the `<r:assets:each>...</r:assets:each>` (note the plural namespace tag "assets"). If a page has attached assets, the `<r:assets:each>` tag will cycle through each asset. You can then use an image, `link` or `url` tag to display and connect your assets. Usage:
166
134
 
167
135
  <r:assets:each [limit=0] [offset=0] [order="asc|desc"] [by="position|title|..."]>
168
136
  ...
@@ -173,53 +141,37 @@ This tag uses the following parameters:
173
141
  * `limit` and `offset` let you specify a range of assets
174
142
  * `order` and `by` lets you control sorting
175
143
 
176
- The conditional tags <code><r:if_assets [min_count="0"]></code> and
177
- <code><r:unless_assets [min_count="0"]></code> allow you to optionally render
178
- content based on the existence of tags. They accept the same options as
179
- `<r:assets:each>`.
144
+ The conditional tags `<r:if_assets [min_count="0"]>` and `<r:unless_assets [min_count="0"]>` allow you to optionally render content based on the existence of tags. They accept the same options as `<r:assets:each>`.
180
145
 
181
- Thumbnails are automatically generated for images when the images are
182
- uploaded. By default, two sizes are made for use within the extension itself.
183
- These are "icon" 42px by 42px and "thumbnail" which is 100px square.
146
+ Thumbnails are automatically generated for images when the images are uploaded. By default, two sizes are made for use within the extension itself. These are "icon" 42px by 42px and "thumbnail" which is 100px square.
184
147
 
185
- You can access sizes of image assets for various versions with tags like
186
- `<r:asset:width [size="original"]/>` and <code><r:asset:height
187
- [size="original"]/></code>.
148
+ You can access sizes of image assets for various versions with tags like `<r:asset:width [size="original"]/>` and `<r:asset:height [size="original"]/>`.
188
149
 
189
- Also, for vertical centering of images, you have the handy
190
- `<r:asset:top_padding container="<container height>" [size="icon"]/>` tag.
191
- Working example:
150
+ Also, for vertical centering of images, you have the handy `<r:asset:top_padding container="<container height>" [size="icon"]/>` tag. Working example:
192
151
 
193
152
  <ul>
194
153
  <r:assets:each>
195
154
  <li style="height:140px">
196
- <img style="padding-top:<r:top_padding size='category' container='140' />px"
197
- src="<r:url />" alt="<r:title />" />
155
+ <img style="padding-top:<r:top_padding size='category' container='140'/>px" src="<r:url/>" alt="<r:caption/>">
198
156
  </li>
199
157
  </r:assets:each>
200
158
  </ul>
201
159
 
202
160
  ## Contributions
203
161
 
204
- This extension is a work in progress. If you would like to
205
- contribute, please fork the project and submit a pull request:
206
-
207
- <https://github.com/radiant/radiant-clipped-extension>
208
-
209
- Pull requests with working tests are preferred and have a greater chance of
210
- being merged.
211
-
212
- ## Support
162
+ If you would like to contribute, please [fork the project][fork] and submit a [pull request][pull-request].
213
163
 
214
- If you have questions about this extension please post a message to the
215
- Radiant-Dev mailing list:
164
+ [fork]: http://help.github.com/fork-a-repo/
165
+ [pull-request]: http://help.github.com/send-pull-requests/
216
166
 
217
- <http://groups.google.com/group/radiantcms-dev>
167
+ Pull requests with working tests are preferred and have a greater chance of being merged.
218
168
 
219
- If you would like to file a bug report or feature request, please create a
220
- GitHub issue here:
169
+ ## TODO
221
170
 
222
- <https://github.com/radiant/radiant-clipped-extension/issues>
171
+ * Progress bars while uploading assets
172
+ * Warning if you try and save a page while assets are still uploading
173
+ * Radius tags for the HTML video and audio elements
174
+ * Auxiliary extension to add video transcoding support
223
175
 
224
176
  ## Authors
225
177
 
@@ -227,4 +179,4 @@ GitHub issue here:
227
179
  * John Long
228
180
  * William Ross
229
181
 
230
- Copyright 2011 the radiant team. Released under the same terms as radiant.
182
+ Copyright 2011 the Radiant team. Released under the same terms as Radiant.
@@ -0,0 +1,2 @@
1
+ module Admin::PageAttachmentsHelper
2
+ end
data/app/models/asset.rb CHANGED
@@ -39,18 +39,13 @@ class Asset < ActiveRecord::Base
39
39
  asset.paperclip_processors
40
40
  },
41
41
  :whiny => false,
42
- :storage => RadiantClippedExtension::Cloud.storage ||
43
- :filesystem,
42
+ :storage => Radiant.config["paperclip.storage"],
44
43
  :path => Radiant.config["paperclip.path"],
45
- :url => Radiant.config["paperclip.url"],
46
- :fog_credentials => RadiantClippedExtension::Cloud.credentials,
47
- :fog_directory => Radiant.config["paperclip.fog.directory"] ||
48
- Radiant.config["paperclip.s3.bucket"],
49
- :fog_public => Radiant.config["paperclip.fog.public?"] ||
50
- true,
51
- :fog_host => Radiant.config["paperclip.fog.host"] ||
52
- "http://#{Radiant.config['paperclip.s3.host_alias']}" ||
53
- "http://#{Radiant.config['paperclip.url']}"
44
+ :url => Radiant.config["paperclip.url"],
45
+ :fog_credentials => RadiantClippedExtension::Cloud.credentials,
46
+ :fog_directory => Radiant.config["paperclip.fog.directory"],
47
+ :fog_public => Radiant.config["paperclip.fog.public?"] || true,
48
+ :fog_host => RadiantClippedExtension::Cloud.host
54
49
 
55
50
  before_save :assign_title
56
51
  before_save :assign_uuid
@@ -145,9 +145,9 @@ class AssetType
145
145
  #
146
146
  def configured_styles
147
147
  @configured_styles ||= if style_definitions = Radiant.config["assets.thumbnails.#{name}"]
148
- style_definitions.gsub(/\s/,'').split('|').each_with_object({}) do |definition, styles|
148
+ style_definitions.split('|').each_with_object({}) do |definition, styles|
149
149
  name, rule = definition.split(':')
150
- styles[name.to_sym] = rule
150
+ styles[name.strip.to_sym] = rule.strip
151
151
  end
152
152
  else
153
153
  {}
@@ -35,10 +35,8 @@ Radiant.config do |config|
35
35
  end
36
36
 
37
37
  pc.namespace 's3' do |s3|
38
- s3.define 'bucket'
39
38
  s3.define 'key'
40
39
  s3.define 'secret'
41
- s3.define 'host_alias'
42
40
  s3.define 'region', :select_from => {
43
41
  'Asia North East' => 'ap-northeast-1',
44
42
  'Asia South East' => 'ap-southeast-1',
@@ -0,0 +1,109 @@
1
+ ---
2
+ de:
3
+ assets: 'Assets'
4
+ asset_types:
5
+ all: 'Alle'
6
+ documents: 'Dokumente'
7
+ fonts: 'Schriftarten'
8
+ images: 'Bilder'
9
+ others: 'Andere'
10
+ audios: 'Audio'
11
+ flashes: 'Flash'
12
+ videos: 'Video'
13
+ pdfs: 'PDF'
14
+ swfs: 'Flash'
15
+
16
+ activerecord:
17
+ errors:
18
+ models:
19
+ asset:
20
+ attributes:
21
+ asset:
22
+ blank: 'Sie müssen eine Datei zum hochladen auswählen!'
23
+
24
+ clipped_extension:
25
+ actions: Aktionen
26
+ all: 'Alle'
27
+ all_thumbnails_refreshed: 'Alle Voransichten wurden aktualisiert.'
28
+ alt_text_or_title: 'Bildbeschreibung oder Titel <span class="hint">(optional)</span>'
29
+ asset: 'Asset'
30
+ asset_edit_title: Asset bearbeiten
31
+ asset_errors: 'Ein Fehler ist aufgetreten. {{errors}}'
32
+ asset_page_attachment_note: 'Angehangene Assets. Diese können per drag&drop eingefügt oder mit dem <code>&lt;r:assets:each /&gt;</code> tag angezeigt werden.'
33
+ asset_note: 'Angehangene assets. '
34
+ assets: 'Assets'
35
+ assets_explanation: 'Assets und Bilder können hochgeladen und dann an Seiten angehangen oder eingefügt werden. Klicken sie auf den Namen, um das Asset zu bearbeiten, oder <code>Löschen</code> um es zu entfernen.'
36
+ assets_title: 'Assets'
37
+ asset_page_upload_note: 'Hier hochgeladene Assets werden automatisch mit dieser Seite verknüpft sein.'
38
+ asset_upload_note: 'Wählen sie ein Assets aus, um es hochzuladen. Wenn der <code>Titel</code> leer ist, wird statt dessen der Dateiname ohne Endung verwendet. Mit <code>Mehr</code> können Sie auch einen Untertitel angeben.'
39
+ attached_assets: 'Angehangene Assets'
40
+ attach: Anhängen
41
+ attach_asset: 'Asset anhängen'
42
+ attach_assets: 'Assets anhängen'
43
+ attach_existing: Bestehendes anhängen
44
+ attach_to_page: 'Mit Seite verknüpfen'
45
+ audio: 'Audio'
46
+ cancel_attachment: 'Anhang lösen'
47
+ copy: 'kopieren'
48
+ copy_alt: 'Radius Tag in die Zwischenablage'
49
+ choose_file: Datei auswählen
50
+ documents: 'Dokumente'
51
+ caption: Untertitel
52
+ confirm_refresh_assets: 'Sind sie sicher, alle Voransichten aktualisieren zu wollen? Dies wird voraussichtlich eine lange Zeit und erhebliche Serverressourcen in Anspruch nehmen. <strong class="warning">Die Leistung der Webseite wird währenddessen beeinflusst sein</strong> und ihr Browser könnte die Verbindung schließen, bevor der Vorgang abgeschlossen ist. Wir empfehlen dies nur, wenn der Umfang der Asset-Bibliothek klein ist.'
53
+ confirm_remove_asset: 'Sind sie sicher, dieses Asset <strong class="warning">dauerhaft entfernen</strong> zu wollen?'
54
+ confirm_remove_from_page: 'Sind sie sicher, dieses Assets von der Seite entfernen zu wollen?'
55
+ delete_asset: 'Asset löschen'
56
+ detach: 'Verknüpfung lösen'
57
+ edit: Bearbeiten
58
+ edit_asset: 'Bearbeite {{asset}}'
59
+ filename: Dateiname
60
+ find_assets: Assets finden
61
+ images: 'Bilder'
62
+ images_automatically_created: 'Bilder werden automatisch angelegt'
63
+ insert: Einsetzen
64
+ modify: 'Bearbeiten'
65
+ movies: 'Filme'
66
+ need_to_upload: 'Möchten Sie etwas hochladen?'
67
+ new_asset: Neues Asset anlegen
68
+ no_assets_found: 'Es wurden keine Assets gefunden.'
69
+ no_assets: 'Keine Assets'
70
+ no_attached_assets: Keine Assets angehangen
71
+ others: 'Andere'
72
+ refresh_assets: Alle Assets aktualisieren
73
+ regenerate: Neu anlegen
74
+ regenerate_thumbnails: Vorschau neu anlegen
75
+ remove_asset: 'Asset entfernen'
76
+ remove_from_page: 'Von der Seite entfernen'
77
+ reorder: 'Anordnen'
78
+ remove: Löschen
79
+ refresh_assets_rake_task: 'Es ist empfehlenswert, sich auf dem Server anzumelden und das Kommando <code>rake paperclip:refresh class=Asset</code> auszuführen.'
80
+ replace_file: Datei ersetzen
81
+ save_and_upload: 'Speichern und hochladen'
82
+ search_assets: 'Assets suchen'
83
+ search: 'Suchen'
84
+ select: 'Auswählen'
85
+ thumbnails_refreshed: Voransichten wurden neu angelegt
86
+ title: Titel
87
+ type: 'Typ'
88
+ types_to_find: 'Zu suchender Typ'
89
+ upload: Hochladen
90
+ upload_asset: Asset hochladen
91
+
92
+ config:
93
+ assets:
94
+ additional_thumbnails: 'Weitere Voransichten'
95
+ content_types: 'Inhaltstypen'
96
+ create_image_thumbnails?: 'Bilder zeigen'
97
+ create_pdf_thumbnails?: 'PDF zeigen'
98
+ create_video_thumbnails?: 'Video zeigen'
99
+ display_size: 'Anzeigegröße'
100
+ insertion_size: 'Einfügegröße'
101
+ max_asset_size: 'Max Assetgröße'
102
+ path: 'Pfad'
103
+ s3:
104
+ bucket: 'Bucket'
105
+ key: 'Schlüssel'
106
+ secret: 'Secret'
107
+ skip_filetype_validation: 'Typerkennung überspringen?'
108
+ storage: 'Speicherung'
109
+ url: 'Url'
@@ -4,7 +4,13 @@ class UpdateConfiguration < ActiveRecord::Migration
4
4
 
5
5
  puts "Importing paperclip configuration"
6
6
  %w{url path skip_filetype_validation storage}.select{|k| !!Radiant.config["assets.#{k}"] }.each do |k|
7
- Radiant.config["paperclip.#{k}"] = Radiant.config["assets.#{k}"]
7
+ begin
8
+ Radiant.config["paperclip.#{k}"] = Radiant.config["assets.#{k}"]
9
+ rescue ActiveRecord::RecordInvalid => e
10
+ print "Oops! There was trouble setting #{k} to '#{Radiant.config["assets.#{k}"]}'"
11
+ print "\nSetting it to 'fog'. Please see the clipped extension README for more details."
12
+ Radiant.config["paperclip.#{k}"] = 'fog'
13
+ end
8
14
  end
9
15
 
10
16
  puts "Importing s3 storage configuration"
data/lib/cloud.rb CHANGED
@@ -5,20 +5,20 @@ module RadiantClippedExtension
5
5
  def self.credentials
6
6
  case Radiant.config["paperclip.fog.provider"]
7
7
  when "AWS"
8
- return {
8
+ {
9
9
  :provider => "AWS",
10
10
  :aws_access_key_id => Radiant.config["paperclip.s3.key"],
11
11
  :aws_secret_access_key => Radiant.config["paperclip.s3.secret"],
12
12
  :region => Radiant.config["paperclip.s3.region"],
13
13
  }
14
14
  when "Google"
15
- return {
15
+ {
16
16
  :provider => "Google",
17
17
  :rackspace_username => Radiant.config["paperclip.google_storage.access_key_id"],
18
18
  :rackspace_api_key => Radiant.config["paperclip.google_storage.secret_access_key"]
19
19
  }
20
20
  when "Rackspace"
21
- return {
21
+ {
22
22
  :provider => "Rackspace",
23
23
  :rackspace_username => Radiant.config["paperclip.rackspace.username"],
24
24
  :rackspace_api_key => Radiant.config["paperclip.rackspace.api_key"]
@@ -26,11 +26,13 @@ module RadiantClippedExtension
26
26
  end
27
27
  end
28
28
 
29
- def self.storage
30
- if Radiant.config["paperclip.storage"] == "s3"
31
- :fog
29
+ def self.host
30
+ return Radiant.config["paperclip.fog.host"] if Radiant.config["paperclip.fog.host"]
31
+ case Radiant.config["paperclip.fog.provider"]
32
+ when "AWS"
33
+ "http://#{Radiant.config['paperclip.fog.directory']}.s3.amazonaws.com"
32
34
  else
33
- Radiant.config["paperclip.storage"]
35
+ nil
34
36
  end
35
37
  end
36
38
 
@@ -0,0 +1,53 @@
1
+ Radiant.config do |config|
2
+
3
+ # Uncomment and change the settings below to customize the Clipped extension
4
+
5
+ # The default settings
6
+ # config["paperclip.url"] = "/system/:attachment/:id/:style/:basename:no_original_style.:extension"
7
+ # config["paperclip.path"] = ":rails_root/public/system/:attachment/:id/:style/:basename:no_original_style.:extension"
8
+ # config["paperclip.storage"] = "filesystem"
9
+ # config["paperclip.skip_filetype_validation"] = true
10
+ # config["assets.max_asset_size"] = 5 # megabytes
11
+ # config["assets.display_size"] = "normal"
12
+ # config["assets.insertion_size"] = "normal"
13
+ # config["assets.create_image_thumbnails?"] = true
14
+ # config["assets.create_video_thumbnails?"] = true
15
+ # config["assets.create_pdf_thumbnails?"] = true
16
+ # Check http://www.imagemagick.org/script/command-line-processing.php#geometry
17
+ # for more details on ImageMagick settings for thumbnail generation
18
+ # config["assets.thumbnails.image"] = "normal:size=640x640>|small:size=320x320>"
19
+ # config["assets.thumbnails.video"] = "normal:size=640x640>,format=jpg|small:size=320x320>,format=jpg"
20
+ # config["assets.thumbnails.pdf"] = "normal:size=640x640>,format=jpg|small:size=320x320>,format=jpg"
21
+
22
+ # An example of using Amazon S3
23
+ # add `gem "fog", "~> 1.0"` to your Gemfile and run `bundle install`
24
+ # config["paperclip.storage"] = "fog"
25
+ # config["paperclip.path"] = ":attachment/:id/:style/:basename:no_original_style.:extension"
26
+ # config["paperclip.fog.provider"] = "AWS"
27
+ # config["paperclip.fog.directory"] = "bucket-name"
28
+ # config["paperclip.s3.key"] = "S3_KEY"
29
+ # config["paperclip.s3.secret"] = "S3_SECRET"
30
+ # optionally use a custom domain name; requires a CNAME DNS record
31
+ # config["paperclip.fog.host"] = "http://assets.example.com"
32
+ # optionally set the S3 region of your bucket; defaults to US East
33
+ # Asia North East => ap-northeast-1
34
+ # Asia South East => ap-southeast-1
35
+ # EU West => eu-west-1
36
+ # US East => us-east-1
37
+ # US West => us-west-1
38
+ # config["paperclip.s3.region"] = "us-east-1"
39
+
40
+ # An example of using Rackspace Cloud Files
41
+ # add `gem "fog", "~> 1.0"` to your Gemfile and run `bundle install`
42
+ # config["paperclip.storage"] = "fog"
43
+ # config["paperclip.path"] = ":attachment/:id/:style/:basename:no_original_style.:extension"
44
+ # config["paperclip.fog.provider"] = "Rackspace"
45
+ # config["paperclip.fog.directory"] = "container-name"
46
+ # config["paperclip.rackspace.username"] = "RACKSPACE_USERNAME"
47
+ # config["paperclip.rackspace.api_key"] = "RACKSPACE_API_KEY"
48
+ # paperclip.fog.host is your Cloud Files CDN URL
49
+ # config["paperclip.fog.host"] = "http://a.b.c.rackcdn.com"
50
+ # optionally use a custom domain name; requires a CNAME DNS record
51
+ # config["paperclip.fog.host"] = "http://assets.example.com"
52
+
53
+ end
@@ -1,5 +1,5 @@
1
1
  module RadiantClippedExtension
2
- VERSION = "1.0.14"
2
+ VERSION = "1.0.15"
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"
@@ -20,7 +20,7 @@ namespace :radiant do
20
20
  end
21
21
 
22
22
  desc "Copies public assets of the Clipped extension to the instance public/ directory."
23
- task :update => :environment do
23
+ task :update => [:environment, :initialize] do
24
24
  is_svn_or_dir = proc {|path| path =~ /\.svn/ || File.directory?(path) }
25
25
  puts "Copying assets from ClippedExtension"
26
26
  Dir[ClippedExtension.root + "/public/**/*"].reject(&is_svn_or_dir).each do |file|
@@ -112,6 +112,13 @@ If you would like to use this mode type \"yes\", type \"no\" or just hit enter t
112
112
  ClippedExtension.migrator.new(:up, ClippedExtension.migrations_path).send(:assume_migrated_upto_version, 3)
113
113
  ClippedExtension.migrator.migrate
114
114
  end
115
+
116
+ desc "Generate an example initializer"
117
+ task :initialize do
118
+ puts "Copying initializer from ClippedExtension"
119
+ cp ClippedExtension.root + "/lib/generators/templates/clipped_config.rb", RAILS_ROOT + "/config/initializers/", :verbose => false
120
+ end
121
+
115
122
  end
116
123
  end
117
124
  end
@@ -168,7 +168,7 @@ Asset.MakeSortable = function (element) {
168
168
  var sorter = Sortable.create(element, {
169
169
  overlap: 'horizontal',
170
170
  constraint: false,
171
- handle: 'title',
171
+ handle: 'back',
172
172
  onChange: function (e) {
173
173
  Asset.SetPositions();
174
174
  Asset.Notify('Assets reordered. Save page to commit changes.');
@@ -171,10 +171,8 @@ p.asset
171
171
  color: #d99
172
172
  ul.sortable
173
173
  li.asset
174
- div.title
174
+ div.back
175
175
  cursor: move
176
- &:hover
177
- font-weight: bold
178
176
 
179
177
  #assets_table.assets
180
178
  position: relative
@@ -42,13 +42,14 @@ describe AssetType do
42
42
  context 'with configured thumbnail sizes' do
43
43
  before {
44
44
  Radiant.config["assets.create_configured_thumbnails?"] = true
45
- Radiant.config["assets.thumbnails.configured"] = "special:size=800x800>,format=jpg|tiny:size=10x10#,format=png"
45
+ Radiant.config["assets.thumbnails.configured"] = "special:size=800x800>,format=jpg|tiny:size=10x10#,format=png|custom:size=1x1,convert_options=-quality 33 -interlace Plane"
46
46
  }
47
47
  subject{ AssetType.find(:configured) }
48
48
  its(:paperclip_processors) { should == [:dummy] }
49
49
  its(:paperclip_styles) { should == {
50
50
  :special => {:geometry => "800x800>", :format => 'jpg'},
51
- :tiny => {:geometry => "10x10#", :format => 'png'}
51
+ :tiny => {:geometry => "10x10#", :format => 'png'},
52
+ :custom => {:geometry => "1x1", :convert_options='-quality 33 -interlace Plane'}
52
53
  }}
53
54
  end
54
55
 
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: 11
4
+ hash: 9
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 14
10
- version: 1.0.14
9
+ - 15
10
+ version: 1.0.15
11
11
  platform: ruby
12
12
  authors:
13
13
  - Keith Bingman
@@ -19,7 +19,8 @@ autorequire:
19
19
  bindir: bin
20
20
  cert_chain: []
21
21
 
22
- date: 2011-11-11 00:00:00 Z
22
+ date: 2012-01-05 00:00:00 -06:00
23
+ default_executable:
23
24
  dependencies:
24
25
  - !ruby/object:Gem::Dependency
25
26
  name: acts_as_list
@@ -82,6 +83,7 @@ files:
82
83
  - app/controllers/admin/assets_controller.rb
83
84
  - app/controllers/admin/page_attachments_controller.rb
84
85
  - app/helpers/admin/assets_helper.rb
86
+ - app/helpers/admin/page_attachments_helper.rb
85
87
  - app/models/asset.rb
86
88
  - app/models/asset_type.rb
87
89
  - app/models/old_page_attachment.rb
@@ -116,6 +118,7 @@ files:
116
118
  - config/initializers/interpolation.rb
117
119
  - config/initializers/processors.rb
118
120
  - config/initializers/radiant_config.rb
121
+ - config/locales/de.yml
119
122
  - config/locales/en.yml
120
123
  - config/locales/nl.yml
121
124
  - config/routes.rb
@@ -133,6 +136,7 @@ files:
133
136
  - lib/asset_tags.rb
134
137
  - lib/clipped_admin_ui.rb
135
138
  - lib/cloud.rb
139
+ - lib/generators/templates/clipped_config.rb
136
140
  - lib/page_asset_associations.rb
137
141
  - lib/paperclip/frame_grab.rb
138
142
  - lib/paperclip/geometry_transformation.rb
@@ -202,6 +206,7 @@ files:
202
206
  - wireframes/edit-page-assets.png
203
207
  - wireframes/edit-page.bmml
204
208
  - wireframes/edit-page.png
209
+ has_rdoc: true
205
210
  homepage: http://radiantcms.org
206
211
  licenses: []
207
212
 
@@ -231,7 +236,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
231
236
  requirements: []
232
237
 
233
238
  rubyforge_project:
234
- rubygems_version: 1.8.10
239
+ rubygems_version: 1.3.9.3
235
240
  signing_key:
236
241
  specification_version: 3
237
242
  summary: Assets for Radiant CMS