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.
Files changed (210) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +1 -0
  3. data/app/assets/stylesheets/decidim/modules/_modules.scss +1 -0
  4. data/app/assets/stylesheets/decidim/modules/_navbar.scss +3 -3
  5. data/app/assets/stylesheets/decidim/modules/_pagination.scss +5 -0
  6. data/app/commands/decidim/authorize_user.rb +1 -0
  7. data/app/commands/decidim/create_omniauth_registration.rb +1 -0
  8. data/app/commands/decidim/create_registration.rb +1 -0
  9. data/app/commands/decidim/create_report.rb +1 -0
  10. data/app/commands/decidim/invite_user.rb +1 -0
  11. data/app/commands/decidim/invite_user_again.rb +1 -0
  12. data/app/commands/decidim/remove_user_role.rb +1 -0
  13. data/app/commands/decidim/update_account.rb +1 -0
  14. data/app/commands/decidim/update_notifications_settings.rb +1 -0
  15. data/app/constraints/decidim/current_feature.rb +1 -0
  16. data/app/controllers/concerns/decidim/action_authorization.rb +1 -0
  17. data/app/controllers/concerns/decidim/devise_controllers.rb +3 -0
  18. data/app/controllers/concerns/decidim/feature_settings.rb +1 -0
  19. data/app/controllers/concerns/decidim/filter_resource.rb +1 -0
  20. data/app/controllers/concerns/decidim/needs_organization.rb +1 -1
  21. data/app/controllers/concerns/decidim/user_profile.rb +1 -0
  22. data/app/controllers/decidim/account_controller.rb +1 -0
  23. data/app/controllers/decidim/application_controller.rb +2 -0
  24. data/app/controllers/decidim/authorizations_controller.rb +1 -0
  25. data/app/controllers/decidim/cookie_policy_controller.rb +1 -0
  26. data/app/controllers/decidim/devise/confirmations_controller.rb +1 -0
  27. data/app/controllers/decidim/devise/invitations_controller.rb +1 -0
  28. data/app/controllers/decidim/devise/omniauth_registrations_controller.rb +1 -0
  29. data/app/controllers/decidim/devise/passwords_controller.rb +1 -0
  30. data/app/controllers/decidim/devise/registrations_controller.rb +1 -0
  31. data/app/controllers/decidim/devise/sessions_controller.rb +2 -1
  32. data/app/controllers/decidim/locales_controller.rb +1 -0
  33. data/app/controllers/decidim/notifications_settings_controller.rb +1 -0
  34. data/app/controllers/decidim/own_user_groups_controller.rb +1 -0
  35. data/app/controllers/decidim/pages_controller.rb +2 -1
  36. data/app/controllers/decidim/participatory_process_groups_controller.rb +1 -0
  37. data/app/controllers/decidim/participatory_process_steps_controller.rb +1 -0
  38. data/app/controllers/decidim/participatory_processes_controller.rb +6 -5
  39. data/app/controllers/decidim/static_map_controller.rb +1 -0
  40. data/app/forms/decidim/form.rb +1 -0
  41. data/app/forms/decidim/report_form.rb +1 -0
  42. data/app/helpers/decidim/action_authorization_helper.rb +1 -1
  43. data/app/helpers/decidim/application_helper.rb +1 -1
  44. data/app/helpers/decidim/aria_selected_link_to_helper.rb +1 -0
  45. data/app/helpers/decidim/attachments_helper.rb +1 -0
  46. data/app/helpers/decidim/authorization_form_helper.rb +1 -0
  47. data/app/helpers/decidim/cookies_helper.rb +1 -1
  48. data/app/helpers/decidim/decidim_form_helper.rb +1 -0
  49. data/app/helpers/decidim/feature_reference_helper.rb +1 -0
  50. data/app/helpers/decidim/filters_helper.rb +1 -0
  51. data/app/helpers/decidim/humanize_booleans_helper.rb +1 -0
  52. data/app/helpers/decidim/language_chooser_helper.rb +1 -0
  53. data/app/helpers/decidim/layout_helper.rb +1 -0
  54. data/app/helpers/decidim/localized_locales_helper.rb +1 -0
  55. data/app/helpers/decidim/map_helper.rb +1 -0
  56. data/app/helpers/decidim/menu_helper.rb +16 -0
  57. data/app/helpers/decidim/meta_tags_helper.rb +1 -0
  58. data/app/helpers/decidim/omniauth_helper.rb +1 -0
  59. data/app/helpers/decidim/orders_helper.rb +1 -0
  60. data/app/helpers/decidim/organization_scopes_helper.rb +1 -0
  61. data/app/helpers/decidim/paginate_helper.rb +1 -0
  62. data/app/helpers/decidim/participatory_process_helper.rb +1 -0
  63. data/app/helpers/decidim/participatory_process_steps_helper.rb +1 -0
  64. data/app/helpers/decidim/replace_buttons_helper.rb +1 -0
  65. data/app/helpers/decidim/resource_helper.rb +1 -0
  66. data/app/helpers/decidim/translations_helper.rb +1 -0
  67. data/app/helpers/decidim/user_profile_helper.rb +1 -0
  68. data/app/helpers/decidim/widget_urls_helper.rb +1 -0
  69. data/app/jobs/decidim/application_job.rb +1 -0
  70. data/app/jobs/decidim/export_job.rb +22 -0
  71. data/app/mailers/decidim/application_mailer.rb +1 -0
  72. data/app/mailers/decidim/decidim_devise_mailer.rb +2 -1
  73. data/app/mailers/decidim/export_mailer.rb +1 -0
  74. data/app/mailers/decidim/newsletter_mailer.rb +1 -0
  75. data/app/mailers/decidim/reported_mailer.rb +1 -0
  76. data/app/middleware/decidim/current_organization.rb +1 -0
  77. data/app/models/decidim/abilities/everyone.rb +1 -0
  78. data/app/models/decidim/ability.rb +1 -0
  79. data/app/models/decidim/application_record.rb +1 -0
  80. data/app/models/decidim/attachment.rb +1 -0
  81. data/app/models/decidim/authorization.rb +2 -1
  82. data/app/models/decidim/category.rb +4 -3
  83. data/app/models/decidim/component.rb +1 -0
  84. data/app/models/decidim/feature.rb +1 -0
  85. data/app/models/decidim/identity.rb +2 -2
  86. data/app/models/decidim/moderation.rb +2 -1
  87. data/app/models/decidim/newsletter.rb +2 -1
  88. data/app/models/decidim/organization.rb +7 -6
  89. data/app/models/decidim/participatory_process.rb +7 -20
  90. data/app/models/decidim/participatory_process_group.rb +3 -2
  91. data/app/models/decidim/participatory_process_step.rb +2 -1
  92. data/app/models/decidim/report.rb +3 -2
  93. data/app/models/decidim/resource_link.rb +1 -0
  94. data/app/models/decidim/scope.rb +2 -1
  95. data/app/models/decidim/static_page.rb +2 -1
  96. data/app/models/decidim/user.rb +6 -5
  97. data/app/models/decidim/user_group.rb +23 -7
  98. data/app/models/decidim/user_group_membership.rb +2 -2
  99. data/app/presenters/decidim/home_stats_presenter.rb +2 -1
  100. data/app/presenters/decidim/menu_item_presenter.rb +57 -0
  101. data/app/presenters/decidim/menu_presenter.rb +47 -0
  102. data/app/queries/decidim/highlighted_participatory_processes.rb +1 -0
  103. data/app/queries/decidim/organization_participatory_processes.rb +1 -0
  104. data/app/queries/decidim/organization_prioritized_participatory_processes.rb +18 -0
  105. data/app/queries/decidim/{public_participatory_processes.rb → prioritized_participatory_processes.rb} +4 -3
  106. data/app/queries/decidim/promoted_participatory_processes.rb +1 -0
  107. data/app/queries/decidim/stats_users_count.rb +1 -0
  108. data/app/services/decidim/action_authorizer.rb +1 -0
  109. data/app/services/decidim/authorization_handler.rb +1 -0
  110. data/app/services/decidim/resource_search.rb +1 -0
  111. data/app/services/decidim/static_map_generator.rb +1 -0
  112. data/app/uploaders/decidim/application_uploader.rb +1 -0
  113. data/app/uploaders/decidim/banner_image_uploader.rb +1 -0
  114. data/app/uploaders/decidim/hero_image_uploader.rb +1 -0
  115. data/app/uploaders/decidim/homepage_image_uploader.rb +1 -0
  116. data/app/uploaders/decidim/image_uploader.rb +1 -0
  117. data/app/uploaders/decidim/official_image_footer_uploader.rb +1 -0
  118. data/app/uploaders/decidim/official_image_header_uploader.rb +1 -0
  119. data/app/uploaders/decidim/organization_favicon_uploader.rb +1 -0
  120. data/app/uploaders/decidim/organization_logo_uploader.rb +1 -0
  121. data/app/validators/etiquette_validator.rb +3 -3
  122. data/app/validators/geocoding_validator.rb +1 -1
  123. data/app/views/decidim/own_user_groups/index.html.erb +8 -6
  124. data/app/views/decidim/participatory_processes/index.html.erb +1 -1
  125. data/app/views/decidim/shared/_orders.html.erb +4 -3
  126. data/app/views/layouts/decidim/_language_chooser.html.erb +1 -1
  127. data/app/views/layouts/decidim/_wrapper.html.erb +2 -2
  128. data/config/i18n-tasks.yml +5 -5
  129. data/config/initializers/devise.rb +1 -0
  130. data/config/initializers/foundation_rails_helper.rb +1 -0
  131. data/config/initializers/invisible_captcha.rb +1 -0
  132. data/config/initializers/mail_previews.rb +1 -0
  133. data/config/locales/ca.yml +3 -2
  134. data/config/locales/en.yml +3 -2
  135. data/config/locales/es.yml +4 -3
  136. data/config/locales/eu.yml +23 -1
  137. data/config/locales/fi.yml +0 -1
  138. data/config/locales/fr.yml +1 -2
  139. data/config/locales/nl.yml +0 -1
  140. data/config/routes.rb +1 -0
  141. data/db/migrate/20170529150743_add_rejected_at_to_user_groups.rb +5 -0
  142. data/db/seeds.rb +1 -0
  143. data/lib/decidim/attributes.rb +1 -0
  144. data/lib/decidim/attributes/time_with_zone.rb +1 -0
  145. data/lib/decidim/authorable.rb +1 -0
  146. data/lib/decidim/authorization_form_builder.rb +1 -0
  147. data/lib/decidim/core.rb +13 -0
  148. data/lib/decidim/core/api.rb +1 -0
  149. data/lib/decidim/core/api/author_interface.rb +1 -0
  150. data/lib/decidim/core/api/decidim_type.rb +1 -0
  151. data/lib/decidim/core/api/localized_string_type.rb +1 -0
  152. data/lib/decidim/core/api/process_step_type.rb +1 -0
  153. data/lib/decidim/core/api/process_type.rb +1 -0
  154. data/lib/decidim/core/api/session_type.rb +1 -0
  155. data/lib/decidim/core/api/translated_field_type.rb +1 -0
  156. data/lib/decidim/core/api/user_group_type.rb +1 -0
  157. data/lib/decidim/core/api/user_type.rb +1 -0
  158. data/lib/decidim/core/engine.rb +21 -1
  159. data/lib/decidim/core/test.rb +1 -0
  160. data/lib/decidim/core/test/factories.rb +9 -1
  161. data/lib/decidim/core/test/shared_examples/authorable.rb +1 -0
  162. data/lib/decidim/core/test/shared_examples/comments_examples.rb +1 -0
  163. data/lib/decidim/core/test/shared_examples/has_attachments.rb +1 -0
  164. data/lib/decidim/core/test/shared_examples/has_category.rb +1 -0
  165. data/lib/decidim/core/test/shared_examples/has_feature.rb +1 -0
  166. data/lib/decidim/core/test/shared_examples/has_reference.rb +1 -0
  167. data/lib/decidim/core/test/shared_examples/has_scope.rb +1 -0
  168. data/lib/decidim/core/test/shared_examples/localised_email.rb +1 -0
  169. data/lib/decidim/core/test/shared_examples/manage_moderations_examples.rb +1 -0
  170. data/lib/decidim/core/test/shared_examples/reportable.rb +1 -0
  171. data/lib/decidim/core/test/shared_examples/reports_examples.rb +1 -0
  172. data/lib/decidim/core/version.rb +2 -1
  173. data/lib/decidim/devise_failure_app.rb +0 -1
  174. data/lib/decidim/exporters.rb +2 -0
  175. data/lib/decidim/exporters/csv.rb +1 -0
  176. data/lib/decidim/exporters/export_data.rb +1 -0
  177. data/lib/decidim/exporters/exporter.rb +1 -0
  178. data/lib/decidim/exporters/json.rb +1 -0
  179. data/lib/decidim/exporters/serializer.rb +30 -0
  180. data/lib/decidim/faker/localized.rb +1 -0
  181. data/lib/decidim/feature_manifest.rb +37 -0
  182. data/lib/decidim/feature_validator.rb +1 -0
  183. data/lib/decidim/features.rb +1 -0
  184. data/lib/decidim/features/export_manifest.rb +52 -0
  185. data/lib/decidim/features/settings_manifest.rb +1 -0
  186. data/lib/decidim/file_zipper.rb +1 -0
  187. data/lib/decidim/filter_form_builder.rb +1 -0
  188. data/lib/decidim/form_builder.rb +2 -1
  189. data/lib/decidim/has_attachments.rb +4 -3
  190. data/lib/decidim/has_category.rb +2 -1
  191. data/lib/decidim/has_feature.rb +1 -0
  192. data/lib/decidim/has_reference.rb +1 -0
  193. data/lib/decidim/has_scope.rb +2 -1
  194. data/lib/decidim/i18n_exceptions.rb +1 -0
  195. data/lib/decidim/menu.rb +61 -0
  196. data/lib/decidim/menu_item.rb +31 -0
  197. data/lib/decidim/menu_registry.rb +65 -0
  198. data/lib/decidim/page_finder.rb +1 -0
  199. data/lib/decidim/query_extensions.rb +1 -0
  200. data/lib/decidim/reportable.rb +1 -0
  201. data/lib/decidim/resource_manifest.rb +1 -0
  202. data/lib/decidim/resourceable.rb +1 -0
  203. data/lib/decidim/stats_registry.rb +1 -0
  204. data/lib/decidim/translatable_attributes.rb +1 -0
  205. data/lib/devise/models/decidim_validatable.rb +2 -1
  206. data/lib/tasks/decidim_tasks.rake +1 -0
  207. data/lib/tasks/factory_girl.rake +1 -0
  208. metadata +33 -29
  209. data/app/services/decidim/public_processes.rb +0 -44
  210. 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: abd55b4bc86a454e483127b15d235ed2a056e718
4
- data.tar.gz: 4d29c9e66aea8a4c43110cda9b6487310d5c8429
3
+ metadata.gz: 0b0dd8d6b3f087054a2af0d5d971d81c6a52adae
4
+ data.tar.gz: 5395196374ab3e8f0f7a65abba480e914505938d
5
5
  SHA512:
6
- metadata.gz: a2e6c3415e64aa2e6430062cfca573d1aef0e28dc42d04ff7dec6332e7018b20672d9e76c1efd95974c5d6f1f362655515c3fa96d5d813364e178b0dc1f259cf
7
- data.tar.gz: df609842f94d94b53b37c5611988c853f710453bc5e2a98b46bd370c39879a867f9764c5ee3adf1ecbff4614030a20d7e22ce614fa19eafdc3d64962cb8d6158
6
+ metadata.gz: fae7b86d0ca687eb0f3519d3cd7886c626224e023d95a6db84a7cdeef3d979193475117596993846231df7a4510bcab8f22b5f912283e1ea075b1d68b4018e77
7
+ data.tar.gz: 6e0d57a494c3a2d7bcbc1ecac618c47447defd88422c1761006b65e7f9e3a1ecb1889db554d150451728e8fd5c11591d1a18cadbbec176630ffb2c34ea392ee3
data/Rakefile CHANGED
@@ -1,2 +1,3 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require "decidim/dev/common_rake"
@@ -34,6 +34,7 @@
34
34
  @import "tags";
35
35
  @import "list-docs";
36
36
  @import "datepicker";
37
+ @import "pagination";
37
38
 
38
39
  //Process elements
39
40
  @import "process-header";
@@ -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;
@@ -0,0 +1,5 @@
1
+ .pagination {
2
+ .pagination-previous, .pagination-next {
3
+ display: inline-block;
4
+ }
5
+ }
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Decidim
3
4
  # A command to authorize a user with an authorization handler.
4
5
  class AuthorizeUser < Rectify::Command
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Decidim
3
4
  # A command with all the business logic to create a user from omniauth
4
5
  class CreateOmniauthRegistration < Rectify::Command
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Decidim
3
4
  # A command with all the business logic to create a user through the sign up form.
4
5
  # It enables the option to sign up as a user group.
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Decidim
3
4
  # A command with all the business logic when a user creates a report.
4
5
  class CreateReport < Rectify::Command
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Decidim
3
4
  # A command with the business logic to invite a user to an organization.
4
5
  class InviteUser < Rectify::Command
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Decidim
3
4
  # A command with the business logic to invite an user to an organization.
4
5
  class InviteUserAgain < Rectify::Command
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Decidim
3
4
  # A command to remove a role from a given User.
4
5
  class RemoveUserRole < Rectify::Command
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Decidim
3
4
  # This command updates the user's account.
4
5
  class UpdateAccount < Rectify::Command
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Decidim
3
4
  # This command updates the user's notifictions settings.
4
5
  class UpdateNotificationsSettings < Rectify::Command
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Decidim
3
4
  # This class infers the current feature we're scoped to by looking at the
4
5
  # request parameters and injects it into the environment.
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require "active_support/concern"
3
4
 
4
5
  module Decidim
@@ -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
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require "active_support/concern"
3
4
 
4
5
  module Decidim
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require "active_support/concern"
3
4
 
4
5
  module Decidim
@@ -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 origanization is injected via the CurrentOrganization
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
  require "active_support/concern"
3
4
 
4
5
  module Decidim
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require_dependency "decidim/application_controller"
3
4
 
4
5
  module Decidim
@@ -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
  require_dependency "decidim/application_controller"
3
4
 
4
5
  module Decidim
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require_dependency "decidim/application_controller"
3
4
 
4
5
  module Decidim
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Decidim
3
4
  module Devise
4
5
  # Custom Devise ConfirmationsController to avoid namespace problems.
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Decidim
3
4
  module Devise
4
5
  # This controller customizes the behaviour of Devise::Invitiable.
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Decidim
3
4
  module Devise
4
5
  # This controller customizes the behaviour of Devise::Omniauthable.
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Decidim
3
4
  module Devise
4
5
  # Custom Devise PasswordsController to avoid namespace problems.
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Decidim
3
4
  module Devise
4
5
  # This controller customizes the behaviour of Devise's
@@ -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.roles.include?("admin")
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
 
4
5
  module Decidim
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require_dependency "decidim/application_controller"
3
4
 
4
5
  module Decidim
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require_dependency "decidim/application_controller"
3
4
 
4
5
  module Decidim
@@ -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 ||= OrganizationParticipatoryProcesses.new(current_organization) | PublicParticipatoryProcesses.new | PromotedParticipatoryProcesses.new
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
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require_dependency "decidim/application_controller"
3
4
 
4
5
  module Decidim
@@ -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 ||= public_processes.collection
32
+ @collection ||= (participatory_processes.to_a + participatory_process_groups).flatten
32
33
  end
33
34
 
34
35
  def participatory_processes
35
- @participatory_processes ||= public_processes.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.promoted
40
+ @promoted_processes ||= participatory_processes | PromotedParticipatoryProcesses.new
40
41
  end
41
42
 
42
- def public_processes
43
- @public_processes ||= PublicProcesses.new(current_organization)
43
+ def participatory_process_groups
44
+ @process_groups ||= Decidim::ParticipatoryProcessGroup.where(organization: current_organization)
44
45
  end
45
46
  end
46
47
  end
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require_dependency "decidim/application_controller"
3
4
 
4
5
  module Decidim
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Decidim
3
4
  # A base form object to hold common logic, like automatically adding as
4
5
  # public method the params sent as context by the `FormFactory` concern.
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Decidim
3
4
  # A form object to be used when public users want to report a reportable.
4
5
  class ReportForm < Decidim::Form
@@ -1,5 +1,5 @@
1
- # encoding: utf-8
2
1
  # frozen_string_literal: true
2
+
3
3
  module Decidim
4
4
  module ActionAuthorizationHelper
5
5
  # Public: Renders a modal that explains why she can't perform an action,
@@ -1,5 +1,5 @@
1
- # encoding: utf-8
2
1
  # frozen_string_literal: true
2
+
3
3
  module Decidim
4
4
  # Main module to add application-wide helpers.
5
5
  module ApplicationHelper
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Decidim
3
4
  # Module to add the attribute `aria-selected` to links when they are
4
5
  # pointing to the current path. Uses the `active_link_to` gem to calculate
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Decidim
3
4
  # A Helper to render and link to resources.
4
5
  module AttachmentsHelper
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Decidim
3
4
  # A heper to expose an easy way to add authorization forms in a view.
4
5
  module AuthorizationFormHelper
@@ -1,5 +1,5 @@
1
- # encoding: utf-8
2
1
  # frozen_string_literal: true
2
+
3
3
  module Decidim
4
4
  # This module includes helpers to verify the acceptance of the cookie policy
5
5
  module CookiesHelper
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Decidim
3
4
  # A heper to expose an easy way to add authorization forms in a view.
4
5
  module DecidimFormHelper
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Decidim
3
4
  # Helper to print Feature references.
4
5
  module FeatureReferenceHelper