decidim-decidim_awesome 0.10.0 → 0.10.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of decidim-decidim_awesome might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/app/controllers/concerns/decidim/decidim_awesome/proposals/orderable_override.rb +13 -6
- data/app/overrides/layouts/decidim/_head/add_awesome_legacy_scripts.rb +3 -0
- data/app/overrides/layouts/decidim/_head/add_awesome_tags.html.erb.deface +3 -0
- data/app/views/decidim/decidim_awesome/admin/checks/index.html.erb +2 -2
- data/config/locales/cs.yml +10 -0
- data/config/locales/fr.yml +7 -1
- data/lib/decidim/decidim_awesome/awesome.rb +9 -0
- data/lib/decidim/decidim_awesome/version.rb +1 -1
- metadata +2 -3
- data/app/overrides/layouts/decidim/_application/add_intergram.html.erb.deface +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 57d57565e1a7e62042eeb2bdd7a80d4679e68cac296cc1162a4bf86333ea2059
|
4
|
+
data.tar.gz: db65b2c7349f9970c1c07bd8dc67a0c0a35c6f2dd126f65848e4f49033a72bf8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 20a186cf440f3cba697dca7ae3878ebf60843696d22c609527873768666c83790915881b0bb887fa39b2c06b46f388edd909cd9a6b319d82fde3ac8c7cbacb24
|
7
|
+
data.tar.gz: e67a6fb46eb983d3f9f2204017407316f6afe38786a52950e73b40f23fad5c062e75b5bbb4329fadecbf0bc57d87567d454cfa3c977ee363b704689af598eb85
|
data/CHANGELOG.md
CHANGED
@@ -35,13 +35,13 @@ module Decidim
|
|
35
35
|
def reorder(proposals)
|
36
36
|
case order
|
37
37
|
when "az"
|
38
|
-
proposals.order(Arel.sql("decidim_proposals_proposals.title->>'#{locale}'
|
39
|
-
decidim_proposals_proposals.title->'machine_translations'->>'#{locale}'
|
40
|
-
decidim_proposals_proposals.title->>'#{default_locale}' ASC"))
|
38
|
+
proposals.order(Arel.sql("CONCAT(decidim_proposals_proposals.title->>'#{locale}',
|
39
|
+
decidim_proposals_proposals.title->'machine_translations'->>'#{locale}',
|
40
|
+
decidim_proposals_proposals.title->>'#{default_locale}') #{collation} ASC"))
|
41
41
|
when "za"
|
42
|
-
proposals.order(Arel.sql("decidim_proposals_proposals.title->>'#{locale}'
|
43
|
-
decidim_proposals_proposals.title->'machine_translations'->>'#{locale}'
|
44
|
-
decidim_proposals_proposals.title->>'#{default_locale}' DESC"))
|
42
|
+
proposals.order(Arel.sql("CONCAT(decidim_proposals_proposals.title->>'#{locale}',
|
43
|
+
decidim_proposals_proposals.title->'machine_translations'->>'#{locale}',
|
44
|
+
decidim_proposals_proposals.title->>'#{default_locale}') #{collation} DESC"))
|
45
45
|
when "supported_first"
|
46
46
|
proposals.joins(my_votes_join).group(:id).order(Arel.sql("COUNT(decidim_proposals_proposal_votes.id) DESC"))
|
47
47
|
when "supported_last"
|
@@ -64,6 +64,13 @@ module Decidim
|
|
64
64
|
end
|
65
65
|
# rubocop:enable Metrics/CyclomaticComplexity
|
66
66
|
|
67
|
+
def collation
|
68
|
+
@collation ||= begin
|
69
|
+
collation = Decidim::DecidimAwesome.collation_for(locale)
|
70
|
+
"COLLATE \"#{collation}\"" if collation.present?
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
67
74
|
def my_votes_join
|
68
75
|
votes_table = Decidim::Proposals::ProposalVote.arel_table
|
69
76
|
proposals_table = Decidim::Proposals::Proposal.arel_table
|
@@ -7,5 +7,8 @@ Deface::Override.new(virtual_path: "layouts/decidim/_head",
|
|
7
7
|
'
|
8
8
|
<%= javascript_pack_tag "decidim_decidim_awesome", defer: false %>
|
9
9
|
<%= javascript_pack_tag("decidim_decidim_awesome_custom_fields") if Decidim::DecidimAwesome.enabled?(:proposal_custom_fields) %>
|
10
|
+
<% if show_public_intergram? %>
|
11
|
+
<%= render partial: "layouts/decidim/decidim_awesome/intergram_widget", locals: { settings: organization_awesome_config[:intergram_for_public_settings] } %>
|
12
|
+
<% end %>
|
10
13
|
'
|
11
14
|
end
|
@@ -8,4 +8,7 @@
|
|
8
8
|
<% content_for :js_content do %>
|
9
9
|
<%= javascript_pack_tag "decidim_decidim_awesome", defer: false %>
|
10
10
|
<%= javascript_pack_tag("decidim_decidim_awesome_custom_fields") if Decidim::DecidimAwesome.enabled?(:proposal_custom_fields) %>
|
11
|
+
<% if show_public_intergram? %>
|
12
|
+
<%= render partial: "layouts/decidim/decidim_awesome/intergram_widget", locals: { settings: organization_awesome_config[:intergram_for_public_settings] } %>
|
13
|
+
<% end %>
|
11
14
|
<% end %>
|
@@ -43,7 +43,7 @@
|
|
43
43
|
<strong><%= t ".head_tags" %></strong>
|
44
44
|
<ul class="vertical menu">
|
45
45
|
<% {
|
46
|
-
CSS: "//link[@rel='stylesheet'][contains(@href,'decidim_decidim_awesome')]",
|
46
|
+
CSS: "//head/link[@rel='stylesheet'][contains(@href,'decidim_decidim_awesome')]",
|
47
47
|
JavaScript: "//script[contains(@src,'decidim_decidim_awesome')]"
|
48
48
|
}.each do |part, xpath| %>
|
49
49
|
<li>
|
@@ -63,7 +63,7 @@
|
|
63
63
|
<strong><%= t ".admin_head_tags" %></strong>
|
64
64
|
<ul class="vertical menu">
|
65
65
|
<% {
|
66
|
-
CSS: "//link[@rel='stylesheet'][contains(@href,'decidim_admin_decidim_awesome')]",
|
66
|
+
CSS: "//head/link[@rel='stylesheet'][contains(@href,'decidim_admin_decidim_awesome')]",
|
67
67
|
JavaScript: "//script[contains(@src,'decidim_admin_decidim_awesome')]"
|
68
68
|
}.each do |part, xpath| %>
|
69
69
|
<li>
|
data/config/locales/cs.yml
CHANGED
@@ -3,6 +3,7 @@ cs:
|
|
3
3
|
activemodel:
|
4
4
|
attributes:
|
5
5
|
config:
|
6
|
+
additional_proposal_sortings: Povoleny další možnosti řazení
|
6
7
|
allow_images_in_full_editor: Povolit obrázky v kompletním HTML editoru
|
7
8
|
allow_images_in_markdown_editor: Povolit obrázky v editoru markdown
|
8
9
|
allow_images_in_proposals: Povolit obrázky v editoru návrhů
|
@@ -111,10 +112,14 @@ cs:
|
|
111
112
|
global:
|
112
113
|
awesome_voting_manifest: Typ podpory
|
113
114
|
awesome_voting_manifest_options:
|
115
|
+
default: Jednoduché hlasování (výchozí)
|
114
116
|
voting_cards: Hlasování pomocí barevných karet
|
115
117
|
default_sort_order_options:
|
116
118
|
az: A-Z (abecední)
|
119
|
+
supported_first: Nejdříve podporováno
|
120
|
+
supported_last: Naposledy podporováno
|
117
121
|
za: Z-A (obrácená abeceda)
|
122
|
+
sort_orders_enabled: Typy řazeníí povoleny
|
118
123
|
voting_cards_box_title: Název hlasovacího pole
|
119
124
|
voting_cards_instructions_help: Výchozí hodnota je "Přečtěte si pečlivě pravidla voleb, abyste pochopili, jak bude vaše hlasování použito %{organization}""
|
120
125
|
voting_cards_show_abstain: Přidat možnost zdržet se hlasování
|
@@ -208,6 +213,8 @@ cs:
|
|
208
213
|
error: Chyba při odstraňování CSS boxu! %{error}
|
209
214
|
success: CSS box %{key} byl úspěšně odstraněn
|
210
215
|
form:
|
216
|
+
additional_proposal_sortings:
|
217
|
+
enable_all: Povolit všechny další možnosti řazení
|
211
218
|
edit_label: Přejmenovat štítek
|
212
219
|
errors:
|
213
220
|
incorrect_css: 'CSS v poli #%{key} je neplatné'
|
@@ -422,8 +429,11 @@ cs:
|
|
422
429
|
voting_cards:
|
423
430
|
abstained: "✔️ Zdržel se hlasování"
|
424
431
|
change_vote: Změnit můj hlas
|
432
|
+
default_box_title: Hlasovat o tomto návrhu
|
425
433
|
modal:
|
426
434
|
cancel: Zrušit
|
435
|
+
vote_button: Kliknutím hlasujte
|
436
|
+
voted: Odhlasováno
|
427
437
|
weights:
|
428
438
|
weight_0_short: 'A:'
|
429
439
|
weight_1: Červená
|
data/config/locales/fr.yml
CHANGED
@@ -3,6 +3,7 @@ fr:
|
|
3
3
|
activemodel:
|
4
4
|
attributes:
|
5
5
|
config:
|
6
|
+
additional_proposal_sortings: Activer les options de tri supplémentaires
|
6
7
|
allow_images_in_full_editor: Autoriser les images dans l'éditeur HTML complet
|
7
8
|
allow_images_in_markdown_editor: Autoriser les images dans l'éditeur de markdown
|
8
9
|
allow_images_in_proposals: Autoriser les images dans l'éditeur de propositions
|
@@ -22,7 +23,7 @@ fr:
|
|
22
23
|
scoped_admins: Groupe d'administrateurs restreints %{id}
|
23
24
|
scoped_styles: Style personnalisés %{id}
|
24
25
|
use_markdown_editor: Utiliser un éditeur Markdown au lieu de l'éditeur HTML
|
25
|
-
validate_body_max_caps_percent: Pourcentage maximum autorisé de lettres majuscules pour
|
26
|
+
validate_body_max_caps_percent: Pourcentage maximum autorisé de lettres majuscules pour la description
|
26
27
|
validate_body_max_marks_together: Nombre maximum de caractères spéciaux autorisés dans le corps
|
27
28
|
validate_body_min_length: Nombre de caractères minimum pour le corps
|
28
29
|
validate_body_start_with_caps: Forcer le corps à commencer par une lettre majuscule
|
@@ -119,6 +120,7 @@ fr:
|
|
119
120
|
supported_first: Déjà supporté en priorité
|
120
121
|
supported_last: A supporter en priorité
|
121
122
|
za: Z-A (alphabétique inverse)
|
123
|
+
sort_orders_enabled: Types de tri activés
|
122
124
|
voting_cards_box_title: Titre pour le boîtier de vote
|
123
125
|
voting_cards_box_title_help: La valeur par défaut est "Vote sur cette proposition". Utilisez "-" pour la masquer.
|
124
126
|
voting_cards_instructions: Instructions de soutien/aide pour le vote (fenêtre modale révocable)
|
@@ -216,6 +218,10 @@ fr:
|
|
216
218
|
error: Erreur lors de la suppression de la boîte CSS! %{error}
|
217
219
|
success: Boîte CSS %{key} supprimée avec succès
|
218
220
|
form:
|
221
|
+
additional_proposal_sortings:
|
222
|
+
enable_all: Activer toutes les options de tri supplémentaires
|
223
|
+
help: Ces options de tri s'ajoutent aux options par défaut. N'oubliez pas que vous pouvez choisir l'ordre par défaut dans les paramètres de la fonctionnalité des propositions.
|
224
|
+
title: Personnaliser les options de tri pour la liste des propositions
|
219
225
|
edit_label: Renommer le label
|
220
226
|
errors:
|
221
227
|
incorrect_css: 'CSS dans la boîte #%{key} est invalide'
|
@@ -280,6 +280,15 @@ module Decidim
|
|
280
280
|
end
|
281
281
|
end
|
282
282
|
|
283
|
+
def self.collation_for(locale)
|
284
|
+
@collation_for ||= {}
|
285
|
+
@collation_for[locale] ||= begin
|
286
|
+
res = ActiveRecord::Base.connection.execute(Arel.sql("SELECT collname FROM pg_collation WHERE collname LIKE '#{locale}-x-icu' LIMIT 1")).first
|
287
|
+
res ||= ActiveRecord::Base.connection.execute(Arel.sql("SELECT collname FROM pg_collation WHERE collname LIKE '#{locale[0..1]}%' LIMIT 1")).first
|
288
|
+
res["collname"] if res
|
289
|
+
end
|
290
|
+
end
|
291
|
+
|
283
292
|
def self.enabled?(config_vars)
|
284
293
|
config_vars = [config_vars] unless config_vars.respond_to?(:any?)
|
285
294
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: decidim-decidim_awesome
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ivan Vergés
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-11-
|
11
|
+
date: 2023-11-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: decidim-admin
|
@@ -194,7 +194,6 @@ files:
|
|
194
194
|
- app/overrides/decidim/proposals/admin/proposals/_form/replace_editor.html.erb.deface
|
195
195
|
- app/overrides/decidim/proposals/proposals/_vote_button/replace_vote_button.html.erb.deface
|
196
196
|
- app/overrides/decidim/proposals/proposals/_votes_count/replace_counter.html.erb.deface
|
197
|
-
- app/overrides/layouts/decidim/_application/add_intergram.html.erb.deface
|
198
197
|
- app/overrides/layouts/decidim/_head/add_awesome_legacy_scripts.rb
|
199
198
|
- app/overrides/layouts/decidim/_head/add_awesome_tags.html.erb.deface
|
200
199
|
- app/overrides/layouts/decidim/admin/_application/add_intergram.html.erb.deface
|