decidim-core 0.26.8 → 0.26.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/app/cells/decidim/version_cell.rb +1 -1
  3. data/app/cells/decidim/versions_list_cell.rb +1 -1
  4. data/app/commands/decidim/endorse_resource.rb +2 -0
  5. data/app/commands/decidim/unendorse_resource.rb +1 -1
  6. data/app/controllers/decidim/devise/registrations_controller.rb +1 -1
  7. data/app/controllers/decidim/links_controller.rb +1 -1
  8. data/app/controllers/decidim/user_timeline_controller.rb +1 -1
  9. data/app/forms/decidim/account_form.rb +1 -1
  10. data/app/forms/decidim/notifications_settings_form.rb +0 -8
  11. data/app/forms/decidim/registration_form.rb +1 -1
  12. data/app/helpers/decidim/resource_helper.rb +2 -0
  13. data/app/jobs/decidim/data_portability_export_job.rb +3 -0
  14. data/app/jobs/decidim/open_data_job.rb +2 -0
  15. data/app/models/decidim/user.rb +9 -1
  16. data/app/packs/src/decidim/geocoding/attach_input.js +4 -1
  17. data/app/packs/src/decidim/geocoding/provider/here.js +17 -21
  18. data/app/packs/src/decidim/geocoding/provider/photon.js +1 -1
  19. data/app/views/decidim/notifications_settings/show.html.erb +1 -1
  20. data/config/environment.rb +3 -0
  21. data/config/locales/ar.yml +8 -13
  22. data/config/locales/bg.yml +0 -16
  23. data/config/locales/ca.yml +8 -5
  24. data/config/locales/cs.yml +15 -12
  25. data/config/locales/de.yml +37 -34
  26. data/config/locales/el.yml +6 -12
  27. data/config/locales/en.yml +3 -0
  28. data/config/locales/eo.yml +2 -3
  29. data/config/locales/es-MX.yml +11 -8
  30. data/config/locales/es-PY.yml +11 -8
  31. data/config/locales/es.yml +7 -4
  32. data/config/locales/eu.yml +379 -339
  33. data/config/locales/fi-plain.yml +5 -2
  34. data/config/locales/fi.yml +16 -13
  35. data/config/locales/fr-CA.yml +12 -9
  36. data/config/locales/fr.yml +7 -4
  37. data/config/locales/ga-IE.yml +0 -5
  38. data/config/locales/gl.yml +2 -17
  39. data/config/locales/hu.yml +9 -13
  40. data/config/locales/id-ID.yml +0 -19
  41. data/config/locales/is-IS.yml +1 -2
  42. data/config/locales/it.yml +8 -13
  43. data/config/locales/ja.yml +20 -18
  44. data/config/locales/lb.yml +8 -13
  45. data/config/locales/lt.yml +52 -7
  46. data/config/locales/lv.yml +0 -16
  47. data/config/locales/nl.yml +6 -11
  48. data/config/locales/no.yml +1 -6
  49. data/config/locales/pl.yml +14 -5
  50. data/config/locales/pt-BR.yml +49 -6
  51. data/config/locales/pt.yml +1 -6
  52. data/config/locales/ro-RO.yml +1 -6
  53. data/config/locales/ru.yml +0 -17
  54. data/config/locales/sk.yml +1 -17
  55. data/config/locales/sl.yml +0 -5
  56. data/config/locales/sq-AL.yml +1 -0
  57. data/config/locales/sv.yml +22 -12
  58. data/config/locales/th-TH.yml +1 -0
  59. data/config/locales/tr-TR.yml +9 -11
  60. data/config/locales/uk.yml +0 -14
  61. data/config/locales/zh-CN.yml +0 -6
  62. data/config/locales/zh-TW.yml +0 -5
  63. data/db/migrate/20231027142329_change_default_value_for_decidim_endorsements.rb +11 -0
  64. data/db/seeds.rb +1 -0
  65. data/lib/decidim/core/test/shared_examples/comments_examples.rb +24 -0
  66. data/lib/decidim/core/test/shared_examples/errors.rb +2 -0
  67. data/lib/decidim/core/version.rb +1 -1
  68. data/lib/decidim/core.rb +1 -1
  69. data/lib/decidim/dependency_resolver.rb +14 -8
  70. data/lib/decidim/endorsable.rb +1 -1
  71. data/lib/decidim/exporters.rb +10 -1
  72. data/lib/tasks/upgrade/decidim_deduplicate_endorsements.rake +53 -0
  73. metadata +10 -9
  74. data/app/helpers/decidim/layout_helper.rb.orig +0 -225
  75. data/app/packs/stylesheets/decidim/modules/_dropdown_menu.scss +0 -9
  76. data/app/views/decidim/devise/registrations/new.html.erb.orig +0 -231
@@ -0,0 +1,53 @@
1
+ # frozen_string_literal: true
2
+
3
+ namespace :decidim do
4
+ namespace :upgrade do
5
+ desc "Remove duplicated endorsements"
6
+ task fix_duplicate_endorsements: :environment do
7
+ logger = Logger.new($stdout)
8
+ logger.info("Removing duplicate endorsements...")
9
+ has_count = 0
10
+
11
+ columns = [:resource_type, :resource_id, :decidim_author_type, :decidim_author_id, :decidim_user_group_id]
12
+
13
+ get_duplicates(columns).each do |issue|
14
+ while row_count(issue) > 1
15
+ find_next(issue)&.destroy
16
+ has_count += 1
17
+ logger.info("Removed duplicate endorsement for #{issue.resource_type} #{issue.resource_id}")
18
+ end
19
+ end
20
+
21
+ logger.info("Patch remaining endorsements.")
22
+ Decidim::Endorsement.where(decidim_user_group_id: nil).update(decidim_user_group_id: 0)
23
+ logger.info("Process terminated, #{has_count} endorsements have been removed.")
24
+ logger.info("Done")
25
+ end
26
+
27
+ private
28
+
29
+ def get_duplicates(*columns)
30
+ Decidim::Endorsement.select("#{columns.join(",")}, COUNT(*)").group(columns).having("COUNT(*) > 1")
31
+ end
32
+
33
+ def row_count(issue)
34
+ Decidim::Endorsement.where(
35
+ resource_type: issue.resource_type,
36
+ resource_id: issue.resource_id,
37
+ decidim_author_type: issue.decidim_author_type,
38
+ decidim_author_id: issue.decidim_author_id,
39
+ decidim_user_group_id: issue.decidim_user_group_id
40
+ ).count
41
+ end
42
+
43
+ def find_next(issue)
44
+ Decidim::Endorsement.find_by(
45
+ resource_type: issue.resource_type,
46
+ resource_id: issue.resource_id,
47
+ decidim_author_type: issue.decidim_author_type,
48
+ decidim_author_id: issue.decidim_author_id,
49
+ decidim_user_group_id: issue.decidim_user_group_id
50
+ )
51
+ end
52
+ end
53
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decidim-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.26.8
4
+ version: 0.26.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josep Jaume Rey Peroy
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2023-07-27 00:00:00.000000000 Z
13
+ date: 2023-12-21 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: active_link_to
@@ -754,28 +754,28 @@ dependencies:
754
754
  requirements:
755
755
  - - '='
756
756
  - !ruby/object:Gem::Version
757
- version: 0.26.8
757
+ version: 0.26.9
758
758
  type: :runtime
759
759
  prerelease: false
760
760
  version_requirements: !ruby/object:Gem::Requirement
761
761
  requirements:
762
762
  - - '='
763
763
  - !ruby/object:Gem::Version
764
- version: 0.26.8
764
+ version: 0.26.9
765
765
  - !ruby/object:Gem::Dependency
766
766
  name: decidim-dev
767
767
  requirement: !ruby/object:Gem::Requirement
768
768
  requirements:
769
769
  - - '='
770
770
  - !ruby/object:Gem::Version
771
- version: 0.26.8
771
+ version: 0.26.9
772
772
  type: :development
773
773
  prerelease: false
774
774
  version_requirements: !ruby/object:Gem::Requirement
775
775
  requirements:
776
776
  - - '='
777
777
  - !ruby/object:Gem::Version
778
- version: 0.26.8
778
+ version: 0.26.9
779
779
  description: Adds core features so other engines can hook into the framework.
780
780
  email:
781
781
  - josepjaume@gmail.com
@@ -1195,7 +1195,6 @@ files:
1195
1195
  - app/helpers/decidim/icon_helper.rb
1196
1196
  - app/helpers/decidim/language_chooser_helper.rb
1197
1197
  - app/helpers/decidim/layout_helper.rb
1198
- - app/helpers/decidim/layout_helper.rb.orig
1199
1198
  - app/helpers/decidim/localized_locales_helper.rb
1200
1199
  - app/helpers/decidim/map_helper.rb
1201
1200
  - app/helpers/decidim/markup_helper.rb
@@ -1531,7 +1530,6 @@ files:
1531
1530
  - app/packs/stylesheets/decidim/modules/_datepicker.scss
1532
1531
  - app/packs/stylesheets/decidim/modules/_definition-data.scss
1533
1532
  - app/packs/stylesheets/decidim/modules/_docs-manager.scss
1534
- - app/packs/stylesheets/decidim/modules/_dropdown_menu.scss
1535
1533
  - app/packs/stylesheets/decidim/modules/_extra.scss
1536
1534
  - app/packs/stylesheets/decidim/modules/_filter-tags.scss
1537
1535
  - app/packs/stylesheets/decidim/modules/_filters.scss
@@ -1778,7 +1776,6 @@ files:
1778
1776
  - app/views/decidim/devise/passwords/edit.html.erb
1779
1777
  - app/views/decidim/devise/passwords/new.html.erb
1780
1778
  - app/views/decidim/devise/registrations/new.html.erb
1781
- - app/views/decidim/devise/registrations/new.html.erb.orig
1782
1779
  - app/views/decidim/devise/sessions/new.html.erb
1783
1780
  - app/views/decidim/devise/shared/_links.html.erb
1784
1781
  - app/views/decidim/devise/shared/_newsletter_modal.html.erb
@@ -2018,9 +2015,11 @@ files:
2018
2015
  - config/locales/sk.yml
2019
2016
  - config/locales/sl.yml
2020
2017
  - config/locales/so-SO.yml
2018
+ - config/locales/sq-AL.yml
2021
2019
  - config/locales/sr-CS.yml
2022
2020
  - config/locales/sv.yml
2023
2021
  - config/locales/sw-KE.yml
2022
+ - config/locales/th-TH.yml
2024
2023
  - config/locales/ti-ER.yml
2025
2024
  - config/locales/tr-TR.yml
2026
2025
  - config/locales/uk.yml
@@ -2225,6 +2224,7 @@ files:
2225
2224
  - db/migrate/20210629172525_fix_blocked_user_names_in_action_log.rb
2226
2225
  - db/migrate/20210730112319_create_decidim_editor_images.rb
2227
2226
  - db/migrate/20211126183540_add_timestamps_to_content_blocks.rb
2227
+ - db/migrate/20231027142329_change_default_value_for_decidim_endorsements.rb
2228
2228
  - db/seeds.rb
2229
2229
  - db/seeds/homepage_image.jpg
2230
2230
  - lib/decidim/action_authorization.rb
@@ -2582,6 +2582,7 @@ files:
2582
2582
  - lib/tasks/decidim_open_data_tasks.rake
2583
2583
  - lib/tasks/decidim_tasks.rake
2584
2584
  - lib/tasks/decidim_webpacker_tasks.rake
2585
+ - lib/tasks/upgrade/decidim_deduplicate_endorsements.rake
2585
2586
  - lib/tasks/upgrade/decidim_moderation_tasks.rake
2586
2587
  - lib/tasks/upgrade/decidim_user_moderation.rake
2587
2588
  homepage: https://github.com/decidim/decidim
@@ -1,225 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Decidim
4
- # View helpers related to the layout.
5
- module LayoutHelper
6
- include Decidim::ModalHelper
7
- include Decidim::TooltipHelper
8
-
9
- # Public: Generates a set of meta tags that generate the different favicon
10
- # versions for an organization.
11
- #
12
- # Returns a safe String with the versions.
13
- def favicon
14
- return if current_organization.favicon.blank?
15
-
16
- safe_join(Decidim::OrganizationFaviconUploader::SIZES.map do |version, size|
17
- favicon_link_tag(current_organization.attached_uploader(:favicon).variant_url(version, host: current_organization.host), sizes: "#{size}x#{size}")
18
- end)
19
- end
20
-
21
- def apple_favicon
22
- icon_image = current_organization.attached_uploader(:favicon).variant_url(:medium, host: current_organization.host)
23
- return unless icon_image
24
-
25
- favicon_link_tag(icon_image, rel: "apple-touch-icon", type: "image/png")
26
- end
27
-
28
- def legacy_favicon
29
- variant = :favicon if current_organization.favicon.content_type != "image/vnd.microsoft.icon"
30
- icon_image = current_organization.attached_uploader(:favicon).variant_url(variant, host: current_organization.host)
31
- return unless icon_image
32
-
33
- favicon_link_tag(icon_image, rel: "icon", sizes: "any", type: nil)
34
- end
35
-
36
- # Outputs an SVG-based icon.
37
- #
38
- # name - The String with the icon name.
39
- # options - The Hash options used to customize the icon (default {}):
40
- # :width - The Number of width in pixels (optional).
41
- # :height - The Number of height in pixels (optional).
42
- # :title - The title for the SVG element (optional, similar to alt for img)
43
- # :aria_label - The String to set as aria label (optional).
44
- # :aria_hidden - The Truthy value to enable aria_hidden (optional).
45
- # :role - The String to set as the role (optional).
46
- # :class - The String to add as a CSS class (optional).
47
- #
48
- # Returns a String.
49
- def redesigned_icon(name, options = {})
50
- default_html_properties = {
51
- "width" => "1em",
52
- "height" => "1em",
53
- "role" => "img",
54
- "aria-hidden" => "true"
55
- }
56
-
57
- html_properties = options.with_indifferent_access.transform_keys(&:dasherize).slice("width", "height", "aria-label", "role", "aria-hidden", "class", "style")
58
- html_properties = default_html_properties.merge(html_properties)
59
-
60
- href = Decidim.cors_enabled ? "" : asset_pack_path("media/images/remixicon.symbol.svg")
61
-
62
- content_tag :svg, html_properties do
63
- content_tag :use, nil, "href" => "#{href}#ri-#{name}", tabindex: -1
64
- end
65
- end
66
-
67
- def legacy_icon(name, options = {})
68
- options = options.with_indifferent_access
69
- html_properties = {}
70
-
71
- html_properties["width"] = options[:width]
72
- html_properties["height"] = options[:height]
73
- html_properties["aria-label"] = options[:aria_label] || options[:"aria-label"]
74
- html_properties["role"] = options[:role] || "img"
75
- html_properties["aria-hidden"] = options[:aria_hidden] || options[:"aria-hidden"]
76
-
77
- html_properties["class"] = (["icon--#{name}"] + _icon_classes(options)).join(" ")
78
-
79
- title = options["title"] || html_properties["aria-label"]
80
- if title.blank? && html_properties["role"] == "img"
81
- # This will make the accessibility audit tools happy as with the "img"
82
- # role, the alternative text (aria-label) and title are required for the
83
- # element. This will also force the SVG to be hidden because otherwise
84
- # the screen reader would announce the icon name which can be in
85
- # different language (English) than the page language which is not
86
- # allowed.
87
- title = name
88
- html_properties["aria-label"] = title
89
- html_properties["aria-hidden"] = true
90
- end
91
-
92
- href = Decidim.cors_enabled ? "" : asset_pack_path("media/images/icons.svg")
93
-
94
- content_tag :svg, html_properties do
95
- inner = content_tag :title, title
96
- inner += content_tag :use, nil, "href" => "#{href}#icon-#{name}"
97
-
98
- inner
99
- end
100
- end
101
-
102
- def icon(*args)
103
- redesign_enabled? ? redesigned_icon(*args) : legacy_icon(*args)
104
- end
105
-
106
- # Outputs a SVG icon from an external file. It apparently renders an image
107
- # tag, but then a JS script kicks in and replaces it with an inlined SVG
108
- # version.
109
- #
110
- # path - The asset's path
111
- #
112
- # Returns an <img /> tag with the SVG icon.
113
- def external_icon(path, options = {})
114
- classes = _icon_classes(options) + ["external-icon"]
115
-
116
- if path.split(".").last == "svg"
117
- icon_path = application_path(path)
118
- return unless icon_path
119
-
120
- attributes = { class: classes.join(" ") }.merge(options)
121
- asset = File.read(icon_path)
122
- asset.gsub("<svg ", "<svg#{tag_builder.tag_options(attributes)} ").html_safe
123
- else
124
- image_pack_tag(path, class: classes.join(" "), style: "display: none")
125
- end
126
- end
127
-
128
- def application_path(path)
129
- # Force the path to be returned without the protocol and host even when a
130
- # custom asset host has been defined. The host parameter needs to be a
131
- # non-nil because otherwise it will be set to the asset host at
132
- # ActionView::Helpers::AssetUrlHelper#compute_asset_host.
133
- img_path = asset_pack_path(path, host: "", protocol: :relative)
134
- path = Rails.public_path.join(img_path.sub(%r{^/}, ""))
135
- return unless File.exist?(path)
136
-
137
- path
138
- rescue ::Webpacker::Manifest::MissingEntryError
139
- nil
140
- end
141
-
142
- # Allows to create role attribute according to accessibility rules
143
- #
144
- # Returns role attribute string if role option is specified
145
- def role(options = {})
146
- "role=\"#{options[:role]}\" " if options[:role]
147
- end
148
-
149
- def _icon_classes(options = {})
150
- classes = options[:remove_icon_class] ? [] : ["icon"]
151
- classes += [options[:class]]
152
- classes.compact
153
- end
154
-
155
- def extended_navigation_bar(items, max_items: 5)
156
- return unless items.any?
157
-
158
- extra_items = items.slice((max_items + 1)..-1) || []
159
- active_item = items.find { |item| item[:active] }
160
-
161
- controller.view_context.render partial: "decidim/shared/extended_navigation_bar", locals: {
162
- items:,
163
- extra_items:,
164
- active_item:,
165
- max_items:
166
- }
167
- end
168
-
169
- # Renders a view with the customizable CSS variables in two flavours:
170
- # 1. as a hexadecimal valid CSS color (ie: #ff0000)
171
- # 2. as a disassembled RGB components (ie: 255 0 0)
172
- #
173
- # Example:
174
- #
175
- # --primary: #ff0000;
176
- # --primary-rgb: 255,0,0
177
- #
178
- # Hexadecimal variables can be used as a normal CSS color:
179
- #
180
- # color: var(--primary)
181
- #
182
- # While the disassembled variant can be used where you need to manipulate
183
- # the color somehow (ie: adding a background transparency):
184
- #
185
- # background-color: rgba(var(--primary-rgb), 0.5)
186
- def organization_colors
187
- css = current_organization.colors.each.map { |k, v| "--#{k}: #{v};--#{k}-rgb: #{v[1..2].hex} #{v[3..4].hex} #{v[5..6].hex};" }.join
188
- render partial: "layouts/decidim/organization_colors", locals: { css: }
189
- end
190
-
191
- <<<<<<< HEAD
192
- def current_user_unread_data
193
- return {} if current_user.blank?
194
-
195
- {}.tap do |d|
196
- d.merge!(unread_notifications: true) if current_user.notifications.any?
197
- d.merge!(unread_conversations: true) if current_user.unread_conversations.any?
198
- d.merge!(unread_items: d.present?)
199
- end
200
- end
201
-
202
- ||||||| parent of 53b6893e5c (Use local emojibase data instead of CDN)
203
- =======
204
- # Public: Gets the name of the webpacker entrypoint that will be used
205
- # for the locale of the Emojibase NPM package, used with @picmo/popup-picker
206
- #
207
- # Returns a string with the entrypoint name
208
- def emojibase_entrypoint_locale
209
- entrypoint = Decidim::Webpacker.configuration.entrypoints.keys.select do |entry|
210
- entry == "decidim_emojibase_#{I18n.locale}"
211
- end
212
-
213
- return "decidim_emojibase_en" if entrypoint.empty?
214
-
215
- entrypoint.first
216
- end
217
-
218
- >>>>>>> 53b6893e5c (Use local emojibase data instead of CDN)
219
- private
220
-
221
- def tag_builder
222
- @tag_builder ||= ActionView::Helpers::TagHelper::TagBuilder.new(self)
223
- end
224
- end
225
- end
@@ -1,9 +0,0 @@
1
- .dropdown.menu > li {
2
- &.is-active > a {
3
- color: var(--secondary);
4
- }
5
-
6
- &.is-dropdown-submenu-parent > a::after {
7
- border-color: var(--secondary) transparent transparent;
8
- }
9
- }
@@ -1,231 +0,0 @@
1
- <% add_decidim_page_title(t(".sign_up")) %>
2
-
3
- <% content_for :devise_links do %>
4
- <%= render "decidim/devise/shared/links" %>
5
- <% end %>
6
-
7
- <%= render layout: "layouts/decidim/shared/layout_center" do %>
8
- <div class="flex justify-center">
9
- <h1 class="h3 md:h1 decorator my-12"><%= t("decidim.devise.registrations.new.sign_up") %></h1>
10
- </div>
11
-
12
- <div class="login__info">
13
- <p>
14
- <%= t("decidim.devise.registrations.new.subtitle") %>
15
- </p>
16
- <p class="font-semibold">
17
- <%= t("decidim.devise.registrations.new.already_have_an_account?") %>
18
- <%= link_to t("decidim.devise.registrations.new.sign_in"), new_user_session_path %>
19
- </p>
20
- </div>
21
-
22
- <div class="login__info-required">
23
- <%= form_required_explanation %>
24
- </div>
25
-
26
- <div class="login__omniauth-container">
27
- <% cache current_organization do %>
28
- <%= render "decidim/devise/shared/omniauth_buttons" %>
29
- <% end %>
30
- </div>
31
-
32
- <%= decidim_form_for(@form, namespace: "registration", as: resource_name, url: registration_path(resource_name), html: { id: "register-form" }) do |f| %>
33
- <%= invisible_captcha %>
34
-
35
- <div class="form__wrapper">
36
- <%= f.text_field :name, help_text: t("decidim.devise.registrations.new.username_help"), autocomplete: "name", placeholder: "John Doe" %>
37
-
38
- <%= f.text_field :nickname, help_text: t("decidim.devise.registrations.new.nickname_help", organization: current_organization.name), autocomplete: "nickname", placeholder: "johndoe" %>
39
-
40
- <%= f.email_field :email, autocomplete: "email", placeholder: "hi@email.com" %>
41
-
42
- <%= f.password_field :password, password_field_options_for(:user) %>
43
-
44
- <%= f.password_field :password_confirmation, password_field_options_for(:user).except(:help_text) %>
45
- </div>
46
-
47
- <div id="card__tos" class="form__wrapper-block">
48
- <h4 class="h4"><%= t("decidim.devise.registrations.new.tos_title") %></h4>
49
-
50
- <div class="tos-text">
51
- <% terms_of_service_summary_content_blocks.each do |content_block| %>
52
- <%= cell content_block.manifest.cell, content_block %>
53
- <% end %>
54
- </div>
55
-
56
- <%= f.check_box :tos_agreement, label: t("decidim.devise.registrations.new.tos_agreement", link: link_to(t("decidim.devise.registrations.new.terms"), page_path("terms-of-service"))), label_options: { class: "form__wrapper-checkbox-label" } %>
57
- </div>
58
-
59
- <div id="card__newsletter" class="form__wrapper-block">
60
- <h4 class="h4"><%= t("decidim.devise.registrations.new.newsletter_title") %></h4>
61
- <%= f.check_box :newsletter, label: t("decidim.devise.registrations.new.newsletter"), checked: @form.newsletter, label_options: { class: "form__wrapper-checkbox-label" } %>
62
- </div>
63
-
64
- <div class="form__wrapper-block">
65
- <button type="submit" class="button button__lg button__secondary">
66
- <%= t("decidim.devise.registrations.new.sign_up") %>
67
- <%= icon "arrow-right-line", class: "fill-current" %>
68
- </button>
69
- </div>
70
-
71
- <div class="login__links">
72
- <%= render "decidim/devise/shared/redesigned_links" %>
73
- </div>
74
- <% end %>
75
- <% end %>
76
-
77
- <<<<<<< HEAD
78
- ||||||| parent of 4e14afa36c (add password toggle via unobstructive javascript)
79
- <div class="row">
80
- <div class="columns large-6 medium-10 medium-centered">
81
-
82
- <%= decidim_form_for(@form, namespace: "registration", as: resource_name, url: registration_path(resource_name), html: { class: "register-form new_user", id: "register-form" }) do |f| %>
83
- <%= invisible_captcha %>
84
- <div class="card">
85
- <div class="card__content">
86
- <%= form_required_explanation %>
87
-
88
- <div class="user-person">
89
- <div class="field">
90
- <%= f.text_field :name, help_text: t(".username_help"), autocomplete: "name" %>
91
- </div>
92
- </div>
93
-
94
- <div class="user-nickname">
95
- <div class="field">
96
- <%= f.text_field :nickname, help_text: t(".nickname_help", organization: current_organization.name), prefix: { value: "@", small: 1, large: 1 }, autocomplete: "nickname" %>
97
- </div>
98
- </div>
99
-
100
- <div class="field">
101
- <%= f.email_field :email, autocomplete: "email" %>
102
- </div>
103
-
104
- <div class="field">
105
- <%= f.password_field :password, password_field_options_for(:user) %>
106
- </div>
107
-
108
- <div class="field">
109
- <%= f.password_field :password_confirmation, password_field_options_for(:user).except(:help_text) %>
110
- </div>
111
- </div>
112
- </div>
113
-
114
- <div class="card" id="card__tos">
115
- <div class="card__content">
116
- <h3><%= t(".tos_title") %></h3>
117
-
118
- <p class="tos-text">
119
- <%= strip_tags(translated_attribute(terms_and_conditions_page.content)) %>
120
- </p>
121
-
122
- <div class="field">
123
- <%= f.check_box :tos_agreement, label: t(".tos_agreement", link: link_to(t(".terms"), page_path("terms-and-conditions"))) %>
124
- </div>
125
- </div>
126
- </div>
127
-
128
- <div class="card" id="card__newsletter">
129
- <div class="card__content">
130
- <h3><%= t(".newsletter_title") %></h3>
131
- <div class="field">
132
- <%= f.check_box :newsletter, label: t(".newsletter"), checked: @form.newsletter %>
133
- </div>
134
- </div>
135
- </div>
136
-
137
- <div class="card">
138
- <div class="card__content">
139
- <div class="actions">
140
- <%= f.submit t("devise.registrations.new.sign_up"), class: "button expanded" %>
141
- </div>
142
- <%= yield :devise_links %>
143
- </div>
144
- </div>
145
- <% end %>
146
- </div>
147
- </div>
148
- </div>
149
- </div>
150
- =======
151
- <div class="row">
152
- <div class="columns large-6 medium-10 medium-centered">
153
-
154
- <%= decidim_form_for(@form, namespace: "registration", as: resource_name, url: registration_path(resource_name), html: { class: "register-form new_user", id: "register-form" }) do |f| %>
155
- <%= invisible_captcha %>
156
- <div class="card">
157
- <div class="card__content">
158
- <%= form_required_explanation %>
159
-
160
- <div class="user-person">
161
- <div class="field">
162
- <%= f.text_field :name, help_text: t(".username_help"), autocomplete: "off" %>
163
- </div>
164
- </div>
165
-
166
- <div class="user-nickname">
167
- <div class="field">
168
- <%= f.text_field :nickname, help_text: t(".nickname_help", organization: current_organization.name), prefix: { value: "@", small: 1, large: 1 }, autocomplete: "off" %>
169
- </div>
170
- </div>
171
-
172
- <div class="field">
173
- <%= f.email_field :email, autocomplete: "email" %>
174
- </div>
175
-
176
- <div class="user-password">
177
- <div class="field">
178
- <%= f.password_field :password, password_field_options_for(:user) %>
179
- </div>
180
- </div>
181
-
182
- <div class="user-password-confirmation">
183
- <div class="field">
184
- <%= f.password_field :password_confirmation, password_field_options_for(:user).except(:help_text) %>
185
- </div>
186
- </div>
187
- </div>
188
- </div>
189
-
190
- <div class="card" id="card__tos">
191
- <div class="card__content">
192
- <h3><%= t(".tos_title") %></h3>
193
-
194
- <p class="tos-text">
195
- <%= strip_tags(translated_attribute(terms_and_conditions_page.content)) %>
196
- </p>
197
-
198
- <div class="field">
199
- <%= f.check_box :tos_agreement, label: t(".tos_agreement", link: link_to(t(".terms"), page_path("terms-and-conditions"))) %>
200
- </div>
201
- </div>
202
- </div>
203
-
204
- <div class="card" id="card__newsletter">
205
- <div class="card__content">
206
- <h3><%= t(".newsletter_title") %></h3>
207
- <div class="field">
208
- <%= f.check_box :newsletter, label: t(".newsletter"), checked: @form.newsletter %>
209
- </div>
210
- </div>
211
- </div>
212
-
213
- <div class="card">
214
- <div class="card__content">
215
- <div class="actions">
216
- <%= f.submit t("devise.registrations.new.sign_up"), class: "button expanded" %>
217
- </div>
218
- <%= yield :devise_links %>
219
- </div>
220
- </div>
221
- <% end %>
222
- </div>
223
- </div>
224
- </div>
225
- </div>
226
- >>>>>>> 4e14afa36c (add password toggle via unobstructive javascript)
227
- <%= render "decidim/devise/shared/newsletter_modal" %>
228
-
229
- <% content_for :js_content do %>
230
- <%= javascript_pack_tag "decidim_registrations" %>
231
- <% end %>