decidim-core 0.22.0 → 0.23.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of decidim-core might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/app/assets/config/decidim_core_manifest.js +5 -0
- data/app/assets/javascripts/decidim.js.es6 +2 -0
- data/app/assets/javascripts/decidim/ajax_modals.js.es6 +3 -3
- data/app/assets/javascripts/decidim/confirm.js.es6 +3 -2
- data/app/assets/javascripts/decidim/core/bundle.js +1 -1
- data/app/assets/javascripts/decidim/core/bundle.js.map +1 -1
- data/app/assets/javascripts/decidim/diff_mode_dropdown.js.es6 +18 -4
- data/app/assets/javascripts/decidim/editor.js.es6 +3 -3
- data/app/assets/javascripts/decidim/geocoding.js.es6 +60 -0
- data/app/assets/javascripts/decidim/geocoding/attach_input.js.es6 +106 -0
- data/app/assets/javascripts/decidim/geocoding/format_address.js.es6 +29 -0
- data/app/assets/javascripts/decidim/geocoding/provider/here.js.es6 +107 -0
- data/app/assets/javascripts/decidim/geocoding/provider/photon.js.es6 +77 -0
- data/app/assets/javascripts/decidim/map.js.es6 +34 -124
- data/app/assets/javascripts/decidim/map/controller.js.es6 +92 -0
- data/app/assets/javascripts/decidim/map/controller/markers.js.es6 +65 -0
- data/app/assets/javascripts/decidim/map/controller/static.es6 +48 -0
- data/app/assets/javascripts/decidim/map/factory.js.es6 +51 -0
- data/app/assets/javascripts/decidim/map/icon.js.es6 +31 -0
- data/app/assets/javascripts/decidim/map/legacy.js.es6 +87 -0
- data/app/assets/javascripts/decidim/map/provider/default.js.es6 +22 -0
- data/app/assets/javascripts/decidim/map/provider/here.js.es6 +22 -0
- data/app/assets/javascripts/decidim/security/selfxss_warning.js.es6 +19 -0
- data/app/assets/stylesheets/decidim/_decidim.scss +2 -0
- data/app/assets/stylesheets/decidim/modules/_cards.scss +15 -0
- data/app/assets/stylesheets/decidim/modules/_forms.scss +14 -0
- data/app/assets/stylesheets/decidim/modules/_layout.scss +11 -3
- data/app/assets/stylesheets/decidim/modules/_map.scss +35 -0
- data/app/assets/stylesheets/decidim/modules/_progress-bar.scss +4 -0
- data/app/assets/stylesheets/decidim/modules/_reveal.scss +5 -0
- data/app/assets/stylesheets/decidim/modules/_status-labels.scss +2 -1
- data/app/cells/decidim/author/flag.erb +1 -1
- data/app/cells/decidim/author/profile_inline.erb +2 -2
- data/app/cells/decidim/author_cell.rb +5 -2
- data/app/cells/decidim/card_cell.rb +21 -7
- data/app/cells/decidim/card_m/show.erb +1 -1
- data/app/cells/decidim/card_m_cell.rb +6 -4
- data/app/cells/decidim/collapsible_authors_cell.rb +1 -1
- data/app/cells/decidim/diff/diff_mode_html.erb +5 -5
- data/app/cells/decidim/follow_button/show.erb +6 -6
- data/app/cells/decidim/follow_button_cell.rb +8 -0
- data/app/cells/decidim/progress_bar/show.erb +11 -4
- data/app/cells/decidim/progress_bar_cell.rb +20 -1
- data/app/cells/decidim/translation_bar/show.erb +6 -0
- data/app/cells/decidim/translation_bar_cell.rb +52 -0
- data/app/cells/decidim/version_cell.rb +1 -1
- data/app/cells/decidim/versions_list_cell.rb +1 -1
- data/app/commands/decidim/amendable/accept.rb +9 -3
- data/app/commands/decidim/amendable/create_draft.rb +2 -0
- data/app/commands/decidim/amendable/update_draft.rb +2 -0
- data/app/commands/decidim/attachment_methods.rb +12 -5
- data/app/commands/decidim/destroy_account.rb +1 -0
- data/app/commands/decidim/gallery_methods.rb +16 -9
- data/app/commands/decidim/messaging/reply_to_conversation.rb +1 -1
- data/app/commands/decidim/multiple_attachments_methods.rb +56 -0
- data/app/controllers/concerns/decidim/devise_controllers.rb +1 -0
- data/app/controllers/concerns/decidim/filter_resource.rb +24 -6
- data/app/controllers/concerns/decidim/flaggable.rb +20 -0
- data/app/controllers/concerns/decidim/force_authentication.rb +1 -0
- data/app/controllers/concerns/decidim/impersonate_users.rb +1 -1
- data/app/controllers/concerns/decidim/needs_snippets.rb +20 -0
- data/app/controllers/concerns/decidim/paginable.rb +5 -1
- data/app/controllers/concerns/decidim/withdrawable.rb +20 -0
- data/app/controllers/decidim/application_controller.rb +16 -0
- data/app/controllers/decidim/components/base_controller.rb +6 -1
- data/app/controllers/decidim/cookie_policy_controller.rb +6 -3
- data/app/controllers/decidim/messaging/conversations_controller.rb +5 -2
- data/app/forms/decidim/account_form.rb +5 -1
- data/app/forms/decidim/amendable/create_form.rb +1 -1
- data/app/forms/decidim/amendable/form.rb +44 -3
- data/app/forms/decidim/attachment_form.rb +5 -1
- data/app/forms/decidim/user_group_form.rb +5 -1
- data/app/helpers/decidim/cells_helper.rb +3 -15
- data/app/helpers/decidim/check_boxes_tree_helper.rb +21 -12
- data/app/helpers/decidim/cookies_helper.rb +1 -1
- data/app/helpers/decidim/decidim_form_helper.rb +1 -1
- data/app/helpers/decidim/filter_params_helper.rb +30 -0
- data/app/helpers/decidim/map_helper.rb +86 -23
- data/app/helpers/decidim/orders_helper.rb +6 -1
- data/app/helpers/decidim/paginate_helper.rb +3 -1
- data/app/helpers/decidim/scopes_helper.rb +4 -4
- data/app/helpers/decidim/translations_helper.rb +7 -1
- data/app/jobs/decidim/machine_translation_fields_job.rb +30 -0
- data/app/jobs/decidim/machine_translation_resource_job.rb +113 -0
- data/app/jobs/decidim/machine_translation_save_job.rb +33 -0
- data/app/mailers/decidim/reported_mailer.rb +8 -1
- data/app/models/decidim/action_log.rb +1 -1
- data/app/models/decidim/area.rb +3 -0
- data/app/models/decidim/area_type.rb +4 -0
- data/app/models/decidim/attachment.rb +30 -2
- data/app/models/decidim/attachment_collection.rb +3 -0
- data/app/models/decidim/authorization.rb +3 -0
- data/app/models/decidim/category.rb +4 -0
- data/app/models/decidim/component.rb +7 -0
- data/app/models/decidim/content_block.rb +11 -1
- data/app/models/decidim/contextual_help_section.rb +4 -0
- data/app/models/decidim/follow.rb +3 -1
- data/app/models/decidim/messaging/message.rb +1 -1
- data/app/models/decidim/moderation.rb +1 -1
- data/app/models/decidim/newsletter.rb +3 -0
- data/app/models/decidim/oauth_application.rb +2 -0
- data/app/models/decidim/organization.rb +53 -9
- data/app/models/decidim/scope.rb +4 -1
- data/app/models/decidim/scope_type.rb +3 -0
- data/app/models/decidim/share_token.rb +49 -0
- data/app/models/decidim/static_page.rb +4 -1
- data/app/models/decidim/static_page_topic.rb +3 -0
- data/app/models/decidim/user_base_entity.rb +6 -2
- data/app/permissions/decidim/permissions.rb +9 -0
- data/app/presenters/decidim/log/base_presenter.rb +1 -1
- data/app/presenters/decidim/log/value_types/default_presenter.rb +1 -1
- data/app/presenters/decidim/official_author_presenter.rb +36 -0
- data/app/presenters/decidim/resource_locator_presenter.rb +63 -12
- data/app/queries/decidim/similar_emendations.rb +4 -4
- data/app/scrubbers/decidim/user_input_scrubber.rb +1 -1
- data/app/serializers/decidim/importers/participatory_space_components_importer.rb +1 -1
- data/app/services/decidim/base_diff_renderer.rb +17 -0
- data/app/services/decidim/open_data_exporter.rb +2 -0
- data/app/services/decidim/resource_search.rb +95 -6
- data/app/services/decidim/static_map_generator.rb +10 -26
- data/app/uploaders/decidim/application_uploader.rb +15 -1
- data/app/uploaders/decidim/attachment_uploader.rb +23 -17
- data/app/uploaders/decidim/banner_image_uploader.rb +1 -1
- data/app/uploaders/decidim/hero_image_uploader.rb +1 -1
- data/app/uploaders/decidim/homepage_image_uploader.rb +1 -1
- data/app/uploaders/decidim/image_uploader.rb +6 -2
- data/app/uploaders/decidim/oauth_application_logo_uploader.rb +1 -1
- data/app/uploaders/decidim/official_image_footer_uploader.rb +1 -1
- data/app/uploaders/decidim/official_image_header_uploader.rb +1 -1
- data/app/uploaders/decidim/organization_logo_uploader.rb +1 -1
- data/app/uploaders/decidim/record_image_uploader.rb +15 -0
- data/app/validators/etiquette_validator.rb +0 -7
- data/app/validators/geocoding_validator.rb +9 -4
- data/app/validators/passthru_validator.rb +111 -0
- data/app/validators/scope_belongs_to_component_validator.rb +16 -0
- data/app/validators/uploader_content_type_validator.rb +44 -0
- data/app/views/decidim/authorization_modals/_content.html.erb +2 -2
- data/app/views/decidim/devise/registrations/new.html.erb +3 -1
- data/app/views/decidim/devise/sessions/new.html.erb +3 -1
- data/app/views/decidim/messaging/conversations/_error_modal.html.erb +21 -0
- data/app/views/decidim/messaging/conversations/error.js.erb +10 -0
- data/app/views/decidim/notification_mailer/event_received.html.erb +2 -2
- data/app/views/decidim/reported_mailer/report.html.erb +49 -3
- data/app/views/decidim/scopes/_scopes_picker_input.html.erb +15 -14
- data/app/views/decidim/searches/_filters.html.erb +1 -0
- data/app/views/decidim/shared/_login_modal.html.erb +14 -3
- data/app/views/decidim/shared/_static_map.html.erb +1 -1
- data/app/views/layouts/decidim/_head.html.erb +2 -0
- data/app/views/layouts/decidim/_js_configuration.html.erb +7 -1
- data/config/locales/am-ET.yml +1 -0
- data/config/locales/ar.yml +3 -4
- data/config/locales/bg.yml +1508 -0
- data/config/locales/ca.yml +35 -8
- data/config/locales/cs.yml +34 -7
- data/config/locales/da.yml +1 -0
- data/config/locales/de.yml +23 -4
- data/config/locales/el.yml +0 -4
- data/config/locales/en.yml +30 -3
- data/config/locales/eo.yml +92 -0
- data/config/locales/es-MX.yml +28 -1
- data/config/locales/es-PY.yml +28 -1
- data/config/locales/es.yml +44 -17
- data/config/locales/et.yml +1 -0
- data/config/locales/eu.yml +3 -4
- data/config/locales/fi-plain.yml +28 -1
- data/config/locales/fi.yml +29 -2
- data/config/locales/fr-CA.yml +32 -4
- data/config/locales/fr.yml +61 -33
- data/config/locales/ga-IE.yml +0 -8
- data/config/locales/gl.yml +3 -4
- data/config/locales/hr.yml +1 -0
- data/config/locales/hu.yml +7 -4
- data/config/locales/id-ID.yml +3 -4
- data/config/locales/is-IS.yml +3 -9
- data/config/locales/is.yml +463 -0
- data/config/locales/it.yml +36 -8
- data/config/locales/ja-JP.yml +25 -16
- data/config/locales/ja.yml +1605 -0
- data/config/locales/ko-KR.yml +1 -0
- data/config/locales/ko.yml +1 -0
- data/config/locales/lt.yml +1 -0
- data/config/locales/{lv-LV.yml → lv.yml} +0 -4
- data/config/locales/mt.yml +1 -0
- data/config/locales/nl.yml +25 -3
- data/config/locales/no.yml +133 -6
- data/config/locales/om-ET.yml +1 -0
- data/config/locales/pl.yml +88 -71
- data/config/locales/pt-BR.yml +3 -4
- data/config/locales/pt.yml +10 -4
- data/config/locales/ro-RO.yml +10 -4
- data/config/locales/ru.yml +3 -10
- data/config/locales/sk.yml +3 -4
- data/config/locales/sl.yml +8 -7
- data/config/locales/so-SO.yml +1 -0
- data/config/locales/sr-CS.yml +0 -7
- data/config/locales/sv.yml +17 -6
- data/config/locales/ti-ER.yml +1 -0
- data/config/locales/tr-TR.yml +3 -4
- data/config/locales/uk.yml +3 -11
- data/config/locales/vi-VN.yml +1 -0
- data/config/locales/vi.yml +1 -0
- data/config/locales/zh-CN.yml +1584 -0
- data/config/locales/zh-TW.yml +1 -0
- data/db/migrate/20200525184143_add_enable_machine_translation_to_decidim_organizations.rb +7 -0
- data/db/migrate/20200702073419_create_decidim_share_tokens.rb +16 -0
- data/db/migrate/20200707132401_add_comments_max_length_to_decidim_organization.rb +7 -0
- data/db/migrate/20200730142511_add_file_upload_settings_to_decidim_organizations.rb +36 -0
- data/db/migrate/20200806092109_add_machine_translation_display_priority_to_organizations.rb +17 -0
- data/db/migrate/20201004160335_remove_notifications_with_continuity_badge.rb +9 -0
- data/db/seeds.rb +5 -4
- data/lib/decidim/authorable.rb +22 -1
- data/lib/decidim/authorization_form_builder.rb +7 -0
- data/lib/decidim/coauthorable.rb +22 -0
- data/lib/decidim/component_manifest.rb +1 -1
- data/lib/decidim/content_processor.rb +52 -29
- data/lib/decidim/content_renderers/base_renderer.rb +1 -1
- data/lib/decidim/content_renderers/hashtag_renderer.rb +2 -0
- data/lib/decidim/content_renderers/link_renderer.rb +4 -1
- data/lib/decidim/content_renderers/user_group_renderer.rb +3 -1
- data/lib/decidim/content_renderers/user_renderer.rb +3 -1
- data/lib/decidim/core.rb +67 -12
- data/lib/decidim/core/engine.rb +60 -21
- data/lib/decidim/core/test.rb +6 -0
- data/lib/decidim/core/test/factories.rb +34 -8
- data/lib/decidim/core/test/shared_examples/amendable/accept_amendment_examples.rb +4 -4
- data/lib/decidim/core/test/shared_examples/amendable_proposals_interface_examples.rb +8 -8
- data/lib/decidim/core/test/shared_examples/comments_examples.rb +52 -1
- data/lib/decidim/core/test/shared_examples/embed_resource_examples.rb +49 -0
- data/lib/decidim/core/test/shared_examples/follows_examples.rb +3 -3
- data/lib/decidim/core/test/shared_examples/manage_component_share_tokens.rb +83 -0
- data/lib/decidim/core/test/shared_examples/map_examples.rb +186 -0
- data/lib/decidim/core/test/shared_examples/preview_component_with_share_token_examples.rb +55 -0
- data/lib/decidim/core/test/shared_examples/resource_search_examples.rb +200 -0
- data/lib/decidim/core/test/shared_examples/scopable_resource_examples.rb +43 -0
- data/lib/decidim/core/test/shared_examples/scope_helper_examples.rb +12 -1
- data/lib/decidim/core/test/shared_examples/searchable_participatory_space_examples.rb +2 -2
- data/lib/decidim/core/test/shared_examples/searchable_results_examples.rb +15 -2
- data/lib/decidim/core/test/shared_examples/simple_event.rb +7 -0
- data/lib/decidim/core/test/shared_examples/system_endorse_resource_examples.rb +1 -0
- data/lib/decidim/core/test/shared_examples/traceable_interface_examples.rb +1 -1
- data/lib/decidim/core/test/shared_examples/uncommentable_component_examples.rb +1 -1
- data/lib/decidim/core/version.rb +1 -1
- data/lib/decidim/diffy_extension.rb +21 -0
- data/lib/decidim/events/base_event.rb +11 -9
- data/lib/decidim/exporters.rb +7 -0
- data/lib/decidim/exporters/csv.rb +15 -1
- data/lib/decidim/exporters/excel.rb +1 -1
- data/lib/decidim/exporters/export_manifest.rb +29 -0
- data/lib/decidim/exporters/pdf.rb +56 -0
- data/lib/decidim/file_validator_humanizer.rb +98 -0
- data/lib/decidim/form_builder.rb +65 -54
- data/lib/decidim/geocodable.rb +79 -0
- data/lib/decidim/has_attachments.rb +10 -0
- data/lib/decidim/has_upload_validations.rb +36 -0
- data/lib/decidim/map.rb +214 -0
- data/lib/decidim/map/autocomplete.rb +67 -0
- data/lib/decidim/map/dynamic_map.rb +89 -0
- data/lib/decidim/map/frontend.rb +97 -0
- data/lib/decidim/map/geocoding.rb +115 -0
- data/lib/decidim/map/provider.rb +12 -0
- data/lib/decidim/map/provider/autocomplete/here.rb +20 -0
- data/lib/decidim/map/provider/autocomplete/osm.rb +20 -0
- data/lib/decidim/map/provider/dynamic_map/here.rb +51 -0
- data/lib/decidim/map/provider/dynamic_map/osm.rb +13 -0
- data/lib/decidim/map/provider/geocoding/here.rb +58 -0
- data/lib/decidim/map/provider/geocoding/osm.rb +30 -0
- data/lib/decidim/map/provider/here.rb +21 -0
- data/lib/decidim/map/provider/osm.rb +22 -0
- data/lib/decidim/map/provider/static_map/here.rb +35 -0
- data/lib/decidim/map/provider/static_map/osm.rb +29 -0
- data/lib/decidim/map/static_map.rb +133 -0
- data/lib/decidim/map/utility.rb +38 -0
- data/lib/decidim/organization_settings.rb +267 -0
- data/lib/decidim/resource_manifest.rb +1 -1
- data/lib/decidim/scopable.rb +9 -6
- data/lib/decidim/scopable_component.rb +29 -1
- data/lib/decidim/scopable_participatory_space.rb +19 -0
- data/lib/decidim/scopable_resource.rb +21 -0
- data/lib/decidim/search_resource_fields_mapper.rb +15 -2
- data/lib/decidim/searchable.rb +4 -0
- data/lib/decidim/settings_manifest.rb +2 -1
- data/lib/decidim/shareable_with_token.rb +27 -0
- data/lib/decidim/snippets.rb +30 -0
- data/lib/decidim/translatable_attributes.rb +42 -4
- data/lib/decidim/translatable_resource.rb +78 -0
- data/lib/decidim/view_model.rb +1 -0
- data/lib/tasks/decidim_locales_tasks.rake +35 -0
- data/lib/tasks/decidim_tasks.rake +1 -0
- data/vendor/assets/javascripts/datepicker-locales/foundation-datepicker.bg.js +14 -0
- data/vendor/assets/javascripts/datepicker-locales/foundation-datepicker.da.js +14 -0
- data/vendor/assets/javascripts/datepicker-locales/foundation-datepicker.eo.js +17 -0
- data/vendor/assets/javascripts/datepicker-locales/foundation-datepicker.et.js +18 -0
- data/vendor/assets/javascripts/datepicker-locales/foundation-datepicker.fr-CA.js +16 -0
- data/vendor/assets/javascripts/datepicker-locales/foundation-datepicker.ga.js +15 -0
- data/vendor/assets/javascripts/datepicker-locales/foundation-datepicker.hr.js +13 -0
- data/vendor/assets/javascripts/datepicker-locales/foundation-datepicker.is.js +14 -0
- data/vendor/assets/javascripts/datepicker-locales/foundation-datepicker.ja.js +16 -0
- data/vendor/assets/javascripts/datepicker-locales/foundation-datepicker.lt.js +16 -0
- data/vendor/assets/javascripts/datepicker-locales/foundation-datepicker.lv.js +17 -0
- data/vendor/assets/javascripts/datepicker-locales/foundation-datepicker.mt.js +15 -0
- data/vendor/assets/javascripts/datepicker-locales/foundation-datepicker.sl.js +14 -0
- data/vendor/assets/javascripts/datepicker-locales/foundation-datepicker.sr.js +16 -0
- metadata +138 -26
- data/app/helpers/decidim/multi_translation_helper.rb +0 -0
- data/lib/decidim/hashtaggable.rb +0 -24
@@ -0,0 +1,87 @@
|
|
1
|
+
// = require leaflet
|
2
|
+
// = require leaflet-tilelayer-here
|
3
|
+
// = require leaflet-svg-icon
|
4
|
+
// = require leaflet.markercluster
|
5
|
+
// = require decidim/map/factory
|
6
|
+
// = require_self
|
7
|
+
|
8
|
+
/**
|
9
|
+
* @deprecated
|
10
|
+
*
|
11
|
+
* This adds support for the legacy style of map configuration and the methods
|
12
|
+
* available globally. This is not really needed unless someone is still relying
|
13
|
+
* on these methods or the have customizations that are hard to update.
|
14
|
+
*/
|
15
|
+
((exports) => {
|
16
|
+
exports.Decidim = exports.Decidim || {};
|
17
|
+
|
18
|
+
const legacyMapSupport = ($map) => {
|
19
|
+
const hereAppId = $map.data("here-app-id");
|
20
|
+
const hereAppCode = $map.data("here-app-code");
|
21
|
+
const hereApiKey = $map.data("here-api-key");
|
22
|
+
|
23
|
+
let mapApiConfig = null;
|
24
|
+
if (hereApiKey) {
|
25
|
+
mapApiConfig = { apiKey: hereApiKey };
|
26
|
+
} else if (hereAppId && hereAppCode) {
|
27
|
+
mapApiConfig = {
|
28
|
+
appId: hereAppId,
|
29
|
+
appCode: hereAppCode
|
30
|
+
};
|
31
|
+
} else {
|
32
|
+
throw new Error("Legacy map support: Please provide the HERE API configuration");
|
33
|
+
}
|
34
|
+
|
35
|
+
const markersData = $map.data("markers-data");
|
36
|
+
|
37
|
+
let markerColor = getComputedStyle(document.documentElement).getPropertyValue("--primary");
|
38
|
+
if (!markerColor || markerColor.length < 1) {
|
39
|
+
markerColor = "#ef604d";
|
40
|
+
}
|
41
|
+
|
42
|
+
// Configure the map element with the new style
|
43
|
+
const mapConfig = {
|
44
|
+
markerColor,
|
45
|
+
popupTemplateId: "marker-popup",
|
46
|
+
markers: markersData,
|
47
|
+
tileLayer: mapApiConfig
|
48
|
+
}
|
49
|
+
|
50
|
+
$map.data("decidim-map", mapConfig);
|
51
|
+
|
52
|
+
exports.Decidim.mapConfiguration = $.extend({
|
53
|
+
markerColor: markerColor
|
54
|
+
}, mapApiConfig);
|
55
|
+
};
|
56
|
+
|
57
|
+
const loadMap = (mapId, markersData) => {
|
58
|
+
// Allow the configured map service to configure the map, e.g. attaching the
|
59
|
+
// tile layer to the map.
|
60
|
+
const $map = $(`#${mapId}`);
|
61
|
+
$map.data("markers-data", markersData);
|
62
|
+
legacyMapSupport($map);
|
63
|
+
|
64
|
+
const mapData = $map.data("decidim-map");
|
65
|
+
const ctrl = exports.Decidim.createMapController(mapId, mapData);
|
66
|
+
const map = ctrl.load();
|
67
|
+
|
68
|
+
L.tileLayer.here(mapData.tileLayer).addTo(map);
|
69
|
+
|
70
|
+
ctrl.start();
|
71
|
+
|
72
|
+
exports.Decidim.currentMap = map;
|
73
|
+
|
74
|
+
return map;
|
75
|
+
};
|
76
|
+
|
77
|
+
$(() => {
|
78
|
+
const $map = $("#map");
|
79
|
+
if ($map.length > 0) {
|
80
|
+
loadMap($map.attr("id"), $map.data("markers-data"));
|
81
|
+
}
|
82
|
+
});
|
83
|
+
|
84
|
+
exports.Decidim.loadMap = loadMap;
|
85
|
+
exports.Decidim.currentMap = null;
|
86
|
+
exports.Decidim.mapConfiguration = {};
|
87
|
+
})(window);
|
@@ -0,0 +1,22 @@
|
|
1
|
+
// = require leaflet
|
2
|
+
// = require leaflet-svg-icon
|
3
|
+
// = require leaflet.markercluster
|
4
|
+
// = require_self
|
5
|
+
// = require decidim/map
|
6
|
+
|
7
|
+
/**
|
8
|
+
* NOTE:
|
9
|
+
* This has to load before decidim/map in order for it to apply correctly when
|
10
|
+
* the map is initialized. The document.ready handler set by this script has to
|
11
|
+
* be registered before decidim/map registers its own.
|
12
|
+
*/
|
13
|
+
((exports) => {
|
14
|
+
const $ = exports.$; // eslint-disable-line
|
15
|
+
|
16
|
+
$(() => {
|
17
|
+
$("[data-decidim-map]").on("configure.decidim", (_ev, map, mapConfig) => {
|
18
|
+
const tilesConfig = mapConfig.tileLayer;
|
19
|
+
L.tileLayer(tilesConfig.url, tilesConfig.options).addTo(map);
|
20
|
+
});
|
21
|
+
});
|
22
|
+
})(window);
|
@@ -0,0 +1,22 @@
|
|
1
|
+
// = require leaflet
|
2
|
+
// = require leaflet-tilelayer-here
|
3
|
+
// = require leaflet-svg-icon
|
4
|
+
// = require leaflet.markercluster
|
5
|
+
// = require_self
|
6
|
+
// = require decidim/map
|
7
|
+
|
8
|
+
/**
|
9
|
+
* NOTE:
|
10
|
+
* This has to load before decidim/map in order for it to apply correctly when
|
11
|
+
* the map is initialized. The document.ready handler set by this script has to
|
12
|
+
* be registered before decidim/map registers its own.
|
13
|
+
*/
|
14
|
+
((exports) => {
|
15
|
+
const $ = exports.$; // eslint-disable-line
|
16
|
+
|
17
|
+
$(() => {
|
18
|
+
$("[data-decidim-map]").on("configure.decidim", (_ev, map, mapConfig) => {
|
19
|
+
L.tileLayer.here(mapConfig.tileLayer).addTo(map);
|
20
|
+
});
|
21
|
+
});
|
22
|
+
})(window);
|
@@ -0,0 +1,19 @@
|
|
1
|
+
((exports) => {
|
2
|
+
const console = exports.console;
|
3
|
+
|
4
|
+
if (!console) {
|
5
|
+
return;
|
6
|
+
}
|
7
|
+
|
8
|
+
$(() => {
|
9
|
+
const config = exports.Decidim.config;
|
10
|
+
const allMessages = config.get("messages");
|
11
|
+
if (!allMessages) {
|
12
|
+
return;
|
13
|
+
}
|
14
|
+
const messages = allMessages.selfxssWarning;
|
15
|
+
|
16
|
+
console.log(`%c${messages.title}`, "color:#f00;font-weight:bold;font-size:50px;");
|
17
|
+
console.log(`%c${messages.description}`, "font-size:24px;");
|
18
|
+
});
|
19
|
+
})(window)
|
@@ -1084,3 +1084,18 @@ a .card__title{
|
|
1084
1084
|
}
|
1085
1085
|
}
|
1086
1086
|
}
|
1087
|
+
|
1088
|
+
// card row
|
1089
|
+
.card__row{
|
1090
|
+
@include flex;
|
1091
|
+
@include flex-align($x: left, $y: null);
|
1092
|
+
|
1093
|
+
> *{
|
1094
|
+
padding: $global-margin;
|
1095
|
+
flex: 0 0 25%;
|
1096
|
+
|
1097
|
+
&:not(:nth-child(4n)){
|
1098
|
+
border-right: $card-border;
|
1099
|
+
}
|
1100
|
+
}
|
1101
|
+
}
|
@@ -18,6 +18,20 @@ $help-text-margin-top: ($form-spacing * .5) * -1;
|
|
18
18
|
padding: .5rem 1rem;
|
19
19
|
}
|
20
20
|
|
21
|
+
label,
|
22
|
+
.field{
|
23
|
+
&.has-tribute{
|
24
|
+
position: relative;
|
25
|
+
|
26
|
+
.tribute-container{
|
27
|
+
top: auto;
|
28
|
+
margin-top: -$form-spacing;
|
29
|
+
max-width: none;
|
30
|
+
width: 100%;
|
31
|
+
}
|
32
|
+
}
|
33
|
+
}
|
34
|
+
|
21
35
|
.help-text{
|
22
36
|
display: block;
|
23
37
|
line-height: 1.2;
|
@@ -13,15 +13,15 @@
|
|
13
13
|
}
|
14
14
|
|
15
15
|
.wrapper-mini{
|
16
|
-
padding: 1.2rem 1rem;
|
16
|
+
padding: 1.2rem 1rem 0;
|
17
17
|
position: relative;
|
18
18
|
|
19
19
|
@include breakpoint(medium){
|
20
|
-
padding: 2rem 1.5rem;
|
20
|
+
padding: 2rem 1.5rem 0;
|
21
21
|
}
|
22
22
|
|
23
23
|
@include breakpoint(large){
|
24
|
-
padding: 3rem 4rem;
|
24
|
+
padding: 3rem 4rem 0;
|
25
25
|
}
|
26
26
|
}
|
27
27
|
|
@@ -72,3 +72,11 @@ body{
|
|
72
72
|
margin-right: -.5rem;
|
73
73
|
}
|
74
74
|
}
|
75
|
+
|
76
|
+
.translation-bar{
|
77
|
+
a.button{
|
78
|
+
margin-bottom: 0;
|
79
|
+
margin-top: -4px;
|
80
|
+
margin-right: 5px;
|
81
|
+
}
|
82
|
+
}
|
@@ -93,3 +93,38 @@
|
|
93
93
|
min-width: 12em;
|
94
94
|
}
|
95
95
|
}
|
96
|
+
|
97
|
+
.static-map{
|
98
|
+
cursor: pointer;
|
99
|
+
height: 120px;
|
100
|
+
width: 120px;
|
101
|
+
|
102
|
+
.leaflet-popup-pane,
|
103
|
+
.leaflet-control{
|
104
|
+
cursor: pointer;
|
105
|
+
}
|
106
|
+
|
107
|
+
&:focus{
|
108
|
+
outline: $anchor-outline-focus;
|
109
|
+
outline-color: var(--highlight);
|
110
|
+
outline-offset: $anchor-outline-offset;
|
111
|
+
}
|
112
|
+
|
113
|
+
&,
|
114
|
+
.leaflet-control-attribution{
|
115
|
+
a{
|
116
|
+
&:hover,
|
117
|
+
&:focus{
|
118
|
+
text-decoration: none;
|
119
|
+
outline: none;
|
120
|
+
}
|
121
|
+
}
|
122
|
+
}
|
123
|
+
|
124
|
+
&,
|
125
|
+
&.leaflet-touch{
|
126
|
+
.leaflet-control-attribution{
|
127
|
+
font-size: .55rem;
|
128
|
+
}
|
129
|
+
}
|
130
|
+
}
|
@@ -26,6 +26,11 @@
|
|
26
26
|
display: flex;
|
27
27
|
justify-content: center;
|
28
28
|
padding: 10px 0 50px; // bottom padding is needed to avoid hiding buttons on mobiles because of https://stackoverflow.com/questions/37112218/css3-100vh-not-constant-in-mobile-browser
|
29
|
+
|
30
|
+
@include breakpoint(medium){
|
31
|
+
padding-bottom: 0;
|
32
|
+
margin-bottom: -1rem;
|
33
|
+
}
|
29
34
|
}
|
30
35
|
}
|
31
36
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<% if
|
1
|
+
<% if flaggable? %>
|
2
2
|
<button type="button" class="link-alt" data-open="<%= current_user.present? ? "flagModal" : "loginModal" %>" title="<%= t("report", scope: "decidim.proposals.proposals.show") %>" aria-controls="<%= current_user.present? ? "flagModal" : "loginModal" %>" aria-haspopup="true" tabindex="0">
|
3
3
|
<%= icon "flag", aria_hidden: true, class: "icon--small", role: "img", "aria-hidden": true %>
|
4
4
|
<span class="show-for-sr">
|
@@ -18,7 +18,7 @@
|
|
18
18
|
data-allow-html="true"
|
19
19
|
data-template-classes="light expanded"
|
20
20
|
data-tip-text='<%= h render(:profile_minicard) %>'>
|
21
|
-
<%=
|
21
|
+
<%= author_name %>
|
22
22
|
</span>
|
23
23
|
|
24
24
|
<% if model.badge.present? %>
|
@@ -28,7 +28,7 @@
|
|
28
28
|
<% end %>
|
29
29
|
<% else %>
|
30
30
|
<span class="author__name">
|
31
|
-
<%=
|
31
|
+
<%= author_name %>
|
32
32
|
</span>
|
33
33
|
|
34
34
|
<% if model.badge.present? %>
|
@@ -18,6 +18,10 @@ module Decidim
|
|
18
18
|
|
19
19
|
delegate :current_user, to: :controller, prefix: false
|
20
20
|
|
21
|
+
def author_name
|
22
|
+
options[:author_name_text] || model.name
|
23
|
+
end
|
24
|
+
|
21
25
|
def show
|
22
26
|
render
|
23
27
|
end
|
@@ -56,7 +60,6 @@ module Decidim
|
|
56
60
|
|
57
61
|
def creation_date?
|
58
62
|
return unless from_context
|
59
|
-
return unless proposals_controller? || collaborative_drafts_controller? || posts_controller?
|
60
63
|
return unless show_action? && (from_context.respond_to?(:published_at) || from_context.respond_to?(:created_at))
|
61
64
|
|
62
65
|
true
|
@@ -83,7 +86,7 @@ module Decidim
|
|
83
86
|
def actionable?
|
84
87
|
return false if options[:has_actions] == false
|
85
88
|
|
86
|
-
|
89
|
+
withdrawable? || flaggable?
|
87
90
|
end
|
88
91
|
|
89
92
|
def user_author?
|
@@ -20,13 +20,11 @@ module Decidim
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def resource_cell
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
@resource_cell ||= "decidim/author"
|
29
|
-
end
|
23
|
+
@resource_cell ||= if resource_card
|
24
|
+
resource_card
|
25
|
+
elsif official_author? || user_or_user_group?
|
26
|
+
"decidim/author"
|
27
|
+
end
|
30
28
|
end
|
31
29
|
|
32
30
|
def title
|
@@ -36,5 +34,21 @@ module Decidim
|
|
36
34
|
def body
|
37
35
|
model.try(:body) || model.try(:about) || ""
|
38
36
|
end
|
37
|
+
|
38
|
+
def resource_manifest
|
39
|
+
model.try(:resource_manifest) || Decidim.find_resource_manifest(model.class)
|
40
|
+
end
|
41
|
+
|
42
|
+
def resource_card
|
43
|
+
resource_manifest&.card.presence
|
44
|
+
end
|
45
|
+
|
46
|
+
def official_author?
|
47
|
+
["Decidim::Proposals::OfficialAuthorPresenter", "Decidim::Debates::OfficialAuthorPresenter"].include? model.class.to_s
|
48
|
+
end
|
49
|
+
|
50
|
+
def user_or_user_group?
|
51
|
+
["Decidim::User", "Decidim::UserGroup"].include? model.model_name.name
|
52
|
+
end
|
39
53
|
end
|
40
54
|
end
|
@@ -19,13 +19,17 @@ module Decidim
|
|
19
19
|
private
|
20
20
|
|
21
21
|
def resource_path
|
22
|
-
resource_locator(model).path
|
22
|
+
resource_locator(model).path(filter_link_params)
|
23
23
|
end
|
24
24
|
|
25
25
|
def resource_image_path
|
26
26
|
nil
|
27
27
|
end
|
28
28
|
|
29
|
+
def has_header?
|
30
|
+
true
|
31
|
+
end
|
32
|
+
|
29
33
|
def has_image?
|
30
34
|
false
|
31
35
|
end
|
@@ -104,9 +108,7 @@ module Decidim
|
|
104
108
|
end
|
105
109
|
|
106
110
|
def comments_count
|
107
|
-
|
108
|
-
|
109
|
-
model.comments.count
|
111
|
+
model.comments_count
|
110
112
|
end
|
111
113
|
|
112
114
|
def statuses
|