decidim-gallery 0.0.1 → 0.0.3
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 +4 -4
- data/app/cells/decidim/gallery/main/gallery_structure.erb +29 -0
- data/app/cells/decidim/gallery/main/image.erb +2 -21
- data/app/cells/decidim/gallery/main/image_collection.erb +1 -1
- data/app/cells/decidim/gallery/main/video.erb +1 -20
- data/app/cells/decidim/gallery/main_cell.rb +1 -1
- data/app/packs/src/decidim/gallery/gallery.js +1 -1
- data/app/views/decidim/gallery/gallery/index.js.erb +30 -0
- data/config/locales/en.yml +3 -0
- data/config/locales/fr.yml +12 -9
- data/config/locales/ro.yml +5 -2
- data/lib/decidim/gallery/test/factories.rb +5 -3
- data/lib/decidim/gallery/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 47165db0debd2a2b436f6276367445245aa4876279ce35d5c81b908be8d6f6ce
|
4
|
+
data.tar.gz: fecfea411a887a033a9aac7e2e492834d86bef29dfd5fc503807f4da270826fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 975fd9d8a7d4f86ff36668cfed341808e2f3fc232556f2f79eaf0e540aa78ad85bf208f8efc23915c0d683f920697a173250681b496f0e94e54352e3cf5b8019
|
7
|
+
data.tar.gz: ba78279cf7da7c6c0411ec3670276b1ec8009d3d4842c079bab89bcd0f643fc1ad2291e9459b1db06a493f3bf19e1c95d89df85adee5edad390464a998665266
|
@@ -0,0 +1,29 @@
|
|
1
|
+
<% if gallery_component.settings.show_title? %>
|
2
|
+
<h3 class="section-heading gallery-heading"><%= title %> (<%= t(gallery_component.settings.gallery_type, scope: "decidim.gallery.main", count: items.total_count) %>)</h3>
|
3
|
+
<% end %>
|
4
|
+
|
5
|
+
<% if gallery_component.settings.show_announcement? %>
|
6
|
+
<div class="row">
|
7
|
+
<div class="column"><%= translated_attribute(gallery_component.settings.announcement) %></div>
|
8
|
+
</div>
|
9
|
+
<% end %>
|
10
|
+
|
11
|
+
<% if items.total_count.zero? %>
|
12
|
+
<div class="row">
|
13
|
+
<div class="column">
|
14
|
+
<%= cell("decidim/announcement", t("decidim.gallery.main.no_results"), callout_class: "warning") %>
|
15
|
+
</div>
|
16
|
+
</div>
|
17
|
+
<% else %>
|
18
|
+
<div class="row small-up <%= model.css %> medium-up-3 mb-l gallery <%= gallery_component.settings.gallery_type %>" id="gallery_<%=model.gallery_id %>">
|
19
|
+
<%= cell("decidim/gallery/main", model).collection %>
|
20
|
+
</div>
|
21
|
+
<% end %>
|
22
|
+
|
23
|
+
<% unless items.total_count.zero? || items.last_page? %>
|
24
|
+
<div class="row">
|
25
|
+
<div class="column">
|
26
|
+
<%= link_to t("decidim.gallery.main.load_more"), gallery_path(format: 'js', page: items.next_page), class: "button small hollow", id: "link_gallery_#{model.gallery_id}", remote: true %>
|
27
|
+
</div>
|
28
|
+
</div>
|
29
|
+
<% end %>
|
@@ -1,25 +1,6 @@
|
|
1
|
-
|
2
|
-
<h3 class="section-heading gallery-heading"><%= title %> (<%= t( ".#{gallery_component.settings.gallery_type}", count: items.total_count) %>)</h3>
|
3
|
-
<% end %>
|
1
|
+
<%= render :gallery_structure %>
|
4
2
|
|
5
|
-
<%
|
6
|
-
<div class="row">
|
7
|
-
<div class="column"><%= translated_attribute(gallery_component.settings.announcement) %></div>
|
8
|
-
</div>
|
9
|
-
<% end %>
|
10
|
-
|
11
|
-
<div class="row small-up <%= model.css %> medium-up-3 mb-l gallery image" id="gallery_<%= model.section %>_<%=model.gallery_id %>">
|
12
|
-
<%= cell("decidim/gallery/main", model).collection %>
|
13
|
-
</div>
|
14
|
-
<% unless items.total_count.zero? || items.last_page? %>
|
15
|
-
<div class="row">
|
16
|
-
<div class="column">
|
17
|
-
<%= link_to t("decidim.gallery.main.load_more"), gallery_path(format: 'js', page: items.next_page,section: model.section, cb: model.id), class: "button small hollow", id: "link_gallery_#{model.section}_#{model.id}" , remote: true %>
|
18
|
-
</div>
|
19
|
-
</div>
|
20
|
-
<% end %>
|
21
|
-
|
22
|
-
<div class="small gallery-pop-up reveal" id="galleryModal_<%= model.section %>_<%=model.id %>" <% unless browser.mobile? %> data-reveal<% end %> >
|
3
|
+
<div class="small gallery-pop-up reveal" id="galleryModal" <% unless browser.mobile? %> data-reveal<% end %> >
|
23
4
|
<button class="close-button" data-close aria-label="<%= t("decidim.gallery.main.close_modal") %>"
|
24
5
|
type="button">
|
25
6
|
<span aria-hidden="true">×</span>
|
@@ -4,7 +4,7 @@
|
|
4
4
|
<% if browser.mobile? %>
|
5
5
|
<%= image_tag item.attached_uploader(:photo).path(variant: :big), alt: translated_attribute(item.title), class: "speaker-image" %>
|
6
6
|
<% else %>
|
7
|
-
<a href="#" title="<%= translated_attribute(item.title) %>" data-open="
|
7
|
+
<a href="#" title="<%= translated_attribute(item.title) %>" data-open="galleryModal" data-id="link<%= item.id %>">
|
8
8
|
<%= image_tag item.attached_uploader(:photo).path(variant: :big), alt: translated_attribute(item.title), class: "speaker-image" %>
|
9
9
|
</a>
|
10
10
|
<% end %>
|
@@ -1,20 +1 @@
|
|
1
|
-
|
2
|
-
<h3 class="section-heading gallery-heading"><%= title %> (<%= t( ".#{gallery_component.settings.gallery_type}", count: items.total_count) %>)</h3>
|
3
|
-
<% end %>
|
4
|
-
|
5
|
-
<% if gallery_component.settings.show_announcement? %>
|
6
|
-
<div class="row">
|
7
|
-
<div class="column"><%= translated_attribute(gallery_component.settings.announcement) %></div>
|
8
|
-
</div>
|
9
|
-
<% end %>
|
10
|
-
|
11
|
-
<div class="row small-up <%= model.css %> mb-l medium-up-3 gallery video" id="gallery_<%= model.section %>_<%=model.id %>">
|
12
|
-
<%= cell("decidim/gallery/main", model).collection %>
|
13
|
-
</div>
|
14
|
-
<% unless items.total_count.zero? || items.last_page? %>
|
15
|
-
<div class="row">
|
16
|
-
<div class="column">
|
17
|
-
<%= link_to t("decidim.gallery.main.load_more"), gallery_path(format: 'js', page: items.next_page, section: model.section, cb: model.id), class: "button small hollow", id: "link_gallery_#{model.section}_#{model.id}", remote: true %>
|
18
|
-
</div>
|
19
|
-
</div>
|
20
|
-
<% end %>
|
1
|
+
<%= render :gallery_structure %>
|
@@ -24,7 +24,7 @@ module Decidim
|
|
24
24
|
@items ||= Decidim::Gallery::GalleryItem
|
25
25
|
.published
|
26
26
|
.where(decidim_component_id: gallery_component.id)
|
27
|
-
.order(weight: :
|
27
|
+
.order(weight: :asc, published_at: :asc)
|
28
28
|
.page(options[:page])
|
29
29
|
.per(per_page)
|
30
30
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import Masonry from "./masonry/masonry";
|
2
2
|
|
3
|
-
function
|
3
|
+
window.addGalleryHandlers = function () {
|
4
4
|
$(".gallery-item > a").on("click", function(event){
|
5
5
|
event.preventDefault();
|
6
6
|
$(".gallery-item > a.gallery-item-active").removeClass("gallery-item-active");
|
@@ -0,0 +1,30 @@
|
|
1
|
+
<% cell_block = cell("decidim/gallery/main", OpenStruct.new(gallery_id: current_component.id), context: { view_context: self }, page: params[:page] || 1) %>
|
2
|
+
|
3
|
+
var $gallery = $("#gallery_<%= current_component.id %>");
|
4
|
+
|
5
|
+
var content = $( '<%= j(cell_block.collection).strip.html_safe %>' );
|
6
|
+
$gallery.append( content ).masonry( 'appended', content).masonry();
|
7
|
+
|
8
|
+
var list_content = $( '<%= j(cell_block.list_items).strip.html_safe %>' );
|
9
|
+
|
10
|
+
var $list = $(".orbit-container");
|
11
|
+
$list.append(list_content);
|
12
|
+
|
13
|
+
Foundation.reInit($('#galleryModal > .orbit'));
|
14
|
+
|
15
|
+
content
|
16
|
+
.find("img")
|
17
|
+
.one("load", function() { $gallery.masonry(); })
|
18
|
+
.each(function() {
|
19
|
+
if(this.complete) { $(this).trigger('load'); }
|
20
|
+
});
|
21
|
+
|
22
|
+
var $linkGallery = $("#link_gallery_<%= current_component.id %>");
|
23
|
+
|
24
|
+
$linkGallery.attr("href","<%= root_path(format: 'js', page: cell_block.items.next_page) %>")
|
25
|
+
|
26
|
+
<% if cell_block.items.last_page? %>
|
27
|
+
$linkGallery.hide();
|
28
|
+
<% end %>
|
29
|
+
|
30
|
+
addGalleryHandlers();
|
data/config/locales/en.yml
CHANGED
@@ -62,13 +62,16 @@ en:
|
|
62
62
|
few: "%{count} Photos"
|
63
63
|
one: 1 Photo
|
64
64
|
other: "%{count} Photos"
|
65
|
+
zero: No photos
|
65
66
|
load_more: View more
|
66
67
|
next_slide: Next
|
68
|
+
no_results: There are no gallery items
|
67
69
|
previous_slide: Previous
|
68
70
|
video:
|
69
71
|
few: "%{count} Videos"
|
70
72
|
one: 1 Video
|
71
73
|
other: "%{count} Videos"
|
74
|
+
zero: No Videos
|
72
75
|
models:
|
73
76
|
gallery_item:
|
74
77
|
fields:
|
data/config/locales/fr.yml
CHANGED
@@ -17,7 +17,7 @@ fr:
|
|
17
17
|
'12': '12'
|
18
18
|
'15': '15'
|
19
19
|
'18': '18'
|
20
|
-
show_announcement:
|
20
|
+
show_announcement: Afficher l'annonce
|
21
21
|
show_title: Afficher le titre
|
22
22
|
gallery:
|
23
23
|
actions:
|
@@ -25,10 +25,10 @@ fr:
|
|
25
25
|
confirm_unpublish: Êtes-vous sûr de vouloir dépublier ?
|
26
26
|
destroy: Supprimer
|
27
27
|
edit: Modifier
|
28
|
-
new: Nouvel élément de
|
28
|
+
new: Nouvel élément de galerie
|
29
29
|
publish: Publier
|
30
30
|
title: Actions
|
31
|
-
unpublish:
|
31
|
+
unpublish: Dépublier
|
32
32
|
admin:
|
33
33
|
formatted_text: Galerie %{component_name} dans %{space_name}
|
34
34
|
gallery_item:
|
@@ -46,29 +46,32 @@ fr:
|
|
46
46
|
image:
|
47
47
|
title: Nouvelle image de galerie
|
48
48
|
video:
|
49
|
-
title: Nouvel vidéo de
|
49
|
+
title: Nouvel vidéo de galerie
|
50
50
|
publish:
|
51
51
|
invalid: Une erreur s'est produite lors de la publication de votre fichier
|
52
52
|
success: Publié avec succès
|
53
53
|
unpublish:
|
54
|
-
invalid: Une erreur s'est produite lors de la
|
55
|
-
success:
|
54
|
+
invalid: Une erreur s'est produite lors de la dépublication de votre fichier
|
55
|
+
success: Dépublié avec succès
|
56
56
|
update:
|
57
57
|
invalid: Une erreur est survenue lors de la mise à jour du fichier
|
58
58
|
success: Mis à jour avec succès
|
59
59
|
main:
|
60
60
|
close_modal: Fermer
|
61
61
|
image:
|
62
|
-
few: "%{count}
|
63
|
-
one: 1
|
64
|
-
other: "%{count}
|
62
|
+
few: "%{count} images"
|
63
|
+
one: 1 image
|
64
|
+
other: "%{count} images"
|
65
|
+
zero: 0 images
|
65
66
|
load_more: Afficher plus
|
66
67
|
next_slide: Suivant
|
68
|
+
no_results: Il n'y a pas d'images ou de vidéos dans cette galerie
|
67
69
|
previous_slide: Précédent
|
68
70
|
video:
|
69
71
|
few: "%{count} vidéos"
|
70
72
|
one: 1 vidéo
|
71
73
|
other: "%{count} vidéos"
|
74
|
+
zero: 0 vidéos
|
72
75
|
models:
|
73
76
|
gallery_item:
|
74
77
|
fields:
|
data/config/locales/ro.yml
CHANGED
@@ -7,7 +7,7 @@ ro:
|
|
7
7
|
settings:
|
8
8
|
global:
|
9
9
|
additional_css: CSS suplimentar
|
10
|
-
announcement:
|
10
|
+
announcement: Anunț
|
11
11
|
gallery_type: Tipul galeriei
|
12
12
|
gallery_type_choices:
|
13
13
|
image: Imagine
|
@@ -17,7 +17,7 @@ ro:
|
|
17
17
|
'12': '12'
|
18
18
|
'15': '15'
|
19
19
|
'18': '18'
|
20
|
-
show_announcement:
|
20
|
+
show_announcement: Afișează anunț
|
21
21
|
show_title: Arată titlul
|
22
22
|
gallery:
|
23
23
|
actions:
|
@@ -59,13 +59,16 @@ ro:
|
|
59
59
|
main:
|
60
60
|
close_modal: Închide
|
61
61
|
image:
|
62
|
+
zero: 0 imagini
|
62
63
|
few: "%{count} Imagini"
|
63
64
|
one: 1 imagine
|
64
65
|
other: "%{count} Imagini"
|
65
66
|
load_more: Vezi mai multe
|
66
67
|
next_slide: Următorul
|
68
|
+
no_results: Nu există înregistrări
|
67
69
|
previous_slide: Anteriorul
|
68
70
|
video:
|
71
|
+
zero: 0 videoclipuri
|
69
72
|
few: "%{count} videoclipuri"
|
70
73
|
one: 1 videoclip
|
71
74
|
other: "%{count} videoclipuri"
|
@@ -18,7 +18,8 @@ FactoryBot.define do
|
|
18
18
|
trait :video do
|
19
19
|
settings do
|
20
20
|
{
|
21
|
-
gallery_type: :video
|
21
|
+
gallery_type: :video,
|
22
|
+
items_per_page: 12
|
22
23
|
}
|
23
24
|
end
|
24
25
|
end
|
@@ -26,14 +27,15 @@ FactoryBot.define do
|
|
26
27
|
trait :image do
|
27
28
|
settings do
|
28
29
|
{
|
29
|
-
gallery_type: :image
|
30
|
+
gallery_type: :image,
|
31
|
+
items_per_page: 12
|
30
32
|
}
|
31
33
|
end
|
32
34
|
end
|
33
35
|
|
34
36
|
trait :with_items do
|
35
37
|
after(:create) do |gallery, _evaluator|
|
36
|
-
create_list("#{gallery.settings.gallery_type}_gallery_item".to_sym,
|
38
|
+
create_list("#{gallery.settings.gallery_type}_gallery_item".to_sym, 16, :published, component: gallery)
|
37
39
|
end
|
38
40
|
end
|
39
41
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: decidim-gallery
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexandru-Emil Lupu
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-07-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: decidim-admin
|
@@ -76,6 +76,7 @@ files:
|
|
76
76
|
- LICENSE-AGPLv3.txt
|
77
77
|
- README.md
|
78
78
|
- Rakefile
|
79
|
+
- app/cells/decidim/gallery/main/gallery_structure.erb
|
79
80
|
- app/cells/decidim/gallery/main/image.erb
|
80
81
|
- app/cells/decidim/gallery/main/image_collection.erb
|
81
82
|
- app/cells/decidim/gallery/main/image_list.erb
|
@@ -121,6 +122,7 @@ files:
|
|
121
122
|
- app/views/decidim/gallery/admin/gallery_item/index.html.erb
|
122
123
|
- app/views/decidim/gallery/admin/gallery_item/new.html.erb
|
123
124
|
- app/views/decidim/gallery/gallery/index.html.erb
|
125
|
+
- app/views/decidim/gallery/gallery/index.js.erb
|
124
126
|
- config/assets.rb
|
125
127
|
- config/i18n-tasks.yml
|
126
128
|
- config/locales/en.yml
|