alchemy-dragonfly-s3 3.6.5 → 5.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 43d486949d83cda52100aab656f93b8c276ecc4e2c4577e84dd1921b2abcb32f
4
- data.tar.gz: 772ceb298066554a3fe690ce5aeeb155c373700a8fde26fc50c713be5a33a2d2
3
+ metadata.gz: 02d80fac356bf2e699b152896713ac7731cb23f0a1e26b0b6eba79648c90236d
4
+ data.tar.gz: fbbe2ced0c05ff53e75df1cd39a3d7b754dad998c0230a896b9ceadae2e3864b
5
5
  SHA512:
6
- metadata.gz: 7262efcb1a894beaf15a5a6429ea2896f5b82f43f74640838d0ae47a6eb14e00e25becc132410bae0707ee264ab62ffa196b38435ee608ab09275bcb67fcf06c
7
- data.tar.gz: 6c3d12b410d694577530a88aa2c2060d36037f5ff1fd832499538585cec2de1cc1370e65b3afa9fada0b7c62a1f379a72fa7aca770482951561c143d69d05589
6
+ metadata.gz: f9af0f1daaeedc925e70fe185968e7ea02f93f10d8dce08a06c0360e30445bbefe0bdceade9c99e9f7c6c616cb83f5699fadce2a0214121a8f486c0c23031dbb
7
+ data.tar.gz: 4f2ffac175138c3f792615c20d14c32724c79f922f16bb993d94af2f441a2c17585716b89160d7ea2927c9afc319004e3dc79b976485f2d6e7ca3ac45293b85a
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- [![Build Status](https://travis-ci.com/AlchemyCMS/alchemy-dragonfly-s3.svg?branch=alchemy-3)](https://travis-ci.com/AlchemyCMS/alchemy-dragonfly-s3)
1
+ [![Build Status](https://travis-ci.com/AlchemyCMS/alchemy-dragonfly-s3.svg?branch=alchemy-5)](https://travis-ci.com/AlchemyCMS/alchemy-dragonfly-s3)
2
2
 
3
3
  # AlchemyCMS AWS S3
4
4
 
@@ -6,16 +6,18 @@ Adds support for file attachments and rendered Alchemy thumbnails stored on Amaz
6
6
 
7
7
  ## Alchemy Version
8
8
 
9
- This branch works with Alchemy 3.6 only.
9
+ This branch works with Alchemy 5.0 only.
10
10
 
11
- - For a Alchemy 5 compatible version use the `master` branch.
11
+ - For a Alchemy 5.1 compatible version use the `master` branch.
12
+ - For a Alchemy 4 compatible version use the `alchemy-4` branch.
13
+ - For a Alchemy 3.6 compatible version use the `alchemy-3` branch.
12
14
 
13
15
  ## Installation
14
16
 
15
17
  Add this line to your application's Gemfile:
16
18
 
17
19
  ```ruby
18
- gem 'alchemy-dragonfly-s3', github: 'AlchemyCMS/alchemy-dragonfly-s3', branch: 'alchemy-3'
20
+ gem 'alchemy-dragonfly-s3', github: 'AlchemyCMS/alchemy-dragonfly-s3', branch: 'alchemy-5'
19
21
  ```
20
22
 
21
23
  And then execute:
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Alchemy
4
- class Attachment < ActiveRecord::Base
4
+ class Attachment < BaseRecord
5
5
  class S3Url
6
6
  def self.call(attachment)
7
7
  attachment.file.remote_url
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Alchemy
4
- class Picture < ActiveRecord::Base
4
+ class Picture < BaseRecord
5
5
  class S3Url
6
6
  attr_reader :variant
7
7
 
@@ -3,7 +3,7 @@
3
3
  module Alchemy
4
4
  # The persisted version of a rendered picture variant
5
5
  #
6
- class PictureThumb < ActiveRecord::Base
6
+ class PictureThumb < BaseRecord
7
7
  belongs_to :picture, class_name: "Alchemy::Picture"
8
8
 
9
9
  validates :signature, presence: true
@@ -1,5 +1,5 @@
1
1
  module Alchemy
2
- class PictureThumb < ActiveRecord::Base
2
+ class PictureThumb < BaseRecord
3
3
  # Stores the render result of a Alchemy::PictureVariant
4
4
  # in the Dragonfly S3 datastore
5
5
  #
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Alchemy
4
- class PictureThumb < ActiveRecord::Base
4
+ class PictureThumb < BaseRecord
5
5
  class Signature
6
6
  # Returns a unique image process signature
7
7
  #
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Alchemy
4
- class PictureThumb < ActiveRecord::Base
4
+ class PictureThumb < BaseRecord
5
5
  class Uid
6
6
  # Returns a image variant uid for storage
7
7
  #
@@ -1,7 +1,7 @@
1
1
  <div class="resource_info">
2
2
  <div class="value">
3
3
  <label>
4
- <%= render_icon @attachment.icon_css_class %>
4
+ <%= render_icon @attachment.icon_css_class, style: 'regular', size: 'lg' %>
5
5
  </label>
6
6
  <p><%= @attachment.file_name %></p>
7
7
  </div>
@@ -9,33 +9,32 @@
9
9
  <label><%= Alchemy::Attachment.human_attribute_name(:url) %></label>
10
10
  <p><%= @attachment.url %></p>
11
11
  <a data-clipboard-text="<%= @attachment.url %>" class="icon_button--right">
12
- <%= render_icon('clipboard full') %>
12
+ <%= render_icon(:clipboard, style: 'regular') %>
13
13
  </a>
14
14
  </div>
15
15
  <div class="value with-icon">
16
16
  <label><%= Alchemy::Attachment.human_attribute_name(:download_url) %></label>
17
17
  <p><%= @attachment.url %></p>
18
18
  <a data-clipboard-text="<%= @attachment.url %>" class="icon_button--right">
19
- <%= render_icon('clipboard full') %>
19
+ <%= render_icon(:clipboard, style: 'regular') %>
20
20
  </a>
21
21
  </div>
22
22
  </div>
23
23
 
24
24
  <% case @attachment.icon_css_class %>
25
- <% when "image" %>
25
+ <% when "file-image" %>
26
26
  <div class="attachment_preview_container image-preview">
27
27
  <%= image_tag(@attachment.url, class: "full_width") %>
28
28
  </div>
29
- <% when "audio" %>
29
+ <% when "file-audio" %>
30
30
  <div class="attachment_preview_container player-preview">
31
31
  <%= audio_tag(@attachment.url, preload: "none", controls: true, class: "full_width") %>
32
32
  </div>
33
- <% when "video" %>
33
+ <% when "file-video" %>
34
34
  <div class="attachment_preview_container player-preview">
35
35
  <%= video_tag(@attachment.url, preload: "metadata", controls: true, class: "full_width") %>
36
36
  </div>
37
- <% when "archive", "file" %>
38
- <% else %>
37
+ <% when "file-pdf" %>
39
38
  <iframe src="<%= @attachment.url %>" frameborder=0 class="full-iframe">
40
39
  Your browser does not support frames.
41
40
  </iframe>
@@ -5,15 +5,15 @@
5
5
  <% if picture.deletable? && can?(:destroy, picture) %>
6
6
  <span class="picture_tool delete">
7
7
  <%= link_to_confirm_dialog(
8
- "",
8
+ render_icon(:minus),
9
9
  Alchemy.t(:confirm_to_delete_image_from_server),
10
10
  alchemy.admin_picture_path(
11
11
  id: picture,
12
- q: params[:q],
12
+ q: search_filter_params[:q],
13
13
  page: params[:page],
14
- tagged_with: params[:tagged_with],
14
+ tagged_with: search_filter_params[:tagged_with],
15
15
  size: params[:size],
16
- filter: params[:filter]
16
+ filter: search_filter_params[:filter]
17
17
  ),
18
18
  {
19
19
  title: Alchemy.t('Delete image')
@@ -31,11 +31,11 @@
31
31
  image,
32
32
  alchemy.admin_picture_path(
33
33
  id: picture,
34
- q: params[:q],
34
+ q: search_filter_params[:q],
35
35
  page: params[:page],
36
- tagged_with: params[:tagged_with],
36
+ tagged_with: search_filter_params[:tagged_with],
37
37
  size: params[:size],
38
- filter: params[:filter]
38
+ filter: search_filter_params[:filter]
39
39
  ),
40
40
  class: 'thumbnail_background'
41
41
  ) %>
@@ -1,14 +1,16 @@
1
1
  <div class="picture_thumbnail assign_image_list_detail <%= size.blank? ? 'medium' : size %>" name="<%= picture_to_assign.name %>" id="picture_to_assign_<%= picture_to_assign.id %>">
2
- <% action_url = create_or_assign_url(picture_to_assign, @options.to_json) %>
3
2
  <%= link_to(
4
3
  image_tag(
5
4
  picture_to_assign.url(size: preview_size(size), flatten: true) || "alchemy/missing-image.svg",
6
5
  alt: picture_to_assign.name
7
6
  ),
8
- action_url,
7
+ alchemy.assign_admin_essence_pictures_path(
8
+ picture_id: picture_to_assign.id,
9
+ content_id: @content
10
+ ),
9
11
  remote: true,
10
12
  onclick: '$(self).attr("href", "#").off("click"); return false',
11
- method: @content.blank? ? 'post' : 'put',
13
+ method: 'put',
12
14
  title: Alchemy.t(:assign_image),
13
15
  class: 'thumbnail_background'
14
16
  ) %>
@@ -6,29 +6,29 @@
6
6
  <% if @previous %>
7
7
  <%= link_to alchemy.admin_picture_path(
8
8
  id: @previous,
9
- q: params[:q],
9
+ q: search_filter_params[:q],
10
10
  page: params[:page],
11
- tagged_with: params[:tagged_with],
11
+ tagged_with: search_filter_params[:tagged_with],
12
12
  size: params[:size],
13
- filter: params[:filter]
13
+ filter: search_filter_params[:filter]
14
14
  ),
15
15
  class: "previous-picture",
16
16
  remote: true do %>
17
- <span class="icon-angle-left"></span>
17
+ <i class="icon fas fa-angle-left fa-fw"></i>
18
18
  <% end %>
19
19
  <% end %>
20
20
  <% if @next %>
21
21
  <%= link_to alchemy.admin_picture_path(
22
22
  id: @next,
23
- q: params[:q],
23
+ q: search_filter_params[:q],
24
24
  page: params[:page],
25
- tagged_with: params[:tagged_with],
25
+ tagged_with: search_filter_params[:tagged_with],
26
26
  size: params[:size],
27
- filter: params[:filter]
27
+ filter: search_filter_params[:filter]
28
28
  ),
29
29
  class: "next-picture",
30
30
  remote: true do %>
31
- <span class="icon-angle-right"></span>
31
+ <i class="icon fas fa-angle-right fa-fw"></i>
32
32
  <% end %>
33
33
  <% end %>
34
34
  </div>
@@ -39,5 +39,5 @@
39
39
  </div>
40
40
 
41
41
  <div class="picture-overlay-handle">
42
- <span class="icon-angle-double-right"></span>
42
+ <i class="icon fas fa-angle-double-right fa-fw"></i>
43
43
  </div>
@@ -1,3 +1,4 @@
1
+ <% content = local_assigns[:content] || local_assigns[:essence_file_view] %>
1
2
  <%- if attachment = content.ingredient -%>
2
3
  <%- html_options = local_assigns.fetch(:html_options, {}) -%>
3
4
  <%= link_to(
@@ -1,13 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class CreateAlchemyPictureThumbs < ActiveRecord::Migration
3
+ class CreateAlchemyPictureThumbs < ActiveRecord::Migration[5.0]
4
4
  def change
5
5
  create_table :alchemy_picture_thumbs do |t|
6
- t.integer :picture_id, null: false, index: true
6
+ t.references :picture, null: false, foreign_key: { to_table: :alchemy_pictures }
7
7
  t.string :signature, null: false
8
8
  t.text :uid, null: false
9
9
  end
10
- add_foreign_key :alchemy_picture_thumbs, :alchemy_pictures, column: :picture_id
11
10
  add_index :alchemy_picture_thumbs, :signature, unique: true
12
11
  end
13
12
  end
@@ -3,7 +3,7 @@
3
3
  module Alchemy
4
4
  module Dragonfly
5
5
  module S3
6
- VERSION = "3.6.5"
6
+ VERSION = "5.0.5"
7
7
  end
8
8
  end
9
9
  end
@@ -6,11 +6,11 @@ module Alchemy
6
6
  super || "missing-image.png"
7
7
  end
8
8
 
9
- def thumbnail_url(options = {})
9
+ def thumbnail_url
10
10
  super || "alchemy/missing-image.svg"
11
11
  end
12
12
 
13
- def allow_image_cropping?(options = {})
13
+ def allow_image_cropping?
14
14
  super && !!picture.image_file
15
15
  end
16
16
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alchemy-dragonfly-s3
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.6.5
4
+ version: 5.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas von Deyen
@@ -14,16 +14,22 @@ dependencies:
14
14
  name: alchemy_cms
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 5.0.0.beta1
20
+ - - "<"
18
21
  - !ruby/object:Gem::Version
19
- version: '3.6'
22
+ version: '5.1'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: 5.0.0.beta1
30
+ - - "<"
25
31
  - !ruby/object:Gem::Version
26
- version: '3.6'
32
+ version: '5.1'
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: dragonfly-s3_data_store
29
35
  requirement: !ruby/object:Gem::Requirement
@@ -67,19 +73,19 @@ dependencies:
67
73
  - !ruby/object:Gem::Version
68
74
  version: '4.0'
69
75
  - !ruby/object:Gem::Dependency
70
- name: factory_girl_rails
76
+ name: factory_bot_rails
71
77
  requirement: !ruby/object:Gem::Requirement
72
78
  requirements:
73
79
  - - "~>"
74
80
  - !ruby/object:Gem::Version
75
- version: '4.5'
81
+ version: '5'
76
82
  type: :development
77
83
  prerelease: false
78
84
  version_requirements: !ruby/object:Gem::Requirement
79
85
  requirements:
80
86
  - - "~>"
81
87
  - !ruby/object:Gem::Version
82
- version: '4.5'
88
+ version: '5'
83
89
  - !ruby/object:Gem::Dependency
84
90
  name: simplecov
85
91
  requirement: !ruby/object:Gem::Requirement
@@ -158,7 +164,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
158
164
  - !ruby/object:Gem::Version
159
165
  version: '0'
160
166
  requirements: []
161
- rubygems_version: 3.1.4
167
+ rubygems_version: 3.0.3
162
168
  signing_key:
163
169
  specification_version: 4
164
170
  summary: AlchemyCMS Dragonfly S3.