From a6f5f037571ed4e42375b10813c9f084ea7461e0 Mon Sep 17 00:00:00 2001 From: Anna Topalidi Date: Thu, 2 Nov 2023 09:58:59 +0100 Subject: [PATCH] add census type radio buttons --- Gemfile | 2 +- Gemfile.lock | 468 +++++++++--------- .../admin/decidim_vocdoni_admin.js | 1 + app/packs/src/decidim/vocdoni/admin/census.js | 26 + .../vocdoni/admin/election_calendar.js | 10 +- .../vocdoni/admin/census/index.html.erb | 24 +- config/locales/en.yml | 6 +- lib/decidim/vocdoni/version.rb | 2 +- package-lock.json | 46 +- package.json | 8 +- 10 files changed, 323 insertions(+), 270 deletions(-) create mode 100644 app/packs/src/decidim/vocdoni/admin/census.js diff --git a/Gemfile b/Gemfile index cd02eedd..49c4bc5c 100644 --- a/Gemfile +++ b/Gemfile @@ -4,7 +4,7 @@ source "https://rubygems.org" ruby RUBY_VERSION -DECIDIM_VERSION = "0.27.1" +DECIDIM_VERSION = "0.27.4" gem "decidim", DECIDIM_VERSION gem "decidim-vocdoni", path: "." diff --git a/Gemfile.lock b/Gemfile.lock index e916f215..400a94bd 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,46 +1,46 @@ PATH remote: . specs: - decidim-vocdoni (0.27.1) - decidim-core (= 0.27.1) + decidim-vocdoni (0.27.4) + decidim-core (= 0.27.4) GEM remote: https://rubygems.org/ specs: - actioncable (6.1.7) - actionpack (= 6.1.7) - activesupport (= 6.1.7) + actioncable (6.1.7.6) + actionpack (= 6.1.7.6) + activesupport (= 6.1.7.6) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (6.1.7) - actionpack (= 6.1.7) - activejob (= 6.1.7) - activerecord (= 6.1.7) - activestorage (= 6.1.7) - activesupport (= 6.1.7) + actionmailbox (6.1.7.6) + actionpack (= 6.1.7.6) + activejob (= 6.1.7.6) + activerecord (= 6.1.7.6) + activestorage (= 6.1.7.6) + activesupport (= 6.1.7.6) mail (>= 2.7.1) - actionmailer (6.1.7) - actionpack (= 6.1.7) - actionview (= 6.1.7) - activejob (= 6.1.7) - activesupport (= 6.1.7) + actionmailer (6.1.7.6) + actionpack (= 6.1.7.6) + actionview (= 6.1.7.6) + activejob (= 6.1.7.6) + activesupport (= 6.1.7.6) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (6.1.7) - actionview (= 6.1.7) - activesupport (= 6.1.7) + actionpack (6.1.7.6) + actionview (= 6.1.7.6) + activesupport (= 6.1.7.6) rack (~> 2.0, >= 2.0.9) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (6.1.7) - actionpack (= 6.1.7) - activerecord (= 6.1.7) - activestorage (= 6.1.7) - activesupport (= 6.1.7) + actiontext (6.1.7.6) + actionpack (= 6.1.7.6) + activerecord (= 6.1.7.6) + activestorage (= 6.1.7.6) + activesupport (= 6.1.7.6) nokogiri (>= 1.8.5) - actionview (6.1.7) - activesupport (= 6.1.7) + actionview (6.1.7.6) + activesupport (= 6.1.7.6) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) @@ -48,22 +48,22 @@ GEM active_link_to (1.0.5) actionpack addressable - activejob (6.1.7) - activesupport (= 6.1.7) + activejob (6.1.7.6) + activesupport (= 6.1.7.6) globalid (>= 0.3.6) - activemodel (6.1.7) - activesupport (= 6.1.7) - activerecord (6.1.7) - activemodel (= 6.1.7) - activesupport (= 6.1.7) - activestorage (6.1.7) - actionpack (= 6.1.7) - activejob (= 6.1.7) - activerecord (= 6.1.7) - activesupport (= 6.1.7) + activemodel (6.1.7.6) + activesupport (= 6.1.7.6) + activerecord (6.1.7.6) + activemodel (= 6.1.7.6) + activesupport (= 6.1.7.6) + activestorage (6.1.7.6) + actionpack (= 6.1.7.6) + activejob (= 6.1.7.6) + activerecord (= 6.1.7.6) + activesupport (= 6.1.7.6) marcel (~> 1.0) mini_mime (>= 1.1.0) - activesupport (6.1.7) + activesupport (6.1.7.6) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) @@ -71,10 +71,10 @@ GEM zeitwerk (~> 2.3) acts_as_list (0.9.19) activerecord (>= 3.0) - addressable (2.8.1) + addressable (2.8.5) public_suffix (>= 2.0.2, < 6.0) ast (2.4.2) - axe-core-api (4.5.1) + axe-core-api (4.8.0) dumb_delegator virtus axe-core-rspec (4.1.0) @@ -85,8 +85,9 @@ GEM descendants_tracker (~> 0.0.4) ice_nine (~> 0.11.0) thread_safe (~> 0.3, >= 0.3.1) + base64 (0.1.1) batch-loader (1.5.0) - bcrypt (3.1.18) + bcrypt (3.1.19) better_html (1.0.16) actionview (>= 4.0) activesupport (>= 4.0) @@ -96,12 +97,12 @@ GEM parser (>= 2.4) smart_properties bindex (0.8.1) - bootsnap (1.15.0) + bootsnap (1.17.0) msgpack (~> 1.2) browser (2.7.1) builder (3.2.4) byebug (11.1.3) - capybara (3.38.0) + capybara (3.39.2) addressable matrix mini_mime (>= 0.1.3) @@ -110,7 +111,7 @@ GEM rack-test (>= 0.6.3) regexp_parser (>= 1.5, < 3.0) xpath (~> 3.2) - carrierwave (2.2.3) + carrierwave (2.2.4) activemodel (>= 5.0.0) activesupport (>= 5.0.0) addressable (~> 2.6) @@ -130,7 +131,7 @@ GEM actionpack (>= 5.0) cells (>= 4.1.6, < 5.0.0) charlock_holmes (0.7.7) - chef-utils (18.0.185) + chef-utils (18.3.0) concurrent-ruby childprocess (4.1.0) codecov (0.6.0) @@ -144,66 +145,67 @@ GEM coffee-script-source execjs coffee-script-source (1.12.2) - commonmarker (0.23.6) - concurrent-ruby (1.1.10) + commonmarker (0.23.10) + concurrent-ruby (1.2.2) crack (0.4.5) rexml crass (1.0.6) - css_parser (1.12.0) + css_parser (1.16.0) addressable + date (3.3.3) date_validator (0.12.0) activemodel (>= 3) activesupport (>= 3) db-query-matchers (0.10.0) activesupport (>= 4.0, < 7) rspec (~> 3.0) - decidim (0.27.1) - decidim-accountability (= 0.27.1) - decidim-admin (= 0.27.1) - decidim-api (= 0.27.1) - decidim-assemblies (= 0.27.1) - decidim-blogs (= 0.27.1) - decidim-budgets (= 0.27.1) - decidim-comments (= 0.27.1) - decidim-core (= 0.27.1) - decidim-debates (= 0.27.1) - decidim-forms (= 0.27.1) - decidim-generators (= 0.27.1) - decidim-meetings (= 0.27.1) - decidim-pages (= 0.27.1) - decidim-participatory_processes (= 0.27.1) - decidim-proposals (= 0.27.1) - decidim-sortitions (= 0.27.1) - decidim-surveys (= 0.27.1) - decidim-system (= 0.27.1) - decidim-templates (= 0.27.1) - decidim-verifications (= 0.27.1) - decidim-accountability (0.27.1) - decidim-comments (= 0.27.1) - decidim-core (= 0.27.1) - decidim-admin (0.27.1) + decidim (0.27.4) + decidim-accountability (= 0.27.4) + decidim-admin (= 0.27.4) + decidim-api (= 0.27.4) + decidim-assemblies (= 0.27.4) + decidim-blogs (= 0.27.4) + decidim-budgets (= 0.27.4) + decidim-comments (= 0.27.4) + decidim-core (= 0.27.4) + decidim-debates (= 0.27.4) + decidim-forms (= 0.27.4) + decidim-generators (= 0.27.4) + decidim-meetings (= 0.27.4) + decidim-pages (= 0.27.4) + decidim-participatory_processes (= 0.27.4) + decidim-proposals (= 0.27.4) + decidim-sortitions (= 0.27.4) + decidim-surveys (= 0.27.4) + decidim-system (= 0.27.4) + decidim-templates (= 0.27.4) + decidim-verifications (= 0.27.4) + decidim-accountability (0.27.4) + decidim-comments (= 0.27.4) + decidim-core (= 0.27.4) + decidim-admin (0.27.4) active_link_to (~> 1.0) - decidim-core (= 0.27.1) + decidim-core (= 0.27.4) devise (~> 4.7) devise-i18n (~> 1.2) devise_invitable (~> 2.0) - decidim-api (0.27.1) + decidim-api (0.27.4) graphql (~> 1.12, < 1.13) graphql-docs (~> 2.1.0) rack-cors (~> 1.0) - decidim-assemblies (0.27.1) - decidim-core (= 0.27.1) - decidim-blogs (0.27.1) - decidim-admin (= 0.27.1) - decidim-comments (= 0.27.1) - decidim-core (= 0.27.1) - decidim-budgets (0.27.1) - decidim-comments (= 0.27.1) - decidim-core (= 0.27.1) - decidim-comments (0.27.1) - decidim-core (= 0.27.1) + decidim-assemblies (0.27.4) + decidim-core (= 0.27.4) + decidim-blogs (0.27.4) + decidim-admin (= 0.27.4) + decidim-comments (= 0.27.4) + decidim-core (= 0.27.4) + decidim-budgets (0.27.4) + decidim-comments (= 0.27.4) + decidim-core (= 0.27.4) + decidim-comments (0.27.4) + decidim-core (= 0.27.4) redcarpet (~> 3.5, >= 3.5.1) - decidim-core (0.27.1) + decidim-core (0.27.4) active_link_to (~> 1.0) acts_as_list (~> 0.9) batch-loader (~> 1.2) @@ -213,7 +215,7 @@ GEM cells-rails (~> 0.1.3) charlock_holmes (~> 0.7) date_validator (~> 0.12.0) - decidim-api (= 0.27.1) + decidim-api (= 0.27.4) devise (~> 4.7) devise-i18n (~> 1.2) diffy (~> 3.3) @@ -226,7 +228,7 @@ GEM hashdiff (>= 0.4.0, < 2.0.0) invisible_captcha (~> 0.12) kaminari (~> 1.2, >= 1.2.1) - loofah (~> 2.3.1) + loofah (~> 2.19.0) mime-types (>= 1.16, < 4.0) mini_magick (~> 4.9) mustache (~> 1.1.0) @@ -254,15 +256,15 @@ GEM webpacker (= 6.0.0.rc.5) webpush (~> 1.1) wisper (~> 2.0) - decidim-debates (0.27.1) - decidim-comments (= 0.27.1) - decidim-core (= 0.27.1) - decidim-dev (0.27.1) + decidim-debates (0.27.4) + decidim-comments (= 0.27.4) + decidim-core (= 0.27.4) + decidim-dev (0.27.4) axe-core-rspec (~> 4.1.0) byebug (~> 11.0) capybara (~> 3.24) db-query-matchers (~> 0.10.0) - decidim (= 0.27.1) + decidim (= 0.27.4) erb_lint (~> 0.0.35) factory_bot_rails (~> 4.8) i18n-tasks (~> 0.9.18) @@ -285,68 +287,68 @@ GEM w3c_rspec_validators (~> 0.3.0) webmock (~> 3.6) wisper-rspec (~> 1.0) - decidim-forms (0.27.1) - decidim-core (= 0.27.1) + decidim-forms (0.27.4) + decidim-core (= 0.27.4) wicked_pdf (~> 2.1) wkhtmltopdf-binary (~> 0.12) - decidim-generators (0.27.1) - decidim-core (= 0.27.1) - decidim-meetings (0.27.1) - decidim-core (= 0.27.1) - decidim-forms (= 0.27.1) + decidim-generators (0.27.4) + decidim-core (= 0.27.4) + decidim-meetings (0.27.4) + decidim-core (= 0.27.4) + decidim-forms (= 0.27.4) icalendar (~> 2.5) - decidim-pages (0.27.1) - decidim-core (= 0.27.1) - decidim-participatory_processes (0.27.1) - decidim-core (= 0.27.1) - decidim-proposals (0.27.1) - decidim-comments (= 0.27.1) - decidim-core (= 0.27.1) + decidim-pages (0.27.4) + decidim-core (= 0.27.4) + decidim-participatory_processes (0.27.4) + decidim-core (= 0.27.4) + decidim-proposals (0.27.4) + decidim-comments (= 0.27.4) + decidim-core (= 0.27.4) doc2text (~> 0.4.5) redcarpet (~> 3.5, >= 3.5.1) - decidim-sortitions (0.27.1) - decidim-admin (= 0.27.1) - decidim-comments (= 0.27.1) - decidim-core (= 0.27.1) - decidim-proposals (= 0.27.1) - decidim-surveys (0.27.1) - decidim-core (= 0.27.1) - decidim-forms (= 0.27.1) - decidim-templates (= 0.27.1) - decidim-system (0.27.1) + decidim-sortitions (0.27.4) + decidim-admin (= 0.27.4) + decidim-comments (= 0.27.4) + decidim-core (= 0.27.4) + decidim-proposals (= 0.27.4) + decidim-surveys (0.27.4) + decidim-core (= 0.27.4) + decidim-forms (= 0.27.4) + decidim-templates (= 0.27.4) + decidim-system (0.27.4) active_link_to (~> 1.0) - decidim-core (= 0.27.1) + decidim-core (= 0.27.4) devise (~> 4.7) devise-i18n (~> 1.2) devise_invitable (~> 2.0) - decidim-templates (0.27.1) - decidim-core (= 0.27.1) - decidim-forms (= 0.27.1) - decidim-verifications (0.27.1) - decidim-core (= 0.27.1) + decidim-templates (0.27.4) + decidim-core (= 0.27.4) + decidim-forms (= 0.27.4) + decidim-verifications (0.27.4) + decidim-core (= 0.27.4) declarative-builder (0.1.0) declarative-option (< 0.2.0) declarative-option (0.1.0) descendants_tracker (0.0.4) thread_safe (~> 0.3, >= 0.3.1) - devise (4.8.1) + devise (4.9.3) bcrypt (~> 3.0) orm_adapter (~> 0.1) railties (>= 4.1.0) responders warden (~> 1.2.3) - devise-i18n (1.10.2) - devise (>= 4.8.0) - devise_invitable (2.0.6) + devise-i18n (1.12.0) + devise (>= 4.9.0) + devise_invitable (2.0.9) actionmailer (>= 5.0) devise (>= 4.6) diff-lcs (1.5.0) diffy (3.4.2) - doc2text (0.4.5) - nokogiri (>= 1.13.2, < 1.14.0) + doc2text (0.4.6) + nokogiri (>= 1.13.2, < 1.15.0) rubyzip (~> 2.3.0) docile (1.4.0) - doorkeeper (5.6.2) + doorkeeper (5.6.6) railties (>= 5) doorkeeper-i18n (4.0.1) dumb_delegator (1.0.0) @@ -360,10 +362,10 @@ GEM smart_properties erbse (0.1.4) temple - erubi (1.11.0) + erubi (1.12.0) escape_utils (1.3.0) - excon (0.94.0) - execjs (2.8.1) + excon (0.104.0) + execjs (2.9.1) extended-markdown-filter (0.7.0) html-pipeline (~> 2.9) factory_bot (4.11.1) @@ -373,11 +375,12 @@ GEM railties (>= 3.0.0) faker (2.23.0) i18n (>= 1.8.11, < 2) - faraday (2.7.1) + faraday (2.7.11) + base64 faraday-net_http (>= 2.0, < 3.1) ruby2_keywords (>= 0.0.4) faraday-net_http (3.0.2) - ffi (1.15.5) + ffi (1.16.3) file_validators (3.0.0) activemodel (>= 3.2) mime-types (>= 1.0) @@ -395,9 +398,9 @@ GEM activesupport (>= 4.1, < 7.1) railties (>= 4.1, < 7.1) gemoji (3.0.1) - geocoder (1.8.1) - globalid (1.0.0) - activesupport (>= 5.0) + geocoder (1.8.2) + globalid (1.2.1) + activesupport (>= 6.1) graphql (1.12.24) graphql-docs (2.1.0) commonmarker (~> 0.16) @@ -409,14 +412,14 @@ GEM sass (~> 3.4) hashdiff (1.0.1) hashie (5.0.0) - highline (2.0.3) + highline (2.1.0) hkdf (0.3.0) html-pipeline (2.14.3) activesupport (>= 2) nokogiri (>= 1.4) html_tokenizer (0.0.7) htmlentities (4.3.4) - i18n (1.12.0) + i18n (1.14.1) concurrent-ruby (~> 1.0) i18n-tasks (0.9.37) activesupport (>= 4.0.2) @@ -428,7 +431,7 @@ GEM rails-i18n rainbow (>= 2.2.2, < 4.0) terminal-table (>= 1.5.1) - icalendar (2.8.0) + icalendar (2.9.0) ice_cube (~> 0.16) ice_cube (0.16.4) ice_nine (0.11.2) @@ -438,7 +441,7 @@ GEM invisible_captcha (0.13.0) rails (>= 3.2.0) json (2.6.3) - jwt (2.5.0) + jwt (2.7.1) kaminari (1.2.2) activesupport (>= 4.1.0) kaminari-actionview (= 1.2.2) @@ -455,8 +458,8 @@ GEM rexml kramdown-parser-gfm (1.1.0) kramdown (~> 2.0) - launchy (2.5.0) - addressable (~> 2.7) + launchy (2.5.2) + addressable (~> 2.8) letter_opener (1.8.1) launchy (>= 2.2, < 3) letter_opener_web (2.0.0) @@ -464,54 +467,51 @@ GEM letter_opener (~> 1.7) railties (>= 5.2) rexml - listen (3.7.1) + listen (3.8.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) - loofah (2.3.1) + loofah (2.19.1) crass (~> 1.0.2) nokogiri (>= 1.5.9) - mail (2.8.0) + mail (2.8.1) mini_mime (>= 0.1.1) net-imap net-pop net-smtp marcel (1.0.2) matrix (0.4.2) - mdl (0.12.0) + mdl (0.13.0) kramdown (~> 2.3) kramdown-parser-gfm (~> 1.1) mixlib-cli (~> 2.1, >= 2.1.1) mixlib-config (>= 2.2.1, < 4) mixlib-shellout method_source (1.0.0) - mime-types (3.4.1) + mime-types (3.5.1) mime-types-data (~> 3.2015) - mime-types-data (3.2022.0105) - mini_magick (4.11.0) - mini_mime (1.1.2) - minitest (5.16.3) + mime-types-data (3.2023.1003) + mini_magick (4.12.0) + mini_mime (1.1.5) + minitest (5.20.0) mixlib-cli (2.1.8) mixlib-config (3.0.27) tomlrb mixlib-shellout (3.2.7) chef-utils - msgpack (1.6.0) + msgpack (1.7.2) multi_xml (0.6.0) mustache (1.1.1) - net-imap (0.3.1) + net-imap (0.4.3) + date net-protocol net-pop (0.1.2) net-protocol - net-protocol (0.2.0) + net-protocol (0.2.1) timeout - net-smtp (0.3.3) + net-smtp (0.4.0) net-protocol - nio4r (2.5.8) - nokogiri (1.13.10-arm64-darwin) - racc (~> 1.4) - nokogiri (1.13.10-x86_64-darwin) - racc (~> 1.4) - nokogiri (1.13.10-x86_64-linux) + nio4r (2.5.9) + nokogiri (1.14.5-x86_64-darwin) racc (~> 1.4) oauth (1.1.0) oauth-tty (~> 1.0, >= 1.0.1) @@ -526,7 +526,7 @@ GEM rack (>= 1.2, < 4) snaky_hash (~> 2.0) version_gem (~> 1.1) - omniauth (2.1.0) + omniauth (2.1.1) hashie (>= 3.4.6) rack (>= 2.2.3) rack-protection @@ -553,16 +553,17 @@ GEM paper_trail (12.3.0) activerecord (>= 5.2) request_store (~> 1.1) - parallel (1.22.1) + parallel (1.23.0) parallel_tests (3.13.0) parallel - parser (3.1.3.0) + parser (3.2.2.4) ast (~> 2.4.1) + racc pg (1.1.4) pg_search (2.3.6) activerecord (>= 5.2) activesupport (>= 5.2) - premailer (1.18.0) + premailer (1.21.0) addressable css_parser (>= 1.12.0) htmlentities (>= 4.0.0) @@ -570,56 +571,57 @@ GEM actionmailer (>= 3) net-smtp premailer (~> 1.7, >= 1.7.9) - public_suffix (5.0.0) - puma (5.6.5) + public_suffix (5.0.3) + puma (5.6.7) nio4r (~> 2.0) - racc (1.7.1) - rack (2.2.4) - rack-attack (6.6.1) - rack (>= 1.0, < 3) + racc (1.7.2) + rack (2.2.8) + rack-attack (6.7.0) + rack (>= 1.0, < 4) rack-cors (1.1.1) rack (>= 2.0.0) - rack-protection (3.0.4) + rack-protection (3.1.0) + rack (~> 2.2, >= 2.2.4) + rack-proxy (0.7.7) rack - rack-proxy (0.7.4) - rack - rack-test (2.0.2) + rack-test (2.1.0) rack (>= 1.3) - rails (6.1.7) - actioncable (= 6.1.7) - actionmailbox (= 6.1.7) - actionmailer (= 6.1.7) - actionpack (= 6.1.7) - actiontext (= 6.1.7) - actionview (= 6.1.7) - activejob (= 6.1.7) - activemodel (= 6.1.7) - activerecord (= 6.1.7) - activestorage (= 6.1.7) - activesupport (= 6.1.7) + rails (6.1.7.6) + actioncable (= 6.1.7.6) + actionmailbox (= 6.1.7.6) + actionmailer (= 6.1.7.6) + actionpack (= 6.1.7.6) + actiontext (= 6.1.7.6) + actionview (= 6.1.7.6) + activejob (= 6.1.7.6) + activemodel (= 6.1.7.6) + activerecord (= 6.1.7.6) + activestorage (= 6.1.7.6) + activesupport (= 6.1.7.6) bundler (>= 1.15.0) - railties (= 6.1.7) + railties (= 6.1.7.6) sprockets-rails (>= 2.0.0) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) activesupport (>= 5.0.1.rc1) - rails-dom-testing (2.0.3) - activesupport (>= 4.2.0) + rails-dom-testing (2.2.0) + activesupport (>= 5.0.0) + minitest nokogiri (>= 1.6) rails-html-sanitizer (1.4.3) loofah (~> 2.3) rails-i18n (6.0.0) i18n (>= 0.7, < 2) railties (>= 6.0.0, < 7) - railties (6.1.7) - actionpack (= 6.1.7) - activesupport (= 6.1.7) + railties (6.1.7.6) + actionpack (= 6.1.7.6) + activesupport (= 6.1.7.6) method_source rake (>= 12.2) thor (~> 1.0) rainbow (3.1.1) - rake (13.0.6) + rake (13.1.0) ransack (2.4.2) activerecord (>= 5.2.4) activesupport (>= 5.2.4) @@ -627,15 +629,15 @@ GEM rb-fsevent (0.11.2) rb-inotify (0.10.1) ffi (~> 1.0) - redcarpet (3.5.1) - redis (4.8.0) - regexp_parser (2.6.1) + redcarpet (3.6.0) + redis (4.8.1) + regexp_parser (2.8.2) request_store (1.5.1) rack (>= 1.4) - responders (3.0.1) - actionpack (>= 5.0) - railties (>= 5.0) - rexml (3.2.5) + responders (3.1.1) + actionpack (>= 5.2) + railties (>= 5.2) + rexml (3.2.6) rspec (3.12.0) rspec-core (~> 3.12.0) rspec-expectations (~> 3.12.0) @@ -643,15 +645,15 @@ GEM rspec-cells (0.3.8) cells (>= 4.0.0, < 6.0.0) rspec-rails (>= 3.0.0, < 6.1.0) - rspec-core (3.12.0) + rspec-core (3.12.2) rspec-support (~> 3.12.0) - rspec-expectations (3.12.0) + rspec-expectations (3.12.3) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) rspec-html-matchers (0.9.4) nokogiri (~> 1) rspec (>= 3.0.0.a, < 4) - rspec-mocks (3.12.0) + rspec-mocks (3.12.6) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) rspec-rails (4.1.2) @@ -664,7 +666,7 @@ GEM rspec-support (~> 3.10) rspec-retry (0.6.2) rspec-core (> 3.3) - rspec-support (3.12.0) + rspec-support (3.12.1) rspec_junit_formatter (0.3.0) rspec-core (>= 2, < 4, != 2.12.0) rubocop (1.28.2) @@ -676,8 +678,8 @@ GEM rubocop-ast (>= 1.17.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.24.0) - parser (>= 3.1.1.0) + rubocop-ast (1.30.0) + parser (>= 3.2.1.0) rubocop-faker (1.1.0) faker (>= 2.12.0) rubocop (>= 0.82.0) @@ -687,8 +689,8 @@ GEM rubocop (>= 1.7.0, < 2.0) rubocop-rspec (2.11.1) rubocop (~> 1.19) - ruby-progressbar (1.11.0) - ruby-vips (2.1.4) + ruby-progressbar (1.13.0) + ruby-vips (2.2.0) ffi (~> 1.12) ruby2_keywords (0.0.5) rubyXL (3.4.25) @@ -725,30 +727,30 @@ GEM spring-watcher-listen (2.0.1) listen (>= 2.7, < 4.0) spring (>= 1.2, < 3.0) - sprockets (4.1.1) + sprockets (4.2.1) concurrent-ruby (~> 1.0) - rack (> 1, < 3) + rack (>= 2.2.4, < 4) sprockets-rails (3.4.2) actionpack (>= 5.2) activesupport (>= 5.2) sprockets (>= 3.0.0) - ssrf_filter (1.1.1) - temple (0.9.1) + ssrf_filter (1.1.2) + temple (0.10.3) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) - thor (1.2.1) + thor (1.3.0) thread_safe (0.3.6) - tilt (2.0.11) - timeout (0.3.1) + tilt (2.3.0) + timeout (0.4.0) tomlrb (2.0.3) - tzinfo (2.0.5) + tzinfo (2.0.6) concurrent-ruby (~> 1.0) uber (0.1.0) - unicode-display_width (2.3.0) + unicode-display_width (2.5.0) valid_email2 (2.3.1) activemodel (>= 3.2) mail (~> 2.5) - version_gem (1.1.1) + version_gem (1.1.3) virtus (2.0.0) axiom-types (~> 0.1) coercible (~> 1.0) @@ -763,12 +765,12 @@ GEM rexml (~> 3.2) warden (1.2.9) rack (>= 2.0.9) - web-console (4.2.0) + web-console (4.2.1) actionview (>= 6.0.0) activemodel (>= 6.0.0) bindex (>= 0.4.0) railties (>= 6.0.0) - webmock (3.18.1) + webmock (3.19.1) addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) @@ -780,29 +782,27 @@ GEM webpush (1.1.0) hkdf (~> 0.2) jwt (~> 2.0) - websocket-driver (0.7.5) + websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) - wicked_pdf (2.6.3) + wicked_pdf (2.7.0) activesupport wisper (2.0.1) wisper-rspec (1.1.0) wkhtmltopdf-binary (0.12.6.6) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.6.6) + zeitwerk (2.6.12) PLATFORMS - arm64-darwin-22 - x86_64-darwin-22 - x86_64-linux + x86_64-darwin-23 DEPENDENCIES bootsnap (~> 1.7) byebug (~> 11.0) codecov (~> 0.6.0) - decidim (= 0.27.1) - decidim-dev (= 0.27.1) + decidim (= 0.27.4) + decidim-dev (= 0.27.4) decidim-vocdoni! faker (~> 2.14) i18n-tasks (~> 0.9.37) @@ -818,4 +818,4 @@ RUBY VERSION ruby 3.0.5p211 BUNDLED WITH - 2.3.20 + 2.4.21 diff --git a/app/packs/entrypoints/admin/decidim_vocdoni_admin.js b/app/packs/entrypoints/admin/decidim_vocdoni_admin.js index 601c6fb6..95d882b0 100644 --- a/app/packs/entrypoints/admin/decidim_vocdoni_admin.js +++ b/app/packs/entrypoints/admin/decidim_vocdoni_admin.js @@ -6,6 +6,7 @@ import "src/decidim/vocdoni/admin/steps/setup_election" import "src/decidim/vocdoni/admin/steps/vote" import "src/decidim/vocdoni/admin/steps/vote_ended" import "src/decidim/vocdoni/admin/election_calendar" +import "src/decidim/vocdoni/admin/census" // Images require.context("../../images", true) diff --git a/app/packs/src/decidim/vocdoni/admin/census.js b/app/packs/src/decidim/vocdoni/admin/census.js new file mode 100644 index 00000000..4750ee63 --- /dev/null +++ b/app/packs/src/decidim/vocdoni/admin/census.js @@ -0,0 +1,26 @@ +function toggleSectionsBasedOnRadioButton() { + const csvRadioButton = document.getElementById("csv_radio_button"); + const permissionsRadioButton = document.getElementById("permissions_radio_button"); + const csvUploadDiv = document.getElementById("csv_upload"); + const permissionsSelectDiv = document.getElementById("permissions_select"); + + if (!csvRadioButton || !permissionsRadioButton || !csvUploadDiv || !permissionsSelectDiv) { + return; + } + + const toggleSections = () => { + if (csvRadioButton.checked) { + csvUploadDiv.style.display = "block"; + permissionsSelectDiv.style.display = "none"; + } else { + csvUploadDiv.style.display = "none"; + permissionsSelectDiv.style.display = "block"; + } + }; + + csvRadioButton.addEventListener("change", toggleSections); + permissionsRadioButton.addEventListener("change", toggleSections); + toggleSections(); +} + +document.addEventListener("DOMContentLoaded", toggleSectionsBasedOnRadioButton); diff --git a/app/packs/src/decidim/vocdoni/admin/election_calendar.js b/app/packs/src/decidim/vocdoni/admin/election_calendar.js index d722aae5..d4be0510 100644 --- a/app/packs/src/decidim/vocdoni/admin/election_calendar.js +++ b/app/packs/src/decidim/vocdoni/admin/election_calendar.js @@ -1,8 +1,8 @@ -document.addEventListener("DOMContentLoaded", () => { +function toggleStartTimeFieldBasedOnCheckbox() { const manualStartCheckbox = document.getElementById("election_calendar_manual_start"); const startTimeField = document.getElementById("election_calendar_start_time"); - if (manualStartCheckbox === null || startTimeField === null) { + if (!manualStartCheckbox || !startTimeField) { return; } @@ -10,8 +10,10 @@ document.addEventListener("DOMContentLoaded", () => { const isManualStartChecked = manualStartCheckbox.checked; startTimeField.disabled = isManualStartChecked; startTimeField.classList.toggle("text-muted", isManualStartChecked); - } + }; manualStartCheckbox.addEventListener("change", toggleStartTimeField); toggleStartTimeField(); -}); +} + +document.addEventListener("DOMContentLoaded", toggleStartTimeFieldBasedOnCheckbox); diff --git a/app/views/decidim/vocdoni/admin/census/index.html.erb b/app/views/decidim/vocdoni/admin/census/index.html.erb index b42ce652..e7563a3b 100644 --- a/app/views/decidim/vocdoni/admin/census/index.html.erb +++ b/app/views/decidim/vocdoni/admin/census/index.html.erb @@ -17,6 +17,13 @@ <%= t("index.info", scope: "decidim.vocdoni.admin.census") %>

+
+ <%= radio_button_tag "census_type", "csv", true, id: "csv_radio_button" %> + <%= label_tag "csv_radio_button", t("census_type.csv", scope: "decidim.vocdoni.admin.census") %> + + <%= radio_button_tag "census_type", "permissions", false, id: "permissions_radio_button" %> + <%= label_tag "permissions_radio_button", t("census_type.permissions", scope: "decidim.vocdoni.admin.census") %> +
<% end %> @@ -53,7 +60,7 @@ <% end %> <% if @status.pending_upload? %> -
+

<%= t("new.title", scope: "decidim.vocdoni.admin.census") %> @@ -63,6 +70,21 @@ <%= render partial: "upload_form", locals: { form: @form, election: election } %>

+ + <% end %> <% unless status.name == "ready" %>
diff --git a/config/locales/en.yml b/config/locales/en.yml index e1f63678..7fa78ac1 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -75,6 +75,9 @@ en: invalid: There was a problem updating this answer success: Answer successfully updated census: + census_type: + permissions: Decidim permissions + csv: CSV confirm: submit: Confirm the census data create: @@ -91,8 +94,7 @@ en: index: census_warning: The census is not ready yet. You can upload and confirm it from the census page. - info: For setting up the census for a Vocdoni Election, you need to upload - the census and confirm it. + info: You need to choose if you want a CSV file as census or to use the Decidim's verifications systems. title: Census for a Vocdoni election new: file: ".csv file with emails data" diff --git a/lib/decidim/vocdoni/version.rb b/lib/decidim/vocdoni/version.rb index f4279118..72e2b937 100644 --- a/lib/decidim/vocdoni/version.rb +++ b/lib/decidim/vocdoni/version.rb @@ -4,7 +4,7 @@ module Decidim # This holds the decidim-meetings version. module Vocdoni def self.version - "0.27.1" + "0.27.4" end end end diff --git a/package-lock.json b/package-lock.json index fd573757..84312e5f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "decidim-vocdoni", - "version": "0.27.1", + "version": "0.27.4", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "decidim-vocdoni", - "version": "0.27.1", + "version": "0.27.4", "license": "AGPL-3.0", "dependencies": { "@ethersproject/wallet": "^5.7.0", @@ -22,9 +22,9 @@ "@babel/plugin-transform-runtime": "^7.19.6", "@babel/preset-env": "^7.20.2", "@babel/preset-react": "^7.18.6", - "@decidim/dev": "0.27.1", - "@decidim/eslint-config": "0.27.1", - "@decidim/stylelint-config": "0.27.1", + "@decidim/dev": "0.27.4", + "@decidim/eslint-config": "0.27.4", + "@decidim/stylelint-config": "0.27.4", "eslint-config-prettier": "^8.5.0", "eslint-config-standard": "^11.0.0", "eslint-plugin-import": "^2.22.0", @@ -2017,18 +2017,18 @@ } }, "node_modules/@decidim/dev": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@decidim/dev/-/dev-0.27.1.tgz", - "integrity": "sha512-zHgwSUuvCWqav5QO6Bzr0LuhieJBE9fCep196I21q9+Rj7/1FRwRQqcdtvh+w+ldjJLnU0NTW7Jeb1eem2o+mQ==", + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@decidim/dev/-/dev-0.27.4.tgz", + "integrity": "sha512-85RoZQBsBs30emj9Ajo8lDOHKgcj9D7JtOYXoUFQmF5CfG6MSCDBSRVt9SV42ixcZV/ZkgBni4eod3JnkWy6RQ==", "dev": true, "dependencies": { "axe-core": "^4.1.4" } }, "node_modules/@decidim/eslint-config": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@decidim/eslint-config/-/eslint-config-0.27.1.tgz", - "integrity": "sha512-NqWjOF2Se0/klVejagAZQl1hPwKwBYem255lbTdUJ/CkrgqyBzgHET5HX+9IZrN7DJg436ofJQTFgFJ0itzuYA==", + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@decidim/eslint-config/-/eslint-config-0.27.4.tgz", + "integrity": "sha512-ZRXqtfROkeEy4HLdlNqK22gWk71H5RPwlULNSeCNFpahk1yq/r7uF4VU3AHwbusk9J2CGULqn2m8lXAo5NGNpQ==", "dev": true, "peerDependencies": { "eslint": "^7.25.0", @@ -2043,9 +2043,9 @@ } }, "node_modules/@decidim/stylelint-config": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@decidim/stylelint-config/-/stylelint-config-0.27.1.tgz", - "integrity": "sha512-gSFa9lJGsRRwG3WXfcl/Dbx9Wvz2MdssjowS1adT8ysWIssGAPnIMHV82HQZD0LYRG/kXqTXa4EF8lufLJdWKg==", + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@decidim/stylelint-config/-/stylelint-config-0.27.4.tgz", + "integrity": "sha512-K2mlm2JWHkFKiIsosFi00h2sQ9dolb/zJmw0WvwAiJXr5BShDxmypfdydePHviMS6+MnvfNLi6Hxz94WK/HUxQ==", "dev": true, "peerDependencies": { "stylelint": "13.11.0" @@ -9947,25 +9947,25 @@ } }, "@decidim/dev": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@decidim/dev/-/dev-0.27.1.tgz", - "integrity": "sha512-zHgwSUuvCWqav5QO6Bzr0LuhieJBE9fCep196I21q9+Rj7/1FRwRQqcdtvh+w+ldjJLnU0NTW7Jeb1eem2o+mQ==", + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@decidim/dev/-/dev-0.27.4.tgz", + "integrity": "sha512-85RoZQBsBs30emj9Ajo8lDOHKgcj9D7JtOYXoUFQmF5CfG6MSCDBSRVt9SV42ixcZV/ZkgBni4eod3JnkWy6RQ==", "dev": true, "requires": { "axe-core": "^4.1.4" } }, "@decidim/eslint-config": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@decidim/eslint-config/-/eslint-config-0.27.1.tgz", - "integrity": "sha512-NqWjOF2Se0/klVejagAZQl1hPwKwBYem255lbTdUJ/CkrgqyBzgHET5HX+9IZrN7DJg436ofJQTFgFJ0itzuYA==", + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@decidim/eslint-config/-/eslint-config-0.27.4.tgz", + "integrity": "sha512-ZRXqtfROkeEy4HLdlNqK22gWk71H5RPwlULNSeCNFpahk1yq/r7uF4VU3AHwbusk9J2CGULqn2m8lXAo5NGNpQ==", "dev": true, "requires": {} }, "@decidim/stylelint-config": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@decidim/stylelint-config/-/stylelint-config-0.27.1.tgz", - "integrity": "sha512-gSFa9lJGsRRwG3WXfcl/Dbx9Wvz2MdssjowS1adT8ysWIssGAPnIMHV82HQZD0LYRG/kXqTXa4EF8lufLJdWKg==", + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@decidim/stylelint-config/-/stylelint-config-0.27.4.tgz", + "integrity": "sha512-K2mlm2JWHkFKiIsosFi00h2sQ9dolb/zJmw0WvwAiJXr5BShDxmypfdydePHviMS6+MnvfNLi6Hxz94WK/HUxQ==", "dev": true, "requires": {} }, diff --git a/package.json b/package.json index 42557434..4ab991ff 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "decidim-vocdoni", - "version": "0.27.1", + "version": "0.27.4", "description": "An elections component for decidim's participatory spaces based on the Vocdoni SDK", "main": "index.js", "directories": { @@ -36,9 +36,9 @@ "@babel/plugin-transform-runtime": "^7.19.6", "@babel/preset-env": "^7.20.2", "@babel/preset-react": "^7.18.6", - "@decidim/dev": "0.27.1", - "@decidim/eslint-config": "0.27.1", - "@decidim/stylelint-config": "0.27.1", + "@decidim/dev": "0.27.4", + "@decidim/eslint-config": "0.27.4", + "@decidim/stylelint-config": "0.27.4", "eslint-config-prettier": "^8.5.0", "eslint-config-standard": "^11.0.0", "eslint-plugin-import": "^2.22.0",