decidim-core 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +1 -0
- data/app/assets/stylesheets/decidim/modules/_modules.scss +1 -0
- data/app/assets/stylesheets/decidim/modules/_navbar.scss +3 -3
- data/app/assets/stylesheets/decidim/modules/_pagination.scss +5 -0
- data/app/commands/decidim/authorize_user.rb +1 -0
- data/app/commands/decidim/create_omniauth_registration.rb +1 -0
- data/app/commands/decidim/create_registration.rb +1 -0
- data/app/commands/decidim/create_report.rb +1 -0
- data/app/commands/decidim/invite_user.rb +1 -0
- data/app/commands/decidim/invite_user_again.rb +1 -0
- data/app/commands/decidim/remove_user_role.rb +1 -0
- data/app/commands/decidim/update_account.rb +1 -0
- data/app/commands/decidim/update_notifications_settings.rb +1 -0
- data/app/constraints/decidim/current_feature.rb +1 -0
- data/app/controllers/concerns/decidim/action_authorization.rb +1 -0
- data/app/controllers/concerns/decidim/devise_controllers.rb +3 -0
- data/app/controllers/concerns/decidim/feature_settings.rb +1 -0
- data/app/controllers/concerns/decidim/filter_resource.rb +1 -0
- data/app/controllers/concerns/decidim/needs_organization.rb +1 -1
- data/app/controllers/concerns/decidim/user_profile.rb +1 -0
- data/app/controllers/decidim/account_controller.rb +1 -0
- data/app/controllers/decidim/application_controller.rb +2 -0
- data/app/controllers/decidim/authorizations_controller.rb +1 -0
- data/app/controllers/decidim/cookie_policy_controller.rb +1 -0
- data/app/controllers/decidim/devise/confirmations_controller.rb +1 -0
- data/app/controllers/decidim/devise/invitations_controller.rb +1 -0
- data/app/controllers/decidim/devise/omniauth_registrations_controller.rb +1 -0
- data/app/controllers/decidim/devise/passwords_controller.rb +1 -0
- data/app/controllers/decidim/devise/registrations_controller.rb +1 -0
- data/app/controllers/decidim/devise/sessions_controller.rb +2 -1
- data/app/controllers/decidim/locales_controller.rb +1 -0
- data/app/controllers/decidim/notifications_settings_controller.rb +1 -0
- data/app/controllers/decidim/own_user_groups_controller.rb +1 -0
- data/app/controllers/decidim/pages_controller.rb +2 -1
- data/app/controllers/decidim/participatory_process_groups_controller.rb +1 -0
- data/app/controllers/decidim/participatory_process_steps_controller.rb +1 -0
- data/app/controllers/decidim/participatory_processes_controller.rb +6 -5
- data/app/controllers/decidim/static_map_controller.rb +1 -0
- data/app/forms/decidim/form.rb +1 -0
- data/app/forms/decidim/report_form.rb +1 -0
- data/app/helpers/decidim/action_authorization_helper.rb +1 -1
- data/app/helpers/decidim/application_helper.rb +1 -1
- data/app/helpers/decidim/aria_selected_link_to_helper.rb +1 -0
- data/app/helpers/decidim/attachments_helper.rb +1 -0
- data/app/helpers/decidim/authorization_form_helper.rb +1 -0
- data/app/helpers/decidim/cookies_helper.rb +1 -1
- data/app/helpers/decidim/decidim_form_helper.rb +1 -0
- data/app/helpers/decidim/feature_reference_helper.rb +1 -0
- data/app/helpers/decidim/filters_helper.rb +1 -0
- data/app/helpers/decidim/humanize_booleans_helper.rb +1 -0
- data/app/helpers/decidim/language_chooser_helper.rb +1 -0
- data/app/helpers/decidim/layout_helper.rb +1 -0
- data/app/helpers/decidim/localized_locales_helper.rb +1 -0
- data/app/helpers/decidim/map_helper.rb +1 -0
- data/app/helpers/decidim/menu_helper.rb +16 -0
- data/app/helpers/decidim/meta_tags_helper.rb +1 -0
- data/app/helpers/decidim/omniauth_helper.rb +1 -0
- data/app/helpers/decidim/orders_helper.rb +1 -0
- data/app/helpers/decidim/organization_scopes_helper.rb +1 -0
- data/app/helpers/decidim/paginate_helper.rb +1 -0
- data/app/helpers/decidim/participatory_process_helper.rb +1 -0
- data/app/helpers/decidim/participatory_process_steps_helper.rb +1 -0
- data/app/helpers/decidim/replace_buttons_helper.rb +1 -0
- data/app/helpers/decidim/resource_helper.rb +1 -0
- data/app/helpers/decidim/translations_helper.rb +1 -0
- data/app/helpers/decidim/user_profile_helper.rb +1 -0
- data/app/helpers/decidim/widget_urls_helper.rb +1 -0
- data/app/jobs/decidim/application_job.rb +1 -0
- data/app/jobs/decidim/export_job.rb +22 -0
- data/app/mailers/decidim/application_mailer.rb +1 -0
- data/app/mailers/decidim/decidim_devise_mailer.rb +2 -1
- data/app/mailers/decidim/export_mailer.rb +1 -0
- data/app/mailers/decidim/newsletter_mailer.rb +1 -0
- data/app/mailers/decidim/reported_mailer.rb +1 -0
- data/app/middleware/decidim/current_organization.rb +1 -0
- data/app/models/decidim/abilities/everyone.rb +1 -0
- data/app/models/decidim/ability.rb +1 -0
- data/app/models/decidim/application_record.rb +1 -0
- data/app/models/decidim/attachment.rb +1 -0
- data/app/models/decidim/authorization.rb +2 -1
- data/app/models/decidim/category.rb +4 -3
- data/app/models/decidim/component.rb +1 -0
- data/app/models/decidim/feature.rb +1 -0
- data/app/models/decidim/identity.rb +2 -2
- data/app/models/decidim/moderation.rb +2 -1
- data/app/models/decidim/newsletter.rb +2 -1
- data/app/models/decidim/organization.rb +7 -6
- data/app/models/decidim/participatory_process.rb +7 -20
- data/app/models/decidim/participatory_process_group.rb +3 -2
- data/app/models/decidim/participatory_process_step.rb +2 -1
- data/app/models/decidim/report.rb +3 -2
- data/app/models/decidim/resource_link.rb +1 -0
- data/app/models/decidim/scope.rb +2 -1
- data/app/models/decidim/static_page.rb +2 -1
- data/app/models/decidim/user.rb +6 -5
- data/app/models/decidim/user_group.rb +23 -7
- data/app/models/decidim/user_group_membership.rb +2 -2
- data/app/presenters/decidim/home_stats_presenter.rb +2 -1
- data/app/presenters/decidim/menu_item_presenter.rb +57 -0
- data/app/presenters/decidim/menu_presenter.rb +47 -0
- data/app/queries/decidim/highlighted_participatory_processes.rb +1 -0
- data/app/queries/decidim/organization_participatory_processes.rb +1 -0
- data/app/queries/decidim/organization_prioritized_participatory_processes.rb +18 -0
- data/app/queries/decidim/{public_participatory_processes.rb → prioritized_participatory_processes.rb} +4 -3
- data/app/queries/decidim/promoted_participatory_processes.rb +1 -0
- data/app/queries/decidim/stats_users_count.rb +1 -0
- data/app/services/decidim/action_authorizer.rb +1 -0
- data/app/services/decidim/authorization_handler.rb +1 -0
- data/app/services/decidim/resource_search.rb +1 -0
- data/app/services/decidim/static_map_generator.rb +1 -0
- data/app/uploaders/decidim/application_uploader.rb +1 -0
- data/app/uploaders/decidim/banner_image_uploader.rb +1 -0
- data/app/uploaders/decidim/hero_image_uploader.rb +1 -0
- data/app/uploaders/decidim/homepage_image_uploader.rb +1 -0
- data/app/uploaders/decidim/image_uploader.rb +1 -0
- data/app/uploaders/decidim/official_image_footer_uploader.rb +1 -0
- data/app/uploaders/decidim/official_image_header_uploader.rb +1 -0
- data/app/uploaders/decidim/organization_favicon_uploader.rb +1 -0
- data/app/uploaders/decidim/organization_logo_uploader.rb +1 -0
- data/app/validators/etiquette_validator.rb +3 -3
- data/app/validators/geocoding_validator.rb +1 -1
- data/app/views/decidim/own_user_groups/index.html.erb +8 -6
- data/app/views/decidim/participatory_processes/index.html.erb +1 -1
- data/app/views/decidim/shared/_orders.html.erb +4 -3
- data/app/views/layouts/decidim/_language_chooser.html.erb +1 -1
- data/app/views/layouts/decidim/_wrapper.html.erb +2 -2
- data/config/i18n-tasks.yml +5 -5
- data/config/initializers/devise.rb +1 -0
- data/config/initializers/foundation_rails_helper.rb +1 -0
- data/config/initializers/invisible_captcha.rb +1 -0
- data/config/initializers/mail_previews.rb +1 -0
- data/config/locales/ca.yml +3 -2
- data/config/locales/en.yml +3 -2
- data/config/locales/es.yml +4 -3
- data/config/locales/eu.yml +23 -1
- data/config/locales/fi.yml +0 -1
- data/config/locales/fr.yml +1 -2
- data/config/locales/nl.yml +0 -1
- data/config/routes.rb +1 -0
- data/db/migrate/20170529150743_add_rejected_at_to_user_groups.rb +5 -0
- data/db/seeds.rb +1 -0
- data/lib/decidim/attributes.rb +1 -0
- data/lib/decidim/attributes/time_with_zone.rb +1 -0
- data/lib/decidim/authorable.rb +1 -0
- data/lib/decidim/authorization_form_builder.rb +1 -0
- data/lib/decidim/core.rb +13 -0
- data/lib/decidim/core/api.rb +1 -0
- data/lib/decidim/core/api/author_interface.rb +1 -0
- data/lib/decidim/core/api/decidim_type.rb +1 -0
- data/lib/decidim/core/api/localized_string_type.rb +1 -0
- data/lib/decidim/core/api/process_step_type.rb +1 -0
- data/lib/decidim/core/api/process_type.rb +1 -0
- data/lib/decidim/core/api/session_type.rb +1 -0
- data/lib/decidim/core/api/translated_field_type.rb +1 -0
- data/lib/decidim/core/api/user_group_type.rb +1 -0
- data/lib/decidim/core/api/user_type.rb +1 -0
- data/lib/decidim/core/engine.rb +21 -1
- data/lib/decidim/core/test.rb +1 -0
- data/lib/decidim/core/test/factories.rb +9 -1
- data/lib/decidim/core/test/shared_examples/authorable.rb +1 -0
- data/lib/decidim/core/test/shared_examples/comments_examples.rb +1 -0
- data/lib/decidim/core/test/shared_examples/has_attachments.rb +1 -0
- data/lib/decidim/core/test/shared_examples/has_category.rb +1 -0
- data/lib/decidim/core/test/shared_examples/has_feature.rb +1 -0
- data/lib/decidim/core/test/shared_examples/has_reference.rb +1 -0
- data/lib/decidim/core/test/shared_examples/has_scope.rb +1 -0
- data/lib/decidim/core/test/shared_examples/localised_email.rb +1 -0
- data/lib/decidim/core/test/shared_examples/manage_moderations_examples.rb +1 -0
- data/lib/decidim/core/test/shared_examples/reportable.rb +1 -0
- data/lib/decidim/core/test/shared_examples/reports_examples.rb +1 -0
- data/lib/decidim/core/version.rb +2 -1
- data/lib/decidim/devise_failure_app.rb +0 -1
- data/lib/decidim/exporters.rb +2 -0
- data/lib/decidim/exporters/csv.rb +1 -0
- data/lib/decidim/exporters/export_data.rb +1 -0
- data/lib/decidim/exporters/exporter.rb +1 -0
- data/lib/decidim/exporters/json.rb +1 -0
- data/lib/decidim/exporters/serializer.rb +30 -0
- data/lib/decidim/faker/localized.rb +1 -0
- data/lib/decidim/feature_manifest.rb +37 -0
- data/lib/decidim/feature_validator.rb +1 -0
- data/lib/decidim/features.rb +1 -0
- data/lib/decidim/features/export_manifest.rb +52 -0
- data/lib/decidim/features/settings_manifest.rb +1 -0
- data/lib/decidim/file_zipper.rb +1 -0
- data/lib/decidim/filter_form_builder.rb +1 -0
- data/lib/decidim/form_builder.rb +2 -1
- data/lib/decidim/has_attachments.rb +4 -3
- data/lib/decidim/has_category.rb +2 -1
- data/lib/decidim/has_feature.rb +1 -0
- data/lib/decidim/has_reference.rb +1 -0
- data/lib/decidim/has_scope.rb +2 -1
- data/lib/decidim/i18n_exceptions.rb +1 -0
- data/lib/decidim/menu.rb +61 -0
- data/lib/decidim/menu_item.rb +31 -0
- data/lib/decidim/menu_registry.rb +65 -0
- data/lib/decidim/page_finder.rb +1 -0
- data/lib/decidim/query_extensions.rb +1 -0
- data/lib/decidim/reportable.rb +1 -0
- data/lib/decidim/resource_manifest.rb +1 -0
- data/lib/decidim/resourceable.rb +1 -0
- data/lib/decidim/stats_registry.rb +1 -0
- data/lib/decidim/translatable_attributes.rb +1 -0
- data/lib/devise/models/decidim_validatable.rb +2 -1
- data/lib/tasks/decidim_tasks.rake +1 -0
- data/lib/tasks/factory_girl.rake +1 -0
- metadata +33 -29
- data/app/services/decidim/public_processes.rb +0 -44
- data/app/views/layouts/decidim/_main_nav.html.erb +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b0dd8d6b3f087054a2af0d5d971d81c6a52adae
|
4
|
+
data.tar.gz: 5395196374ab3e8f0f7a65abba480e914505938d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fae7b86d0ca687eb0f3519d3cd7886c626224e023d95a6db84a7cdeef3d979193475117596993846231df7a4510bcab8f22b5f912283e1ea075b1d68b4018e77
|
7
|
+
data.tar.gz: 6e0d57a494c3a2d7bcbc1ecac618c47447defd88422c1761006b65e7f9e3a1ecb1889db554d150451728e8fd5c11591d1a18cadbbec176630ffb2c34ea392ee3
|
data/Rakefile
CHANGED
@@ -228,7 +228,7 @@ $navbar-active-shadow-medium: inset 0 4px 0 0 $primary;
|
|
228
228
|
|
229
229
|
|
230
230
|
/* Main nav */
|
231
|
-
.main-nav{
|
231
|
+
.main-nav ul{
|
232
232
|
padding: 0;
|
233
233
|
margin: 0;
|
234
234
|
list-style: none;
|
@@ -246,7 +246,7 @@ $navbar-active-shadow-medium: inset 0 4px 0 0 $primary;
|
|
246
246
|
}
|
247
247
|
}
|
248
248
|
|
249
|
-
.main-nav__link{
|
249
|
+
.main-nav__link a{
|
250
250
|
display: block;
|
251
251
|
padding: 1em 2em;
|
252
252
|
color: $navbar-color;
|
@@ -260,7 +260,7 @@ $navbar-active-shadow-medium: inset 0 4px 0 0 $primary;
|
|
260
260
|
}
|
261
261
|
}
|
262
262
|
|
263
|
-
.main-nav__link--active{
|
263
|
+
.main-nav__link--active a{
|
264
264
|
box-shadow: $navbar-active-shadow-small;
|
265
265
|
color: $navbar-active-color;
|
266
266
|
background: $navbar-active-bg;
|
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
require "active_support/concern"
|
3
4
|
|
4
5
|
module Decidim
|
@@ -19,6 +20,8 @@ module Decidim
|
|
19
20
|
helper Decidim::LanguageChooserHelper
|
20
21
|
helper Decidim::CookiesHelper
|
21
22
|
helper Decidim::ReplaceButtonsHelper
|
23
|
+
helper Decidim::LayoutHelper
|
24
|
+
helper Decidim::MenuHelper
|
22
25
|
|
23
26
|
layout "layouts/decidim/application"
|
24
27
|
end
|
@@ -4,7 +4,7 @@ require "active_support/concern"
|
|
4
4
|
|
5
5
|
module Decidim
|
6
6
|
# Shared behaviour for controllers that need an organization present in order
|
7
|
-
# to work. The
|
7
|
+
# to work. The organization is injected via the CurrentOrganization
|
8
8
|
# middleware.
|
9
9
|
module NeedsOrganization
|
10
10
|
extend ActiveSupport::Concern
|
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
module Decidim
|
3
4
|
# The main application controller that inherits from Rails.
|
4
5
|
class ApplicationController < ::DecidimController
|
@@ -14,6 +15,7 @@ module Decidim
|
|
14
15
|
helper Decidim::TranslationsHelper
|
15
16
|
helper Decidim::CookiesHelper
|
16
17
|
helper Decidim::AriaSelectedLinkToHelper
|
18
|
+
helper Decidim::MenuHelper
|
17
19
|
|
18
20
|
# Saves the location before loading each page so we can return to the
|
19
21
|
# right page. If we're on a devise page, we don't want to store that as the
|
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
module Decidim
|
3
4
|
module Devise
|
4
5
|
# Custom Devise SessionsController to avoid namespace problems.
|
@@ -8,7 +9,7 @@ module Decidim
|
|
8
9
|
|
9
10
|
def after_sign_in_path_for(user)
|
10
11
|
return first_login_authorizations_path if first_login_and_not_authorized?(user) &&
|
11
|
-
!user.
|
12
|
+
!user.role?("admin")
|
12
13
|
super
|
13
14
|
end
|
14
15
|
|
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
require_dependency "decidim/application_controller"
|
3
4
|
require_dependency "decidim/page_finder"
|
4
5
|
|
@@ -24,7 +25,7 @@ module Decidim
|
|
24
25
|
end
|
25
26
|
|
26
27
|
def promoted_participatory_processes
|
27
|
-
@promoted_processes ||=
|
28
|
+
@promoted_processes ||= OrganizationPrioritizedParticipatoryProcesses.new(current_organization) | PromotedParticipatoryProcesses.new
|
28
29
|
end
|
29
30
|
|
30
31
|
def highlighted_participatory_processes
|
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
require_dependency "decidim/application_controller"
|
3
4
|
|
4
5
|
module Decidim
|
@@ -28,19 +29,19 @@ module Decidim
|
|
28
29
|
private
|
29
30
|
|
30
31
|
def collection
|
31
|
-
@collection ||=
|
32
|
+
@collection ||= (participatory_processes.to_a + participatory_process_groups).flatten
|
32
33
|
end
|
33
34
|
|
34
35
|
def participatory_processes
|
35
|
-
@participatory_processes ||=
|
36
|
+
@participatory_processes ||= OrganizationPrioritizedParticipatoryProcesses.new(current_organization)
|
36
37
|
end
|
37
38
|
|
38
39
|
def promoted_participatory_processes
|
39
|
-
@promoted_processes ||= participatory_processes.
|
40
|
+
@promoted_processes ||= participatory_processes | PromotedParticipatoryProcesses.new
|
40
41
|
end
|
41
42
|
|
42
|
-
def
|
43
|
-
@
|
43
|
+
def participatory_process_groups
|
44
|
+
@process_groups ||= Decidim::ParticipatoryProcessGroup.where(organization: current_organization)
|
44
45
|
end
|
45
46
|
end
|
46
47
|
end
|
data/app/forms/decidim/form.rb
CHANGED