decidim-core 0.0.8.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/config/decidim_core_manifest.js +0 -1
- data/app/assets/javascripts/decidim/form_filter.component.js.es6 +12 -2
- data/app/assets/stylesheets/decidim/_decidim.scss +1 -2
- data/app/assets/stylesheets/decidim/extras/_embed.scss +21 -0
- data/app/assets/stylesheets/decidim/modules/_cards.scss +1 -1
- data/app/assets/stylesheets/decidim/modules/_icons.scss +1 -1
- data/app/commands/decidim/create_registration.rb +1 -1
- data/app/commands/decidim/invite_user.rb +7 -8
- data/app/controllers/concerns/decidim/filter_resource.rb +2 -3
- data/app/controllers/concerns/decidim/payload_info.rb +1 -1
- data/app/controllers/decidim/authorizations_controller.rb +0 -4
- data/app/controllers/decidim/pages_controller.rb +8 -11
- data/app/controllers/decidim/participatory_process_groups_controller.rb +1 -1
- data/app/controllers/decidim/participatory_process_widgets_controller.rb +4 -0
- data/app/controllers/decidim/widgets_controller.rb +7 -3
- data/app/forms/decidim/registration_form.rb +4 -4
- data/app/helpers/decidim/layout_helper.rb +1 -1
- data/app/helpers/decidim/map_helper.rb +21 -21
- data/app/helpers/decidim/resource_helper.rb +4 -4
- data/app/helpers/decidim/widget_urls_helper.rb +2 -2
- data/app/mailers/decidim/export_mailer.rb +29 -0
- data/app/middleware/decidim/current_organization.rb +1 -1
- data/app/models/decidim/feature.rb +5 -0
- data/app/models/decidim/organization.rb +1 -1
- data/app/models/decidim/participatory_process.rb +1 -1
- data/app/models/decidim/user.rb +1 -1
- data/app/presenters/decidim/home_stats_presenter.rb +74 -0
- data/app/queries/decidim/stats_users_count.rb +24 -0
- data/app/services/decidim/public_processes.rb +4 -2
- data/app/services/decidim/resource_search.rb +1 -1
- data/app/services/decidim/static_map_generator.rb +1 -3
- data/app/uploaders/decidim/image_uploader.rb +1 -1
- data/app/views/decidim/export_mailer/export.html.erb +1 -0
- data/app/views/decidim/participatory_process_widgets/show.html.erb +16 -27
- data/app/views/decidim/participatory_processes/show.html.erb +7 -7
- data/app/views/decidim/widgets/show.js.erb +27 -17
- data/app/views/layouts/decidim/widget.html.erb +55 -3
- data/app/views/pages/home/_statistics.html.erb +2 -10
- data/config/i18n-tasks.yml +1 -0
- data/config/initializers/devise.rb +11 -4
- data/config/locales/ca.yml +14 -3
- data/config/locales/en.yml +14 -3
- data/config/locales/es.yml +13 -2
- data/config/locales/eu.yml +0 -2
- data/config/locales/fi.yml +0 -2
- data/config/locales/fr.yml +386 -1
- data/config/locales/nl.yml +1 -3
- data/db/seeds.rb +1 -1
- data/lib/decidim/core.rb +10 -2
- data/lib/decidim/core/api/decidim_type.rb +4 -0
- data/lib/decidim/core/api/translated_field_type.rb +2 -2
- data/lib/decidim/core/engine.rb +13 -0
- data/lib/decidim/core/test/shared_examples/comments_examples.rb +16 -18
- data/lib/decidim/core/test/shared_examples/manage_moderations_examples.rb +2 -2
- data/lib/decidim/core/test/shared_examples/reports_examples.rb +9 -9
- data/lib/decidim/core/version.rb +1 -1
- data/lib/decidim/exporters.rb +9 -0
- data/lib/decidim/exporters/csv.rb +54 -0
- data/lib/decidim/exporters/export_data.rb +22 -0
- data/lib/decidim/exporters/exporter.rb +28 -0
- data/lib/decidim/exporters/json.rb +22 -0
- data/lib/decidim/feature_manifest.rb +18 -0
- data/lib/decidim/file_zipper.rb +28 -0
- data/lib/decidim/form_builder.rb +27 -14
- data/lib/decidim/has_reference.rb +1 -1
- data/lib/decidim/i18n_exceptions.rb +3 -2
- data/lib/decidim/query_extensions.rb +1 -1
- data/lib/decidim/reportable.rb +1 -1
- data/lib/decidim/resource_manifest.rb +0 -7
- data/lib/decidim/stats_registry.rb +110 -0
- data/vendor/assets/javascripts/form_datepicker.js.es6 +3 -1
- metadata +53 -29
- data/app/assets/stylesheets/decidim/widget.scss.erb +0 -25
@@ -4,7 +4,7 @@ module Decidim
|
|
4
4
|
# installation we can find many organizations and each of them can start
|
5
5
|
# their own participatory processes.
|
6
6
|
class Organization < ApplicationRecord
|
7
|
-
SOCIAL_HANDLERS = [:twitter, :facebook, :instagram, :youtube, :github]
|
7
|
+
SOCIAL_HANDLERS = [:twitter, :facebook, :instagram, :youtube, :github].freeze
|
8
8
|
|
9
9
|
has_many :participatory_process_groups, foreign_key: "decidim_organization_id", class_name: Decidim::ParticipatoryProcessGroup, inverse_of: :organization
|
10
10
|
has_many :participatory_processes, foreign_key: "decidim_organization_id", class_name: Decidim::ParticipatoryProcess, inverse_of: :organization
|
data/app/models/decidim/user.rb
CHANGED
@@ -9,7 +9,7 @@ module Decidim
|
|
9
9
|
devise :invitable, :database_authenticatable, :registerable, :confirmable,
|
10
10
|
:recoverable, :rememberable, :trackable, :decidim_validatable,
|
11
11
|
:omniauthable, omniauth_providers: [:facebook, :twitter, :google_oauth2],
|
12
|
-
|
12
|
+
request_keys: [:env], reset_password_keys: [:decidim_organization_id, :email]
|
13
13
|
|
14
14
|
belongs_to :organization, foreign_key: "decidim_organization_id", class_name: Decidim::Organization
|
15
15
|
has_many :authorizations, foreign_key: "decidim_user_id", class_name: Decidim::Authorization, inverse_of: :user
|
@@ -0,0 +1,74 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module Decidim
|
3
|
+
# A presenter to render statistics in the homepage.
|
4
|
+
class HomeStatsPresenter < Rectify::Presenter
|
5
|
+
attribute :organization, Decidim::Organization
|
6
|
+
|
7
|
+
# Public: Render a collection of primary stats.
|
8
|
+
def highlighted
|
9
|
+
highlighted_stats = Decidim.stats.only([:users_count, :processes_count]).with_context(organization).map { |name, data| [name, data] }
|
10
|
+
highlighted_stats = highlighted_stats.concat(global_stats(priority: StatsRegistry::HIGH_PRIORITY))
|
11
|
+
highlighted_stats = highlighted_stats.concat(feature_stats(priority: StatsRegistry::HIGH_PRIORITY))
|
12
|
+
highlighted_stats = highlighted_stats.reject(&:empty?)
|
13
|
+
|
14
|
+
safe_join(
|
15
|
+
highlighted_stats.in_groups_of(2, false).map do |stats|
|
16
|
+
content_tag :div, class: "home-pam__highlight" do
|
17
|
+
safe_join(
|
18
|
+
stats.map do |name, data|
|
19
|
+
render_stats_data(name, data)
|
20
|
+
end
|
21
|
+
)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
)
|
25
|
+
end
|
26
|
+
|
27
|
+
# Public: Render a collection of stats that are not primary.
|
28
|
+
def not_highlighted
|
29
|
+
not_highlighted_stats = global_stats(priority: StatsRegistry::MEDIUM_PRIORITY)
|
30
|
+
not_highlighted_stats = not_highlighted_stats.concat(feature_stats(priority: StatsRegistry::MEDIUM_PRIORITY))
|
31
|
+
not_highlighted_stats = not_highlighted_stats.reject(&:empty?)
|
32
|
+
|
33
|
+
safe_join(
|
34
|
+
not_highlighted_stats.in_groups_of(3, false).map do |stats|
|
35
|
+
content_tag :div, class: "home-pam__lowlight" do
|
36
|
+
safe_join(
|
37
|
+
stats.map do |name, data|
|
38
|
+
render_stats_data(name, data)
|
39
|
+
end
|
40
|
+
)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
)
|
44
|
+
end
|
45
|
+
|
46
|
+
private
|
47
|
+
|
48
|
+
def global_stats(conditions)
|
49
|
+
Decidim.stats.except([:users_count, :processes_count])
|
50
|
+
.filter(conditions)
|
51
|
+
.with_context(published_features)
|
52
|
+
.map { |name, data| [name, data] }
|
53
|
+
end
|
54
|
+
|
55
|
+
def feature_stats(conditions)
|
56
|
+
Decidim.feature_manifests.map do |feature|
|
57
|
+
feature.stats.filter(conditions).with_context(published_features).map { |name, data| [name, data] }.flatten
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
def render_stats_data(name, data)
|
62
|
+
content_tag :div, "", class: "home-pam__data" do
|
63
|
+
safe_join([
|
64
|
+
content_tag(:h4, I18n.t(name, scope: "pages.home.statistics"), class: "home-pam__title"),
|
65
|
+
content_tag(:span, " #{data}", class: "home-pam__number #{name}")
|
66
|
+
])
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
def published_features
|
71
|
+
@published_features ||= Feature.where(participatory_process: organization.participatory_processes.published)
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module Decidim
|
3
|
+
# This query counts registered users from a collection of organizations
|
4
|
+
# in an optional interval of time.
|
5
|
+
class StatsUsersCount < Rectify::Query
|
6
|
+
def self.for(organization, start_at = nil, end_at = nil)
|
7
|
+
new(organization, start_at, end_at).query
|
8
|
+
end
|
9
|
+
|
10
|
+
def initialize(organization, start_at = nil, end_at = nil)
|
11
|
+
@organization = organization
|
12
|
+
@start_at = start_at
|
13
|
+
@end_at = end_at
|
14
|
+
end
|
15
|
+
|
16
|
+
def query
|
17
|
+
users = Decidim::User.where(organization: @organization)
|
18
|
+
users = users.where("created_at >= ?", @start_at) if @start_at.present?
|
19
|
+
users = users.where("created_at <= ?", @end_at) if @end_at.present?
|
20
|
+
users = users.where.not(confirmed_at: nil)
|
21
|
+
users.count
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -3,7 +3,6 @@ module Decidim
|
|
3
3
|
# This service is in charge of gathering the ParticipatoryProcess and
|
4
4
|
# ParticipatoryProcessGroup that are public and should be displayed together.
|
5
5
|
class PublicProcesses
|
6
|
-
|
7
6
|
# Initializes the PublicProcesses
|
8
7
|
#
|
9
8
|
# organization - The current organization
|
@@ -32,7 +31,10 @@ module Decidim
|
|
32
31
|
attr_reader :organization
|
33
32
|
|
34
33
|
def ordered_processes
|
35
|
-
@sorted_processes ||= Decidim::ParticipatoryProcess.where(organization: organization)
|
34
|
+
@sorted_processes ||= Decidim::ParticipatoryProcess.where(organization: organization)
|
35
|
+
.order("promoted DESC")
|
36
|
+
.includes(:active_step)
|
37
|
+
.order("decidim_participatory_process_steps.end_date ASC")
|
36
38
|
end
|
37
39
|
|
38
40
|
def participatory_process_groups
|
@@ -40,7 +40,7 @@ module Decidim
|
|
40
40
|
# `Decidim::OrganizationScopesHelper`, to render the collection needed for the
|
41
41
|
# `collection_check_boxes` form method.
|
42
42
|
def search_scope_id
|
43
|
-
clean_scope_ids = [scope_id].flatten.map{ |id| id == "global" ? nil : id }
|
43
|
+
clean_scope_ids = [scope_id].flatten.map { |id| id == "global" ? nil : id }
|
44
44
|
query.where(decidim_scope_id: clean_scope_ids)
|
45
45
|
end
|
46
46
|
|
@@ -35,11 +35,9 @@ module Decidim
|
|
35
35
|
app_code: Decidim.geocoder.fetch(:here_app_code)
|
36
36
|
}
|
37
37
|
|
38
|
-
|
38
|
+
URI.parse(Decidim.geocoder.fetch(:static_map_url)).tap do |uri|
|
39
39
|
uri.query = URI.encode_www_form params
|
40
40
|
end
|
41
|
-
|
42
|
-
uri
|
43
41
|
end
|
44
42
|
|
45
43
|
def organization
|
@@ -27,7 +27,7 @@ module Decidim
|
|
27
27
|
|
28
28
|
def validate_size
|
29
29
|
manipulate! do |image|
|
30
|
-
validation_error!(I18n.t("carrierwave.errors.image_too_big")) if image.size >
|
30
|
+
validation_error!(I18n.t("carrierwave.errors.image_too_big")) if image.size > Decidim.maximum_attachment_size
|
31
31
|
image
|
32
32
|
end
|
33
33
|
end
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= t(".ready") %>
|
@@ -1,28 +1,17 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
<% content_for(:header, "false") %>
|
2
|
+
<% content_for(:title, translated_attribute(model.title)) %>
|
3
|
+
<p class="card__desc"><%== html_truncate(translated_attribute(model.short_description), length: 630, separator: '...') %></p>
|
4
|
+
<% content_for(:footer) do %>
|
5
|
+
<div class="card__support">
|
6
|
+
<% if model.active_step %>
|
7
|
+
<span class="card--process__small">
|
8
|
+
<%= t(".active_step", scope: "layouts") %>
|
9
|
+
<strong><%= translated_attribute model.active_step.title %></strong>
|
10
|
+
</span>
|
6
11
|
<% end %>
|
7
|
-
<
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
<div class="card__footer">
|
14
|
-
<div class="card__support">
|
15
|
-
<% if model.active_step %>
|
16
|
-
<span class="card--process__small">
|
17
|
-
<%= t(".active_step", scope: "layouts") %>
|
18
|
-
<strong><%= translated_attribute model.active_step.title %></strong>
|
19
|
-
</span>
|
20
|
-
<% end %>
|
21
|
-
<span class="card--process__small"></span>
|
22
|
-
<%= link_to participatory_process_path(model), class: "card__button button small" do %>
|
23
|
-
<%= t(".take_part", scope: "layouts") %>
|
24
|
-
<% end %>
|
25
|
-
</div>
|
26
|
-
</div>
|
27
|
-
</article>
|
28
|
-
</div>
|
12
|
+
<span class="card--process__small"></span>
|
13
|
+
<%= link_to participatory_process_path(model), class: "card__button button small" do %>
|
14
|
+
<%= t(".take_part", scope: "layouts") %>
|
15
|
+
<% end %>
|
16
|
+
</div>
|
17
|
+
<% end %>
|
@@ -20,49 +20,49 @@
|
|
20
20
|
<div class="card extra definition-data">
|
21
21
|
<% if translated_attribute(current_participatory_process.meta_scope).present? %>
|
22
22
|
<div class="definition-data__item scope">
|
23
|
-
<span class="definition-data__title"><%= t(".scope")
|
23
|
+
<span class="definition-data__title"><%= t(".scope") %></span>
|
24
24
|
<%== translated_attribute(current_participatory_process.meta_scope) %>
|
25
25
|
</div>
|
26
26
|
<% end %>
|
27
27
|
|
28
28
|
<% if current_participatory_process.end_date.present? %>
|
29
29
|
<div class="definition-data__item end-date">
|
30
|
-
<span class="definition-data__title"><%= t(".end_date")
|
30
|
+
<span class="definition-data__title"><%= t(".end_date") %></span>
|
31
31
|
<%== l(current_participatory_process.end_date, format: :long) %>
|
32
32
|
</div>
|
33
33
|
<% end %>
|
34
34
|
|
35
35
|
<% if translated_attribute(current_participatory_process.developer_group).present? %>
|
36
36
|
<div class="definition-data__item developer-group">
|
37
|
-
<span class="definition-data__title"><%= t(".developer_group")
|
37
|
+
<span class="definition-data__title"><%= t(".developer_group") %></span>
|
38
38
|
<%== translated_attribute(current_participatory_process.developer_group) %>
|
39
39
|
</div>
|
40
40
|
<% end %>
|
41
41
|
|
42
42
|
<% if translated_attribute(current_participatory_process.local_area).present? %>
|
43
43
|
<div class="definition-data__item local_area">
|
44
|
-
<span class="definition-data__title"><%= t(".local_area")
|
44
|
+
<span class="definition-data__title"><%= t(".local_area") %></span>
|
45
45
|
<%== translated_attribute(current_participatory_process.local_area) %>
|
46
46
|
</div>
|
47
47
|
<% end %>
|
48
48
|
|
49
49
|
<% if translated_attribute(current_participatory_process.target).present? %>
|
50
50
|
<div class="definition-data__item target">
|
51
|
-
<span class="definition-data__title"><%= t(".target")
|
51
|
+
<span class="definition-data__title"><%= t(".target") %></span>
|
52
52
|
<%== translated_attribute(current_participatory_process.target) %>
|
53
53
|
</div>
|
54
54
|
<% end %>
|
55
55
|
|
56
56
|
<% if translated_attribute(current_participatory_process.participatory_scope).present? %>
|
57
57
|
<div class="definition-data__item participatory_scope">
|
58
|
-
<span class="definition-data__title"><%= t(".participatory_scope")
|
58
|
+
<span class="definition-data__title"><%= t(".participatory_scope") %></span>
|
59
59
|
<%== translated_attribute(current_participatory_process.participatory_scope) %>
|
60
60
|
</div>
|
61
61
|
<% end %>
|
62
62
|
|
63
63
|
<% if translated_attribute(current_participatory_process.participatory_structure).present? %>
|
64
64
|
<div class="definition-data__item participatory_structure">
|
65
|
-
<span class="definition-data__title"><%= t(".participatory_structure")
|
65
|
+
<span class="definition-data__title"><%= t(".participatory_structure") %></span>
|
66
66
|
<%== translated_attribute(current_participatory_process.participatory_structure) %>
|
67
67
|
</div>
|
68
68
|
<% end %>
|
@@ -1,22 +1,32 @@
|
|
1
1
|
/* eslint-disable no-var, prefer-template */
|
2
|
-
|
2
|
+
(function () {
|
3
|
+
var iframe = document.createElement('iframe');
|
4
|
+
var scripts = document.getElementsByTagName('script');
|
5
|
+
var me = null;
|
3
6
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
iframe.
|
11
|
-
|
7
|
+
if (document.currentScript) {
|
8
|
+
me = document.currentScript;
|
9
|
+
} else {
|
10
|
+
me = scripts[scripts.length - 1];
|
11
|
+
}
|
12
|
+
|
13
|
+
iframe.src = "<%= iframe_url %>";
|
14
|
+
iframe.frameBorder = "0"
|
15
|
+
iframe.scrolling = "no";
|
16
|
+
iframe.style.visibility = 'hidden';
|
17
|
+
iframe.style.height = "10px";
|
18
|
+
iframe.onload = function () {
|
19
|
+
iframe.contentWindow.postMessage({ type: "GET_HEIGHT" }, "*");
|
20
|
+
}
|
12
21
|
|
13
|
-
|
22
|
+
me.insertAdjacentElement('afterend', iframe);
|
14
23
|
|
15
|
-
window.addEventListener("message", function (event) {
|
16
|
-
|
24
|
+
window.addEventListener("message", function (event) {
|
25
|
+
var height = event.data.height;
|
17
26
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
});
|
27
|
+
if (event.data.type === "SET_HEIGHT") {
|
28
|
+
iframe.style.height = height + "px";
|
29
|
+
iframe.style.visibility = 'visible';
|
30
|
+
}
|
31
|
+
});
|
32
|
+
}());
|
@@ -3,15 +3,67 @@
|
|
3
3
|
<head>
|
4
4
|
<title><%= decidim_page_title %></title>
|
5
5
|
<%= csrf_meta_tags %>
|
6
|
-
<%= stylesheet_link_tag '
|
6
|
+
<%= stylesheet_link_tag 'application' %>
|
7
7
|
<%= javascript_include_tag 'application' %>
|
8
8
|
</head>
|
9
9
|
|
10
|
-
<body>
|
11
|
-
|
10
|
+
<body class="widget">
|
11
|
+
<% if content_for(:header) == "false" %>
|
12
|
+
<% elsif content_for?(:header) %>
|
13
|
+
<%= content_for(:header) %>
|
14
|
+
<% else %>
|
15
|
+
<div class="participatory-process">
|
16
|
+
<%= link_to translated_attribute(current_participatory_process.title), decidim.participatory_process_path(current_participatory_process), target: "_blank" %>
|
17
|
+
</div>
|
18
|
+
<% end %>
|
19
|
+
<div class="row collapse">
|
20
|
+
<div class="column">
|
21
|
+
|
22
|
+
<article class="card">
|
23
|
+
<% if current_participatory_process.banner_image %>
|
24
|
+
<div class="card__image-top" style="background-image: url(<%= current_participatory_process.banner_image.url %>)"></div>
|
25
|
+
<% end %>
|
26
|
+
|
27
|
+
<div class="card__content">
|
28
|
+
<div class="card__header">
|
29
|
+
<%= link_to model do%>
|
30
|
+
<h5 class="card__title"><%= content_for(:title) %></h5>
|
31
|
+
<% end %>
|
32
|
+
<% if model.try(:author) %>
|
33
|
+
<div class="card__author author-data author-data--small">
|
34
|
+
<div class="author-data__main">
|
35
|
+
<div class="author author--inline">
|
36
|
+
<span class="author__avatar author__avatar--small">
|
37
|
+
<%= image_tag model.author_avatar_url %>
|
38
|
+
</span>
|
39
|
+
<span class="author__name"><%= model.author_name %></span>
|
40
|
+
<%= l model.created_at, format: "%d/%m/%Y" %>
|
41
|
+
</div>
|
42
|
+
</div>
|
43
|
+
</div>
|
44
|
+
<% end %>
|
45
|
+
</div>
|
46
|
+
<%= yield %>
|
47
|
+
</div>
|
48
|
+
<div class="card__footer">
|
49
|
+
<% if content_for?(:footer) %>
|
50
|
+
<%= content_for(:footer) %>
|
51
|
+
<% else %>
|
52
|
+
<div class="card__support">
|
53
|
+
<div class="card__support__data"></div>
|
54
|
+
<%= link_to model, class: "card__button button small", target: "_blank" do %>
|
55
|
+
<%= t('.see_more') %>
|
56
|
+
<% end %>
|
57
|
+
</div>
|
58
|
+
<% end %>
|
59
|
+
</div>
|
60
|
+
</article>
|
61
|
+
</div>
|
62
|
+
</div>
|
12
63
|
<div class="organization">
|
13
64
|
<%= render partial: "layouts/decidim/logo", locals: { organization: current_organization } %>
|
14
65
|
</div>
|
66
|
+
|
15
67
|
<%= javascript_include_tag 'decidim/widget' %>
|
16
68
|
</body>
|
17
69
|
</html>
|
@@ -6,16 +6,8 @@
|
|
6
6
|
<div class="row">
|
7
7
|
<div class="columns small-centered mediumlarge-10 large-8">
|
8
8
|
<div class="home-pam">
|
9
|
-
|
10
|
-
|
11
|
-
<h4 class="home-pam__title"><%= t(".users") %></h4>
|
12
|
-
<span class="home-pam__number users-count"><%= users.count %></span>
|
13
|
-
</div>
|
14
|
-
<div class="home-pam__data">
|
15
|
-
<h4 class="home-pam__title"><%= t(".processes") %></h4>
|
16
|
-
<span class="home-pam__number processes-count"><%= participatory_processes.count %></span>
|
17
|
-
</div>
|
18
|
-
</div>
|
9
|
+
<%= stats.highlighted %>
|
10
|
+
<%= stats.not_highlighted %>
|
19
11
|
</div>
|
20
12
|
</div>
|
21
13
|
</div>
|
data/config/i18n-tasks.yml
CHANGED
@@ -104,6 +104,7 @@ ignore_unused:
|
|
104
104
|
- invisible_captcha.*
|
105
105
|
- decidim.participatory_processes.scopes.global
|
106
106
|
- decidim.participatory_processes.participatory_process_groups.none
|
107
|
+
- pages.home.statistics.*
|
107
108
|
# - 'activerecord.attributes.*'
|
108
109
|
# - '{devise,kaminari,will_paginate}.*'
|
109
110
|
# - 'simple_form.{yes,no}'
|
@@ -1,5 +1,4 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
# rubocop:disable Metrics/BlockLength
|
3
2
|
# Use this hook to configure devise mailer, warden hooks and so forth.
|
4
3
|
# Many of these configuration options can be set straight in your model.
|
5
4
|
|
@@ -301,13 +300,21 @@ Devise.setup do |config|
|
|
301
300
|
# Add a new OmniAuth provider. Check the wiki for more information on setting
|
302
301
|
# up on your models and hooks.
|
303
302
|
if Rails.application.secrets.dig(:omniauth, "facebook").present?
|
304
|
-
config.omniauth :facebook,
|
303
|
+
config.omniauth :facebook,
|
304
|
+
Rails.application.secrets.omniauth["facebook"]["app_id"],
|
305
|
+
Rails.application.secrets.omniauth["facebook"]["app_secret"],
|
306
|
+
scope: :email,
|
307
|
+
info_fields: "name,email,verified"
|
305
308
|
end
|
306
309
|
if Rails.application.secrets.dig(:omniauth, "twitter").present?
|
307
|
-
config.omniauth :twitter,
|
310
|
+
config.omniauth :twitter,
|
311
|
+
Rails.application.secrets.omniauth["twitter"]["api_key"],
|
312
|
+
Rails.application.secrets.omniauth["twitter"]["api_secret"]
|
308
313
|
end
|
309
314
|
if Rails.application.secrets.dig(:omniauth, "google_oauth2").present?
|
310
|
-
config.omniauth :google_oauth2,
|
315
|
+
config.omniauth :google_oauth2,
|
316
|
+
Rails.application.secrets.omniauth["google_oauth2"]["client_id"],
|
317
|
+
Rails.application.secrets.omniauth["google_oauth2"]["client_secret"]
|
311
318
|
end
|
312
319
|
|
313
320
|
# ==> Warden configuration
|