decidim-core 0.26.7 → 0.26.8
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/collapsible_list/show.erb +1 -1
- data/app/controllers/decidim/authorization_modals_controller.rb +1 -1
- data/app/forms/url_validator.rb +1 -1
- data/app/helpers/decidim/layout_helper.rb +15 -4
- data/app/helpers/decidim/layout_helper.rb.orig +225 -0
- data/app/models/decidim/organization.rb +6 -0
- data/app/packs/src/decidim/map/controller/drag_marker.js +0 -2
- data/app/packs/src/decidim/map/controller/markers.js +0 -1
- data/app/packs/src/decidim/map/controller/static.js +0 -1
- data/app/packs/src/decidim/map/controller.js +0 -2
- data/app/packs/src/decidim/map/factory.js +4 -1
- data/app/packs/src/decidim/map/icon.js +0 -1
- data/app/packs/src/decidim/map/legacy.js +0 -1
- data/app/packs/src/decidim/map/provider/default.js +2 -0
- data/app/packs/src/decidim/map/provider/here.js +2 -1
- data/app/packs/stylesheets/decidim/modules/_dropdown_menu.scss +9 -0
- data/app/queries/decidim/metrics/users_metric_manage.rb +6 -6
- data/app/views/decidim/devise/registrations/new.html.erb.orig +231 -0
- data/config/environment.rb +0 -0
- data/config/locales/ar.yml +2 -2
- data/config/locales/ca.yml +7 -6
- data/config/locales/cs.yml +23 -7
- data/config/locales/de.yml +47 -12
- data/config/locales/el.yml +100 -0
- data/config/locales/en.yml +1 -0
- data/config/locales/eo.yml +3 -0
- data/config/locales/es-MX.yml +2 -1
- data/config/locales/es-PY.yml +4 -3
- data/config/locales/es.yml +7 -6
- data/config/locales/eu.yml +4 -4
- data/config/locales/fi-plain.yml +22 -0
- data/config/locales/fi.yml +1 -0
- data/config/locales/fr-CA.yml +6 -5
- data/config/locales/fr.yml +7 -6
- data/config/locales/gl.yml +4 -1
- data/config/locales/hu.yml +22 -1
- data/config/locales/id-ID.yml +4 -0
- data/config/locales/is-IS.yml +3 -1
- data/config/locales/it.yml +6 -6
- data/config/locales/ja.yml +15 -0
- data/config/locales/kaa.yml +4 -0
- data/config/locales/lb.yml +8 -8
- data/config/locales/lt.yml +1 -1
- data/config/locales/nl.yml +6 -6
- data/config/locales/no.yml +4 -4
- data/config/locales/pt-BR.yml +1 -1
- data/config/locales/pt.yml +1 -1
- data/config/locales/ru.yml +2 -0
- data/config/locales/sk.yml +17 -7
- data/config/locales/sr-CS.yml +8 -0
- data/config/locales/sv.yml +11 -11
- data/config/locales/uk.yml +2 -0
- data/config/locales/zh-TW.yml +16 -2
- data/db/migrate/20181030090144_destroy_deleted_users_follows.rb +1 -1
- data/db/migrate/20181204110723_remove_following_users_count_from_users.rb +11 -2
- data/db/migrate/20181214101250_add_notification_types_to_users.rb +6 -1
- data/db/migrate/20190412131728_fix_user_names.rb +13 -6
- data/db/migrate/20200211173227_add_direct_message_types_to_users.rb +6 -1
- data/db/migrate/20210302150803_invalidate_all_sessions_for_deleted_users.rb +10 -3
- data/db/migrate/20210310120640_add_followable_counter_cache_to_users.rb +13 -3
- data/lib/decidim/core/test/shared_examples/map_examples.rb +4 -1
- data/lib/decidim/core/version.rb +1 -1
- data/lib/decidim/core.rb +43 -0
- data/lib/decidim/dependency_resolver.rb +272 -0
- data/lib/decidim/form_builder.rb +6 -13
- data/lib/tasks/upgrade/decidim_user_moderation.rake +14 -0
- metadata +12 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7ddc4e551d59fc9b95f5121333870c4e91a77eb2f53d03f659d63e16bea7ca7f
|
|
4
|
+
data.tar.gz: dd766575d88dfe729ce7f8ea151967642b40e875c0596443962d0a6d8d5cd101
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dcbcc2625fe80e646c9f5e05c0e187485004542bcb73c33978bd8f2b1f78f31c2e0a4f4dba6904ba0b660e5b4408977a21d13e0c02fe2d46cba8bdb13c399321
|
|
7
|
+
data.tar.gz: a1abc1c25bfe4c99875d00822beeefeadb20bd214672772b1491d07e515ce3990b6b24c96d5400e4bc71d1accb8c8484d7e57c6ed006f63fd19e23f8378234ce
|
|
@@ -17,7 +17,7 @@ module Decidim
|
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
def current_component
|
|
20
|
-
@current_component ||= Decidim::Component.find(params[:component_id])
|
|
20
|
+
@current_component ||= Decidim::Component.where(participatory_space: current_organization.participatory_spaces).find(params[:component_id])
|
|
21
21
|
end
|
|
22
22
|
|
|
23
23
|
def authorization_action
|
data/app/forms/url_validator.rb
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
#
|
|
7
7
|
class UrlValidator < ActiveModel::EachValidator
|
|
8
8
|
def validate_each(record, attribute, value)
|
|
9
|
-
record.errors
|
|
9
|
+
record.errors.add attribute, :url_format, **options unless url_valid?(value)
|
|
10
10
|
end
|
|
11
11
|
|
|
12
12
|
# a URL may be technically well-formed but may
|
|
@@ -74,8 +74,11 @@ module Decidim
|
|
|
74
74
|
classes = _icon_classes(options) + ["external-icon"]
|
|
75
75
|
|
|
76
76
|
if path.split(".").last == "svg"
|
|
77
|
+
icon_path = application_path(path)
|
|
78
|
+
return unless icon_path
|
|
79
|
+
|
|
77
80
|
attributes = { class: classes.join(" ") }.merge(options)
|
|
78
|
-
asset = File.read(
|
|
81
|
+
asset = File.read(icon_path)
|
|
79
82
|
asset.gsub("<svg ", "<svg#{tag_builder.tag_options(attributes)} ").html_safe
|
|
80
83
|
else
|
|
81
84
|
image_pack_tag(path, class: classes.join(" "), style: "display: none")
|
|
@@ -83,9 +86,17 @@ module Decidim
|
|
|
83
86
|
end
|
|
84
87
|
|
|
85
88
|
def application_path(path)
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
+
# Force the path to be returned without the protocol and host even when a
|
|
90
|
+
# custom asset host has been defined. The host parameter needs to be a
|
|
91
|
+
# non-nil because otherwise it will be set to the asset host at
|
|
92
|
+
# ActionView::Helpers::AssetUrlHelper#compute_asset_host.
|
|
93
|
+
img_path = asset_pack_path(path, host: "", protocol: :relative)
|
|
94
|
+
path = Rails.public_path.join(img_path.sub(%r{^/}, ""))
|
|
95
|
+
return unless File.exist?(path)
|
|
96
|
+
|
|
97
|
+
path
|
|
98
|
+
rescue ::Webpacker::Manifest::MissingEntryError
|
|
99
|
+
nil
|
|
89
100
|
end
|
|
90
101
|
|
|
91
102
|
# Allows to create role attribute according to accessibility rules
|
|
@@ -0,0 +1,225 @@
|
|
|
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
|
|
@@ -87,6 +87,12 @@ module Decidim
|
|
|
87
87
|
@top_scopes ||= scopes.top_level
|
|
88
88
|
end
|
|
89
89
|
|
|
90
|
+
def participatory_spaces
|
|
91
|
+
@participatory_spaces ||= Decidim.participatory_space_manifests.flat_map do |manifest|
|
|
92
|
+
manifest.participatory_spaces.call(self)
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
|
|
90
96
|
def public_participatory_spaces
|
|
91
97
|
@public_participatory_spaces ||= Decidim.participatory_space_manifests.flat_map do |manifest|
|
|
92
98
|
manifest.participatory_spaces.call(self).public_spaces
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import "src/decidim/map/icon"
|
|
2
|
+
|
|
1
3
|
import MapMarkersController from "src/decidim/map/controller/markers"
|
|
2
4
|
import MapStaticController from "src/decidim/map/controller/static"
|
|
3
5
|
import MapDragMarkerController from "src/decidim/map/controller/drag_marker"
|
|
@@ -22,7 +24,8 @@ import MapDragMarkerController from "src/decidim/map/controller/drag_marker"
|
|
|
22
24
|
* window.Decidim.createMapController = (mapId, config) => {
|
|
23
25
|
* if (config.type === "custom") {
|
|
24
26
|
* // Obviously you need to implement CustomMapController for this to
|
|
25
|
-
* // work.
|
|
27
|
+
* // work. You can find an example at:
|
|
28
|
+
* // decidim-dev/app/packs/src/decidim/dev/test/custom_map_factory.js
|
|
26
29
|
* return new window.Decidim.CustomMapController(mapId, config);
|
|
27
30
|
* }
|
|
28
31
|
*
|
|
@@ -11,15 +11,15 @@ module Decidim
|
|
|
11
11
|
private
|
|
12
12
|
|
|
13
13
|
def query
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
@query ||= Decidim::User.where(organization: @organization)
|
|
15
|
+
.where("deleted_at IS NULL OR deleted_at > ?", end_time)
|
|
16
|
+
.where("blocked_at IS NULL OR blocked_at > ?", end_time)
|
|
17
|
+
.confirmed
|
|
18
|
+
.where("created_at <= ?", end_time)
|
|
19
19
|
end
|
|
20
20
|
|
|
21
21
|
def quantity
|
|
22
|
-
@quantity ||=
|
|
22
|
+
@quantity ||= query.where("created_at >= ?", start_time).count
|
|
23
23
|
end
|
|
24
24
|
end
|
|
25
25
|
end
|
|
@@ -0,0 +1,231 @@
|
|
|
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 %>
|
|
File without changes
|