refinerycms-images 2.0.8 → 2.0.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -44,7 +44,7 @@ module Refinery
44
44
  @images << (@image = ::Refinery::Image.create(params[:image]))
45
45
  else
46
46
  params[:image][:image].each do |image|
47
- @images << (@image = ::Refinery::Image.create(:image => image))
47
+ @images << (@image = ::Refinery::Image.create({:image => image}.merge(params[:image].except(:image))))
48
48
  end
49
49
  end
50
50
  rescue Dragonfly::FunctionManager::UnableToHandle
@@ -3,13 +3,13 @@
3
3
  <%= render '/refinery/admin/search', :url => refinery.admin_images_path %>
4
4
  </li>
5
5
  <li>
6
- <%= link_to t('.create_new_image'), refinery.new_admin_image_path(:dialog => true), :class => "add_icon" %>
6
+ <%= link_to t('.create_new_image'), refinery.new_admin_image_path(:dialog => true), :class => 'add_icon' %>
7
7
  </li>
8
8
  <% other_image_views.each do |image_view| %>
9
9
  <li>
10
10
  <%= link_to t('switch_to', :scope => 'refinery.admin.images.index.view', :view_name => t("#{image_view}", :scope => 'refinery.admin.images.index.view')),
11
11
  refinery.admin_images_path(:view => image_view, :page => params[:page]),
12
- :class => "reorder_icon" %>
12
+ :class => 'reorder_icon' %>
13
13
  </li>
14
14
  <% end %>
15
15
  </ul>
@@ -1,11 +1,11 @@
1
- <div id='existing_image_area' class='dialog_area' <%= "style='display:none;'" if @image.errors.any? %>>
1
+ <div id="existing_image_area" class="dialog_area" <%= 'style="display:none;"'.html_safe if @image.errors.any? %>>
2
2
  <%= render '/refinery/admin/search', :url => refinery.insert_admin_images_path(params.dup.except('image')) %>
3
- <input type='hidden' name='selected_image' id='selected_image' />
4
- <div id='existing_image_area_content' class='clearfix'>
3
+ <input type="hidden" name="selected_image" id="selected_image" />
4
+ <div id="existing_image_area_content" class="clearfix">
5
5
  <% if @images.any? %>
6
6
  <ul>
7
7
  <% @images.each do |image| -%>
8
- <li<%= " class='selected'" if @image_id == image.id %>>
8
+ <li<%= ' class="selected"'.html_safe if @image_id == image.id %>>
9
9
  <%= image_fu(image, '106x106#c', {
10
10
  :alt => image.title,
11
11
  :title => image.title,
@@ -19,15 +19,14 @@
19
19
  <%= t('no_results', :scope => 'refinery.admin.search') %>
20
20
  <% end %>
21
21
  </div>
22
-
23
- <%= will_paginate @images, :params => params.dup %>
22
+ <%= will_paginate @images, :params => params.dup.merge(:action => "insert") %>
24
23
 
25
24
  <% unless @app_dialog or @images.empty? %>
26
- <div id='existing_image_size_area' class='clearfix'>
27
- <input type='hidden' name='selected_image_size' id='selected_image_size' />
25
+ <div id="existing_image_size_area" class="clearfix">
26
+ <input type="hidden" name="selected_image_size" id="selected_image_size" />
28
27
  <p>
29
28
  <input type="checkbox" id="wants_to_resize_image" name="wants_to_resize_image" value="1" checked="checked" />
30
- <label for='wants_to_resize_image' class='stripped' style='font-weight: bold;'>
29
+ <label for="wants_to_resize_image" class="stripped" style="font-weight: bold;">
31
30
  <%= t('.resize_image') %>
32
31
  </label>
33
32
  </p>
@@ -5,7 +5,7 @@
5
5
  :object => @image,
6
6
  :include_object_name => false %>
7
7
 
8
- <div class='field'>
8
+ <div class="field">
9
9
  <% if action_name =~ /(edit)|(update)/ %>
10
10
  <p>
11
11
  <%= t('.use_current_image') %>
@@ -20,30 +20,30 @@
20
20
  <% end %>
21
21
  </div>
22
22
 
23
- <div class='field'>
23
+ <div class="field">
24
24
  <label><%= t('.maximum_image_size', :bytes => number_to_human_size(Refinery::Images.max_image_size)) %></label>
25
25
  </div>
26
26
 
27
- <input type='hidden' name='wymeditor' value='<%= params[:wymeditor] %>'>
27
+ <input type="hidden" name="wymeditor" value="<%= params[:wymeditor] %>">
28
28
 
29
29
  <%= render '/refinery/admin/form_actions', :f => f,
30
30
  :continue_editing => false,
31
- :hide_cancel => (@app_dialog or action_name == "insert" or from_dialog?),
31
+ :hide_cancel => (@app_dialog or action_name == 'insert' or from_dialog?),
32
32
  :delete_title => t('delete', :scope => 'refinery.admin.images'),
33
33
  :delete_confirmation => t('message', :scope => 'refinery.admin.delete', :title => @image.image_name) -%>
34
34
 
35
35
  <% if @app_dialog %>
36
- <input type='hidden' name='app_dialog' value='<%= @app_dialog %>' />
37
- <input type='hidden' name='field' value='<%= @field %>' />
38
- <input type='hidden' name='update_image' value='<%= @update_image %>' />
39
- <input type='hidden' name='thumbnail' value='<%= @thumbnail %>' />
40
- <input type='hidden' name='callback' value='<%= @callback %>' />
41
- <input type='hidden' name='conditions' value='<%= @conditions %>' />
36
+ <input type="hidden" name="app_dialog" value="<%= @app_dialog %>" />
37
+ <input type="hidden" name="field" value="<%= @field %>" />
38
+ <input type="hidden" name="update_image" value="<%= @update_image %>" />
39
+ <input type="hidden" name="thumbnail" value="<%= @thumbnail %>" />
40
+ <input type="hidden" name="callback" value="<%= @callback %>" />
41
+ <input type="hidden" name="conditions" value="<%= @conditions %>" />
42
42
  <% end %>
43
43
  <% end %>
44
44
 
45
45
  <% if action_name =~ /(edit)|(update)/ %>
46
- <div id='existing_image'>
46
+ <div id="existing_image">
47
47
  <label><%=t('.current_image') %></label>
48
48
  <%= image_fu @image, '225x255>', :class => "brown_border" %>
49
49
  </div>
@@ -1,17 +1,17 @@
1
1
  <ul id="image_grid" class="<%= ['clearfix', 'pagination_frame', pagination_css_class].compact.join(' ') %>">
2
2
  <% @images.each_with_index do |image, index| -%>
3
- <li id="image_<%= image.id %>" class='image_<%= index % 5 %>'>
3
+ <li id="image_<%= image.id %>" class="image_<%= index % 5 %>">
4
4
  <%= image_fu image, '135x135#c', :title => image.title %>
5
- <span class='actions'>
5
+ <span class="actions">
6
6
  <%= link_to refinery_icon_tag('eye.png'), image.url,
7
- :target => "_blank",
7
+ :target => '_blank',
8
8
  :title => t('.view_live_html') %>
9
9
  <%= link_to refinery_icon_tag('application_edit.png'),
10
10
  refinery.edit_admin_image_path(image),
11
11
  :title => t('edit', :scope => 'refinery.admin.images') %>
12
12
  <%= link_to refinery_icon_tag('delete.png'),
13
13
  refinery.admin_image_path(image),
14
- :class => "cancel confirm-delete",
14
+ :class => 'cancel confirm-delete',
15
15
  :title => t('delete', :scope => 'refinery.admin.images'),
16
16
  :data => {
17
17
  :confirm => t('message', :scope => 'refinery.admin.delete', :title => image.title)
@@ -1,17 +1,17 @@
1
- <li id="sortable_<%= list_view_image.id %>" class='clearfix record <%= cycle("on", "on-hover") %>'>
2
- <span class='title'>
1
+ <li id="sortable_<%= list_view_image.id %>" class="clearfix record <%= cycle('on', 'on-hover') %>">
2
+ <span class="title">
3
3
  <%= list_view_image.title %> <span class="preview">&nbsp;</span>
4
4
  </span>
5
- <span class='actions'>
5
+ <span class="actions">
6
6
  <%= link_to refinery_icon_tag('eye.png'), list_view_image.url,
7
- :target => "_blank",
8
- :title => "#{image_fu list_view_image, '96x96#c', :size => '96x96'}" %>
7
+ :target => '_blank',
8
+ :title => image_fu(list_view_image, '96x96#c', :size => '96x96') %>
9
9
  <%= link_to refinery_icon_tag('application_edit.png'),
10
10
  refinery.edit_admin_image_path(list_view_image),
11
11
  :title => t('edit', :scope => 'refinery.admin.images') %>
12
12
  <%= link_to refinery_icon_tag('delete.png'),
13
13
  refinery.admin_image_path(list_view_image),
14
- :class => "cancel confirm-delete",
14
+ :class => 'cancel confirm-delete',
15
15
  :title => t('delete', :scope => 'refinery.admin.images'),
16
16
  :data => {
17
17
  :confirm => t('message', :scope => 'refinery.admin.delete', :title => list_view_image.title)
@@ -1,7 +1,7 @@
1
1
  <% if searching? %>
2
2
  <h2><%= t('results_for', :scope => 'refinery.admin.search', :query => params[:search]) %></h2>
3
3
  <% end %>
4
- <div class='pagination_container'>
4
+ <div class="pagination_container">
5
5
  <% if @images.any? %>
6
6
  <%= render 'images' %>
7
7
  <% else %>
@@ -1,6 +1,6 @@
1
- <section id='records'>
1
+ <section id="records">
2
2
  <%= render 'records' %>
3
3
  </section>
4
- <section id='actions'>
4
+ <section id="actions">
5
5
  <%= render 'actions' %>
6
6
  </section>
@@ -1,25 +1,25 @@
1
- <% user_can_modify_images = ::Refinery::Plugins.active.names.include?("refinery_images") %>
2
- <div id='dialog_menu_left'>
1
+ <% user_can_modify_images = ::Refinery::Plugins.active.names.include?('refinery_images') %>
2
+ <div id="dialog_menu_left">
3
3
  <% if (any_images = @images.any?) or searching? %>
4
- <span id="existing_image_radio" class="radio<%= " selected_radio" if (no_errors = @image.errors.empty?) %>">
5
- <input type='radio' name='image_type' value='existing_image' id='image_type_existing'<%= " checked='true'" if no_errors or searching? %> />
6
- <label for='image_type_existing' class='stripped'><%= t('.existing_image') %></label>
4
+ <span id="existing_image_radio" class="radio<%= ' selected_radio' if (no_errors = @image.errors.empty?) %>">
5
+ <input type="radio" name="image_type" value="existing_image" id="image_type_existing"<%= ' checked="true"'.html_safe if no_errors or searching? %> />
6
+ <label for="image_type_existing" class="stripped"><%= t('.existing_image') %></label>
7
7
  </span>
8
8
  <% end %>
9
9
  <% if user_can_modify_images %>
10
- <span id="upload_image_radio" class="radio<%= " selected_radio" if !no_errors and !any_images %>">
11
- <input type='radio' name='image_type' value='upload_image' id='image_type_upload'<%= " checked='true'" if (!any_images or !no_errors) and !searching? %> />
12
- <label for='image_type_upload' class='stripped'><%= t('.new_image') %></label>
10
+ <span id="upload_image_radio" class="radio<%= ' selected_radio' if !no_errors and !any_images %>">
11
+ <input type="radio" name="image_type" value="upload_image" id="image_type_upload"<%= ' checked="true"'.html_safe if (!any_images or !no_errors) and !searching? %> />
12
+ <label for="image_type_upload" class="stripped"><%= t('.new_image') %></label>
13
13
  </span>
14
14
  <% end %>
15
15
  </div>
16
16
 
17
- <div id='dialog_main'>
17
+ <div id="dialog_main">
18
18
  <% if any_images or user_can_modify_images %>
19
19
  <%= render 'existing_image' if any_images or searching? %>
20
20
 
21
21
  <% if user_can_modify_images %>
22
- <div id='upload_image_area' class='dialog_area'<%= " style='display:none;'" if any_images and (no_errors or searching?) %>>
22
+ <div id="upload_image_area" class="dialog_area"<%= ' style="display:none;"'.html_safe if any_images and (no_errors or searching?) %>>
23
23
  <%= render 'form', :insert => true %>
24
24
  </div>
25
25
  <% end %>
@@ -42,3 +42,4 @@ fr:
42
42
  blank: Vous devez sélectionner une image à télécharger
43
43
  too_big: L'image doit être plus petite que %{size} megaoctets
44
44
  incorrect_format: 'Seules les images aux formats JPG, PNG or GIF sont acceptées'
45
+ different_file_name: La nouvelle image ne peut pas avoir un nom de fichier différent
@@ -42,3 +42,4 @@ sk:
42
42
  blank: Musíte zadať obrázok ktorý chcete nahrať.
43
43
  too_big: Maximálna veľkosť obrázku %{size}MB in size.
44
44
  incorrect_format: 'Obrázok musí byť vo formáte JPG, PNG alebo GIF.'
45
+ different_file_name: Nový obrázok nesmie mať odlišný názov súboru
@@ -1,3 +1,4 @@
1
+ # encoding: utf-8
1
2
  Refinery::Images.configure do |config|
2
3
  # Configures the maximum allowed upload size (in bytes) for an image
3
4
  # config.max_image_size = <%= Refinery::Images.max_image_size.inspect %>
@@ -13,10 +13,10 @@ Gem::Specification.new do |s|
13
13
  s.email = %q{info@refinerycms.com}
14
14
  s.homepage = %q{http://refinerycms.com}
15
15
  s.rubyforge_project = %q{refinerycms}
16
- s.authors = ['Philip Arndt', 'Uģis Ozols', 'Rob Yurkowski', 'David Jones', 'Steven Heidel']
16
+ s.authors = ['Philip Arndt', 'Uģis Ozols', 'Rob Yurkowski']
17
17
  s.license = %q{MIT}
18
18
  s.require_paths = %w(lib)
19
-
19
+
20
20
  s.files = `git ls-files`.split("\n")
21
21
  s.test_files = `git ls-files -- spec/*`.split("\n")
22
22
 
metadata CHANGED
@@ -1,19 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: refinerycms-images
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.8
4
+ version: 2.0.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - Philip Arndt
9
9
  - Uģis Ozols
10
10
  - Rob Yurkowski
11
- - David Jones
12
- - Steven Heidel
13
11
  autorequire:
14
12
  bindir: bin
15
13
  cert_chain: []
16
- date: 2012-08-18 00:00:00.000000000 Z
14
+ date: 2012-11-21 00:00:00.000000000 Z
17
15
  dependencies:
18
16
  - !ruby/object:Gem::Dependency
19
17
  name: dragonfly
@@ -54,7 +52,7 @@ dependencies:
54
52
  requirements:
55
53
  - - '='
56
54
  - !ruby/object:Gem::Version
57
- version: 2.0.8
55
+ version: 2.0.9
58
56
  type: :runtime
59
57
  prerelease: false
60
58
  version_requirements: !ruby/object:Gem::Requirement
@@ -62,7 +60,7 @@ dependencies:
62
60
  requirements:
63
61
  - - '='
64
62
  - !ruby/object:Gem::Version
65
- version: 2.0.8
63
+ version: 2.0.9
66
64
  description: Handles all image upload and processing functionality in Refinery CMS.
67
65
  email: info@refinerycms.com
68
66
  executables: []
@@ -145,7 +143,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
145
143
  version: '0'
146
144
  segments:
147
145
  - 0
148
- hash: -902752083579033952
146
+ hash: -69282291348797146
149
147
  required_rubygems_version: !ruby/object:Gem::Requirement
150
148
  none: false
151
149
  requirements:
@@ -154,10 +152,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
154
152
  version: '0'
155
153
  segments:
156
154
  - 0
157
- hash: -902752083579033952
155
+ hash: -69282291348797146
158
156
  requirements: []
159
157
  rubyforge_project: refinerycms
160
- rubygems_version: 1.8.22
158
+ rubygems_version: 1.8.24
161
159
  signing_key:
162
160
  specification_version: 3
163
161
  summary: Images extension for Refinery CMS