cmor_showcase_frontend 0.0.36.pre → 0.0.37.pre

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 384658e25aaea8fb3e38581f0c3a045d937036cfc6e37923871e546195a3e196
4
- data.tar.gz: d0934e09ac04dfba3d09f648e9d205fa61688ce58080ea6017d46a9cf7a7f259
3
+ metadata.gz: ecb1cc128f308bc264a64bd0cf821c1fed36482c5febe697f94cc47fc64d1944
4
+ data.tar.gz: 11bf123e653194f0228ed948379882e4365428959c65c5ab44174628c428f009
5
5
  SHA512:
6
- metadata.gz: 819a9a6814dad9e5617aa3eba01081e911f5cbb5a04235b3a49b9f4e7a05347df5195ce292e498f633584048fc0a1e69679d5f532ffee477d94516b1d27424cc
7
- data.tar.gz: b65d8e200a8e2d8e2041a5ff6eff94bb57ce45b900d76b8016ecb7edf7884d95db7f21cc85a7891c47831e5d8c12405e933f197e11ce76ed59c41ff66c1186ca
6
+ metadata.gz: edac11a69a2f43f25d8033dbcceea028c098b11811798bb6f9158d08f4694e013eda8808e7c982e8763f062ae81f1ea9790be4345635eaed087e938347fe1fa4
7
+ data.tar.gz: afe671cddb5ca8c2839e190c3409ca33a01ebfccc97ec737cfed08d164d157fc0ecf3c983ed6d4ba985ec12b9d4031483a9df2a7945abb622af8b1da388d27f7
@@ -4,6 +4,7 @@ module Cmor::Showcase::Frontend
4
4
  include Rao::ResourcesController::ResourcesConcern
5
5
  include Rao::ResourcesController::RestResourceUrlsConcern
6
6
  include Rao::ResourcesController::ResourceInflectionsConcern
7
+ include Rao::ResourcesController::FriendlyIdConcern
7
8
 
8
9
  view_helper Markup::Rails::ApplicationViewHelper, as: :markup_helper
9
10
 
@@ -4,9 +4,12 @@ module Cmor::Showcase::Frontend
4
4
  include Rao::ResourcesController::ResourcesConcern
5
5
  include Rao::ResourcesController::RestResourceUrlsConcern
6
6
  include Rao::ResourcesController::ResourceInflectionsConcern
7
+ include Rao::ResourcesController::FriendlyIdConcern
7
8
 
8
9
  view_helper Markup::Rails::ApplicationViewHelper, as: :markup_helper
9
10
 
11
+ helper Rao::Component::ApplicationHelper
12
+
10
13
  def self.resource_class
11
14
  Cmor::Showcase::Item
12
15
  end
@@ -1,4 +1,4 @@
1
- .row{ class: dom_class(category), id: dom_id(category) }
1
+ .row{ class: "cmor-showcase-category cmor-showcase-category-#{dom_class(category)", id: dom_id(category) }
2
2
  - category.items.each do |item|
3
3
  .col-lg-3.col-md-4.col-sm-6{ class: dom_class(item) }
4
4
  .card.h-100
@@ -1,7 +1,8 @@
1
1
  .col-12.col-lg-3.mb-4
2
2
  .card.h-100
3
3
  = link_to([cmor_showcase_frontend, item]) do
4
- %img.card-img-top{ src: main_app.url_for(item.preview_picture.variant(Cmor::Showcase::Frontend::Configuration.default_render_items_variant_options)) }/
4
+ - if item.preview_picture.respond_to?(:variant)
5
+ %img.card-img-top{ src: main_app.url_for(item.preview_picture.variant(Cmor::Showcase::Frontend::Configuration.default_render_items_variant_options)) }/
5
6
  .card-body
6
7
  %h5.card-title= item.name
7
8
  %p.card-text= markup_helper(self).to_html(item, :body).html_safe
@@ -5,12 +5,42 @@
5
5
  .row
6
6
  - if @resource.preview_picture.present?
7
7
  .col-12
8
- %img.w-100.img-thumbnail.img-fluid{:alt => "", :src => main_app.url_for(@resource.preview_picture.variant(Cmor::Showcase::Frontend::Configuration.default_render_items_variant_options)) }/
8
+ %img.w-100.img-thumbnail.img-fluid{:alt => "", :src => main_app.url_for(@resource.preview_picture.asset.variant(Cmor::Showcase::Frontend::Configuration.default_render_items_variant_options)) }/
9
+
10
+ .col-12
11
+ %p= markup_helper(self).to_html(@resource, :body).html_safe
12
+
13
+ %div{ id: dom_id(@resource), class: dom_class(@resource) }
14
+ .row
15
+ - @resource.file_details.images.each do |file_detail|
16
+ .col-md-6.col-lg-3.d-flex.align-items-stretch.mb-4
17
+ .card.text-center.border-0
18
+ %a{ href: main_app.url_for(file_detail.asset), data: { gallery: dom_id(@resource) } }
19
+ %img.img-fluid{ src: main_app.url_for(file_detail.asset.variant(Cmor::Showcase::Frontend::Configuration.thumbnail_variant_options)) }
20
+ .card-body
21
+ %h5.card-title
22
+ = file_detail.title
23
+ %p.card-text
24
+ = file_detail.description
25
+
26
+ - if @resource.file_details.non_images.any?
27
+ .row
9
28
  .col-12
10
- %p= markup_helper(self).to_html(@resource, :body).html_safe
11
- - else
29
+ %h2= Cmor::Showcase::FileDetail.model_name.human(count: :other)
30
+
31
+ .row
12
32
  .col-12
13
- %p= markup_helper(self).to_html(@resource, :body).html_safe
33
+ = collection_table(collection: @resource.file_details.non_images, resource_class: Cmor::Showcase::FileDetail) do |table|
34
+ = table.column :title
35
+ = table.column :blob_filename do |resource|
36
+ - resource.asset.blob.filename
37
+ = table.column :blob_byte_size do |resource|
38
+ - number_to_human_size(resource.asset.blob.byte_size)
39
+ = table.timestamps format: :short
40
+ = table.column :actions do |resource|
41
+ - link_to(main_app.url_for(resource.asset), id: "#{dom_id(resource)}-download", class: 'btn btn-responsive btn-primary', title: t('.checksum', checksum: resource.asset.blob.checksum)) do
42
+ %i.fas.fa-download
43
+ %span.btn-text= t('.download')
14
44
 
15
45
  .row
16
46
  .col-12
@@ -6,5 +6,6 @@ module Cmor::Showcase::Frontend
6
6
 
7
7
  mattr_accessor(:base_controller) { '::FrontendController' }
8
8
  mattr_accessor(:default_render_items_variant_options) { { combine_options: { resize: "768x432^", gravity: :center, extent: "768x432" } } }
9
+ mattr_accessor(:thumbnail_variant_options) { { combine_options: { resize: "384x216^", extent: "384x216", gravity: "center"} } }
9
10
  end
10
11
  end
@@ -10,4 +10,10 @@ Cmor::Showcase::Frontend.configure do |config|
10
10
  # Default: config.default_render_items_variant_options = { combine_options: { resize: "768x432^", gravity: :center, extent: "768x432" } }
11
11
  #
12
12
  config.default_render_items_variant_options = { combine_options: { resize: "768x432^", gravity: :center, extent: "768x432" } }
13
+
14
+ # This options will be applied when rendering thumbails in galleries.
15
+ #
16
+ # Default: config.thumbnail_variant_options = { combine_options: { resize: "384x216^", extent: "384x216", gravity: "center" } }
17
+ #
18
+ config.thumbnail_variant_options = { combine_options: { resize: "384x216^", extent: "384x216", gravity: "center" } }
13
19
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cmor_showcase_frontend
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.36.pre
4
+ version: 0.0.37.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roberto Vasquez Angel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-10 00:00:00.000000000 Z
11
+ date: 2019-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -30,28 +30,28 @@ dependencies:
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 0.0.36.pre
33
+ version: 0.0.37.pre
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 0.0.36.pre
40
+ version: 0.0.37.pre
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: cmor_core_frontend
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: 0.0.36.pre
47
+ version: 0.0.37.pre
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: 0.0.36.pre
54
+ version: 0.0.37.pre
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: sqlite3
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -375,7 +375,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
375
375
  - !ruby/object:Gem::Version
376
376
  version: 1.3.1
377
377
  requirements: []
378
- rubygems_version: 3.0.4
378
+ rubygems_version: 3.0.6
379
379
  signing_key:
380
380
  specification_version: 4
381
381
  summary: Cmor::Showcase::Frontend Module.