decidim-core 0.0.3 → 0.0.5
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 +1 -0
- data/app/assets/images/decidim/process.svg +10 -0
- data/app/assets/javascripts/decidim.js.es6 +2 -0
- data/app/assets/javascripts/decidim/editor.js.es6 +2 -2
- data/app/assets/javascripts/decidim/filters.js.es6 +1 -1
- data/app/assets/javascripts/decidim/form_filter.component.js.es6 +26 -5
- data/app/assets/javascripts/decidim/form_filter.component.test.js +1 -18
- data/app/assets/javascripts/decidim/foundation.js.es6 +1 -0
- data/app/assets/javascripts/decidim/history.js.es6 +35 -0
- data/app/assets/javascripts/decidim/orders.js.es6 +28 -0
- data/app/assets/stylesheets/decidim/_decidim.scss +1 -0
- data/app/assets/stylesheets/decidim/email.css +21 -3
- data/app/assets/stylesheets/decidim/extras/_leaflet.scss +4 -2
- data/app/assets/stylesheets/decidim/extras/_quill.scss +8 -0
- data/app/assets/stylesheets/decidim/extras/_register_form.scss +9 -0
- data/app/assets/stylesheets/decidim/modules/_buttons.scss +19 -3
- data/app/assets/stylesheets/decidim/utils/_mixins.scss +8 -4
- data/app/commands/decidim/authorize_user.rb +9 -4
- data/app/commands/decidim/create_omniauth_registration.rb +4 -2
- data/app/commands/decidim/create_registration.rb +4 -1
- data/app/commands/decidim/invite_user.rb +3 -1
- data/app/commands/decidim/update_notifications_settings.rb +31 -0
- data/app/constraints/decidim/current_feature.rb +16 -15
- data/app/controllers/concerns/decidim/action_authorization.rb +73 -0
- data/app/controllers/concerns/decidim/feature_settings.rb +2 -5
- data/app/controllers/concerns/decidim/needs_authorization.rb +5 -1
- data/app/controllers/concerns/decidim/user_profile.rb +1 -0
- data/app/controllers/decidim/application_controller.rb +12 -0
- data/app/controllers/decidim/authorizations_controller.rb +10 -12
- data/app/controllers/decidim/cookie_policy_controller.rb +15 -0
- data/app/controllers/decidim/devise/confirmations_controller.rb +4 -0
- data/app/controllers/decidim/devise/invitations_controller.rb +4 -0
- data/app/controllers/decidim/devise/omniauth_registrations_controller.rb +10 -3
- data/app/controllers/decidim/devise/passwords_controller.rb +4 -0
- data/app/controllers/decidim/devise/registrations_controller.rb +21 -0
- data/app/controllers/decidim/devise/sessions_controller.rb +4 -0
- data/app/controllers/decidim/notifications_settings_controller.rb +31 -0
- data/app/controllers/decidim/pages_controller.rb +17 -6
- data/app/controllers/decidim/participatory_processes_controller.rb +5 -5
- data/app/forms/decidim/notifications_settings_form.rb +17 -0
- data/app/forms/decidim/registration_form.rb +2 -1
- data/app/helpers/decidim/action_authorization_helper.rb +82 -0
- data/app/helpers/decidim/application_helper.rb +2 -0
- data/app/helpers/decidim/authorization_form_helper.rb +1 -1
- data/app/helpers/decidim/cookies_helper.rb +11 -0
- data/app/helpers/decidim/decidim_form_helper.rb +18 -0
- data/app/helpers/decidim/language_chooser_helper.rb +18 -0
- data/app/helpers/decidim/layout_helper.rb +0 -5
- data/app/helpers/decidim/localized_locales_helper.rb +1 -1
- data/app/helpers/decidim/meta_tags_helper.rb +104 -0
- data/app/helpers/decidim/orders_helper.rb +28 -0
- data/app/helpers/decidim/resource_helper.rb +46 -6
- data/app/mailers/decidim/application_mailer.rb +2 -2
- data/app/mailers/decidim/decidim_devise_mailer.rb +0 -1
- data/app/mailers/decidim/newsletter_mailer.rb +24 -0
- data/app/models/decidim/abilities/everyone.rb +2 -0
- data/app/models/decidim/feature.rb +30 -0
- data/app/models/decidim/newsletter.rb +24 -0
- data/app/models/decidim/organization.rb +2 -0
- data/app/models/decidim/user.rb +3 -2
- data/app/queries/decidim/highlighted_participatory_processes.rb +10 -0
- data/app/queries/decidim/promoted_participatory_processes.rb +9 -0
- data/app/queries/decidim/public_participatory_processes.rb +10 -0
- data/app/services/decidim/action_authorizer.rb +102 -0
- data/app/services/decidim/resource_search.rb +1 -1
- data/app/uploaders/decidim/official_image_footer_uploader.rb +12 -0
- data/app/uploaders/decidim/official_image_header_uploader.rb +12 -0
- data/app/validators/etiquette_validator.rb +42 -0
- data/app/views/decidim/account/show.html.erb +1 -1
- data/app/views/decidim/authorizations/index.html.erb +4 -4
- data/app/views/decidim/authorizations/new.html.erb +2 -2
- data/app/views/decidim/cookie_policy/accept.js.erb +3 -0
- data/app/views/decidim/devise/confirmations/new.html.erb +3 -1
- data/app/views/decidim/devise/invitations/edit.html.erb +1 -1
- data/app/views/decidim/devise/omniauth_registrations/new.html.erb +1 -1
- data/app/views/decidim/devise/passwords/edit.html.erb +1 -1
- data/app/views/decidim/devise/passwords/new.html.erb +3 -1
- data/app/views/decidim/devise/registrations/edit.html.erb +2 -1
- data/app/views/decidim/devise/registrations/new.html.erb +13 -1
- data/app/views/decidim/devise/sessions/new.html.erb +3 -1
- data/app/views/decidim/newsletter_mailer/newsletter.html.erb +5 -0
- data/app/views/decidim/notifications_settings/show.html.erb +26 -0
- data/app/views/decidim/pages/index.html.erb +34 -0
- data/app/views/decidim/participatory_process_steps/index.html.erb +1 -1
- data/app/views/decidim/participatory_processes/_participatory_process.html.erb +4 -2
- data/app/views/decidim/participatory_processes/_promoted_process.html.erb +1 -1
- data/app/views/decidim/participatory_processes/index.html.erb +3 -3
- data/app/views/decidim/participatory_processes/show.html.erb +30 -9
- data/app/views/decidim/shared/_action_authorization_modal.html.erb +55 -0
- data/app/views/decidim/shared/_login_modal.html.erb +2 -3
- data/app/views/decidim/shared/_orders.html.erb +15 -0
- data/app/views/decidim/shared/_share_modal.html.erb +33 -0
- data/app/views/devise/mailer/organization_admin_invitation_instructions.html.erb +1 -1
- data/app/views/layouts/decidim/_application.html.erb +12 -0
- data/app/views/layouts/decidim/_cookie_warning.html.erb +8 -0
- data/app/views/layouts/decidim/_footer.html.erb +6 -0
- data/app/views/layouts/decidim/_header.html.erb +7 -9
- data/app/views/layouts/decidim/_language_chooser.html.erb +3 -3
- data/app/views/layouts/decidim/_logo.html.erb +1 -1
- data/app/views/layouts/decidim/_mailer_logo.html.erb +31 -0
- data/app/views/layouts/decidim/_main_nav.html.erb +11 -0
- data/app/views/layouts/decidim/_process_header.html.erb +9 -7
- data/app/views/layouts/decidim/_social_media_links.html.erb +39 -0
- data/app/views/layouts/decidim/_social_meta.html.erb +8 -8
- data/app/views/layouts/decidim/mailer.html.erb +110 -62
- data/app/views/layouts/decidim/participatory_process.html.erb +14 -3
- data/app/views/layouts/decidim/user_profile.html.erb +1 -0
- data/app/views/pages/decidim_page.html.erb +5 -0
- data/app/views/pages/home.html.erb +4 -0
- data/app/views/pages/home/_extended.html.erb +2 -2
- data/app/views/pages/home/_footer_sub_hero.html.erb +12 -0
- data/app/views/pages/home/_hero.html.erb +2 -2
- data/app/views/pages/home/_highlighted_processes.html.erb +2 -2
- data/config/i18n-tasks.yml +6 -2
- data/config/initializers/invisible_captcha.rb +10 -0
- data/config/initializers/mail_previews.rb +4 -0
- data/config/locales/ca.yml +129 -23
- data/config/locales/en.yml +98 -13
- data/config/locales/es.yml +128 -22
- data/config/locales/eu.yml +5 -0
- data/config/routes.rb +13 -5
- data/db/migrate/20170131134349_add_action_permissions_to_decidim_features.rb +5 -0
- data/db/migrate/20170202084913_add_comments_and_replies_notifications_to_users.rb +6 -0
- data/db/migrate/20170203150545_add_newsletter_notifications_to_users.rb +5 -0
- data/db/migrate/20170206083118_rename_extra_info_on_processes.rb +12 -0
- data/db/migrate/20170206142116_add_published_at_to_decidim_features.rb +6 -0
- data/db/migrate/20170207091021_add_social_media_handlers_to_organization.rb +8 -0
- data/db/migrate/20170207093048_add_organization_logo_and_url.rb +7 -0
- data/db/migrate/20170213081133_create_decidim_newsletters.rb +15 -0
- data/db/seeds.rb +29 -4
- data/lib/decidim/attributes.rb +6 -0
- data/lib/decidim/attributes/time_with_zone.rb +13 -0
- data/lib/decidim/authorable.rb +2 -2
- data/lib/decidim/core.rb +11 -0
- data/lib/decidim/core/api.rb +11 -0
- data/lib/decidim/core/api/author_interface.rb +11 -0
- data/lib/decidim/core/api/localized_string_type.rb +11 -0
- data/{app/types/decidim → lib/decidim/core/api}/process_step_type.rb +2 -2
- data/{app/types/decidim → lib/decidim/core/api}/process_type.rb +1 -1
- data/{app/types/decidim → lib/decidim/core/api}/session_type.rb +0 -0
- data/lib/decidim/core/api/translated_field_type.rb +42 -0
- data/{app/types/decidim → lib/decidim/core/api}/user_group_type.rb +1 -1
- data/{app/types/decidim → lib/decidim/core/api}/user_type.rb +1 -1
- data/lib/decidim/core/engine.rb +7 -1
- data/lib/decidim/core/test.rb +1 -0
- data/lib/decidim/core/test/factories.rb +41 -8
- data/lib/decidim/core/test/shared_examples/localised_email.rb +24 -0
- data/lib/decidim/core/version.rb +1 -1
- data/lib/decidim/feature_manifest.rb +11 -0
- data/{app/validators → lib/decidim}/feature_validator.rb +1 -3
- data/lib/decidim/features/base_controller.rb +6 -1
- data/lib/decidim/form_builder.rb +166 -1
- data/lib/decidim/has_feature.rb +2 -1
- data/lib/decidim/resourceable.rb +26 -0
- data/vendor/assets/javascripts/morphdom.js +679 -0
- metadata +174 -49
- data/lib/decidim/has_attachment.rb +0 -32
@@ -1,32 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
require "active_support/concern"
|
3
|
-
|
4
|
-
module Decidim
|
5
|
-
# A concern with the features needed when you want a model to be able to create
|
6
|
-
# links from it to another resource.
|
7
|
-
module HasAttachments
|
8
|
-
extend ActiveSupport::Concern
|
9
|
-
|
10
|
-
included do
|
11
|
-
has_many :attachments,
|
12
|
-
class_name: Decidim::Attachment,
|
13
|
-
dependent: :destroy,
|
14
|
-
inverse_of: :attached_to,
|
15
|
-
as: :attached_to
|
16
|
-
|
17
|
-
# All the attachments that are photos for this porcess.
|
18
|
-
#
|
19
|
-
# Returns an Array<Attachment>
|
20
|
-
def photos
|
21
|
-
@photos ||= attachments.select(&:photo?)
|
22
|
-
end
|
23
|
-
|
24
|
-
# All the attachments that are documents for this porcess.
|
25
|
-
#
|
26
|
-
# Returns an Array<Attachment>
|
27
|
-
def documents
|
28
|
-
@documents ||= attachments.select(&:document?)
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|