decidim-voca 0.0.6 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/LICENSE.md +161 -161
- data/README.md +42 -133
- data/Rakefile +46 -39
- data/app/cells/decidim/footer_topics/show_overrides.erb +8 -0
- data/app/cells/decidim/meetings/dates_and_map/show_overrides.erb +23 -0
- data/app/commands/decidim/voca/admin/code_census/save_code_list.rb +34 -0
- data/app/commands/decidim/voca/code_census/confirm_code_authorization.rb +16 -0
- data/app/commands/decidim/voca/create_editor_file.rb +36 -0
- data/app/commands/decidim/voca/rack_attack_configurator.rb +244 -0
- data/app/commands/decidim/voca/sync_redis_routing.rb +120 -0
- data/app/commands/decidim/voca/user_fields_configurator.rb +40 -0
- data/app/controllers/decidim/voca/admin/application_controller.rb +4 -6
- data/app/controllers/decidim/voca/admin/code_census/code_lists_controller.rb +40 -0
- data/app/controllers/decidim/voca/application_controller.rb +4 -6
- data/app/controllers/decidim/voca/code_census/authorizations_controller.rb +53 -0
- data/app/controllers/decidim/voca/editor_files_controller.rb +47 -0
- data/app/controllers/decidim/voca/geolocation_controller.rb +32 -0
- data/app/forms/decidim/voca/admin/code_census/code_list_form.rb +21 -0
- data/app/forms/decidim/voca/admin/organization_config_form.rb +24 -0
- data/app/forms/decidim/voca/code_census/code_form.rb +41 -0
- data/app/forms/decidim/voca/editor_file_form.rb +18 -0
- data/app/jobs/decidim/voca/machine_translate_awesome_menu_label_job.rb +63 -0
- data/app/jobs/decidim/voca/machine_translate_component_setting_job.rb +58 -0
- data/app/jobs/decidim/voca/machine_translate_content_block_setting_job.rb +85 -0
- data/app/models/decidim/voca/conversation_uuid.rb +18 -0
- data/app/models/decidim/voca/editor_file.rb +18 -0
- data/app/models/decidim/voca/validation_code.rb +13 -0
- data/app/overrides/admin_add_machine_translation_flag.rb +40 -0
- data/app/overrides/insert_assets.rb +26 -0
- data/app/overrides/insert_weglot_scripts.rb +60 -0
- data/app/overrides/proposal_camera.rb +18 -0
- data/app/overrides/show_votes.rb +27 -0
- data/app/overrides/voca_footer.rb +52 -0
- data/app/packs/entrypoints/admin-decidim-voca.js +2 -0
- data/app/packs/entrypoints/admin-decidim-voca.scss +1 -0
- data/app/packs/entrypoints/decidim-voca-fixes.scss +1 -0
- data/app/packs/entrypoints/decidim-voca.js +1 -0
- data/app/packs/entrypoints/decidim-voca.scss +1 -0
- data/app/packs/images/voca-logo-primary-x3.png +0 -0
- data/app/packs/src/decidim/direct_uploads/upload_field.js +150 -0
- data/app/packs/src/decidim/voca/admin/voca.js +16 -0
- data/app/packs/src/decidim/voca/proposal_better_ux/use_camera_button.js +39 -0
- data/app/packs/src/decidim/voca/proposal_better_ux/utils/get_current_position.js +21 -0
- data/app/packs/src/decidim/voca/proposal_better_ux/utils/get_proposal_form.js +13 -0
- data/app/packs/src/decidim/voca/proposal_better_ux/utils/loading.js +23 -0
- data/app/packs/src/decidim/voca/proposal_better_ux/utils/locate_coordinates.js +23 -0
- data/app/packs/src/decidim/voca/proposal_custom_fields/custom_field_renderer_override.js +152 -0
- data/app/packs/src/decidim/voca/proposal_custom_fields/editor_budget_field.js +329 -0
- data/app/packs/src/decidim/voca/proposal_custom_fields/editor_upload_field.js +85 -0
- data/app/packs/src/decidim/voca/proposal_custom_fields/proposal_custom_fields.js +96 -0
- data/app/packs/src/decidim/voca/proposal_custom_fields/render_budget_field.js +76 -0
- data/app/packs/src/decidim/voca/proposal_fields/render_budget_field.js +76 -0
- data/app/packs/src/decidim/voca/questionnaire/scroll_questionnaire_steps_to_top.js +18 -0
- data/app/packs/src/decidim/voca/voca.js +4 -0
- data/app/packs/src/decidim/voca/weglot/index.js +13 -0
- data/app/packs/src/decidim/voca/weglot/start_weglot.js +112 -0
- data/app/packs/src/decidim/voca/weglot/switcher.js +92 -0
- data/app/packs/src/decidim/voca/weglot/wait_for_weglot.js +10 -0
- data/app/packs/stylesheets/decidim/voca/_custom_proposal_fields.scss +111 -0
- data/app/packs/stylesheets/decidim/voca/_decidim_voca.scss +5 -0
- data/app/packs/stylesheets/decidim/voca/_decidim_voca_fixes.scss +25 -0
- data/app/packs/stylesheets/decidim/voca/_primary_footer.scss +77 -0
- data/app/packs/stylesheets/decidim/voca/_proposal_camera.scss +14 -0
- data/app/packs/stylesheets/decidim/voca/_weglot.scss +61 -0
- data/app/packs/stylesheets/decidim/voca/admin/_decidim_voca.scss +5 -0
- data/app/packs/stylesheets/decidim/voca/admin/_full_machine_translation.scss +34 -0
- data/app/permissions/decidim/voca/admin/permissions.rb +31 -0
- data/app/permissions/decidim/voca/permissions.rb +17 -0
- data/app/views/decidim/voca/admin/code_census/authorizations/new.html.erb +33 -0
- data/app/views/decidim/voca/admin/code_census/code_lists/edit.html.erb +27 -0
- data/app/views/decidim/voca/code_census/authorizations/new.html.erb +24 -0
- data/app/views/decidim/voca/deepl/overrides/_admin_machine_translation_alert.html.erb +14 -0
- data/app/views/decidim/voca/rack_attack/_blocked.html.erb +151 -0
- data/app/views/decidim/voca/weglot/_js_configuration.html.erb +14 -0
- data/app/views/decidim/voca/weglot/_locale_switcher.html.erb +14 -0
- data/app/views/decidim/voca/weglot/_locale_switcher_mobile.erb +14 -0
- data/app/views/decidim/voca/weglot/_topbar_locale_switcher.html.erb +14 -0
- data/config/assets.rb +12 -0
- data/config/i18n-tasks.yml +14 -5
- data/config/locales/cs.yml +94 -0
- data/config/locales/custom_fields.cs.yml +30 -0
- data/config/locales/custom_fields.en.yml +41 -0
- data/config/locales/custom_fields.fr.yml +30 -0
- data/config/locales/custom_fields.it.yml +30 -0
- data/config/locales/en.yml +97 -4
- data/config/locales/fr.yml +102 -0
- data/config/locales/it.yml +94 -0
- data/lib/decidim/voca/awesome_menu_label_machine_translation.rb +73 -0
- data/lib/decidim/voca/awesome_menu_labels.rb +28 -0
- data/lib/decidim/voca/code_census/admin_engine.rb +22 -0
- data/lib/decidim/voca/code_census/engine.rb +29 -0
- data/lib/decidim/voca/code_census/workflow.rb +7 -0
- data/lib/decidim/voca/code_census.rb +4 -0
- data/lib/decidim/voca/component_setting_manifest.rb +27 -0
- data/lib/decidim/voca/component_setting_pending_locales.rb +33 -0
- data/lib/decidim/voca/component_translated_settings_machine_translation.rb +86 -0
- data/lib/decidim/voca/configuration.rb +23 -0
- data/lib/decidim/voca/content_block_setting_manifest.rb +67 -0
- data/lib/decidim/voca/content_block_translated_settings_machine_translation.rb +100 -0
- data/lib/decidim/voca/deepl/deepl_active_job_context.rb +27 -0
- data/lib/decidim/voca/deepl/deepl_context.rb +78 -0
- data/lib/decidim/voca/deepl/deepl_form_builder_overrides.rb +82 -0
- data/lib/decidim/voca/deepl/deepl_machine_translator.rb +61 -0
- data/lib/decidim/voca/deepl/deepl_middleware.rb +83 -0
- data/lib/decidim/voca/deepl/engine_config.rb +181 -0
- data/lib/decidim/voca/deepl/settings.rb +75 -0
- data/lib/decidim/voca/deepl/translation_bar_overrides.rb +20 -0
- data/lib/decidim/voca/deepl.rb +10 -0
- data/lib/decidim/voca/engine.rb +320 -11
- data/lib/decidim/voca/export/comment_serializer_localized_csv.rb +34 -0
- data/lib/decidim/voca/export/csv_with_locale_transformer.rb +53 -0
- data/lib/decidim/voca/export/proposal_serializer_localized_csv.rb +45 -0
- data/lib/decidim/voca/export/user_answers_serializer_localized_csv.rb +54 -0
- data/lib/decidim/voca/installation.rb +33 -0
- data/lib/decidim/voca/machine_translation/translate_string.rb +121 -0
- data/lib/decidim/voca/machine_translation_human_source.rb +29 -0
- data/lib/decidim/voca/machine_translation_resource_job_voca.rb +65 -0
- data/lib/decidim/voca/organization_voca_extensions.rb +31 -0
- data/lib/decidim/voca/overrides/csv_export_serializers.rb +51 -0
- data/lib/decidim/voca/overrides/meetings/dates_and_map_cell_overrides.rb +20 -0
- data/lib/decidim/voca/overrides/menu_breadcrumb_last_activity_cache.rb +31 -0
- data/lib/decidim/voca/overrides/mod_secure/conversation_controller_overrides.rb +19 -0
- data/lib/decidim/voca/overrides/mod_secure/conversation_sanitize.rb +29 -0
- data/lib/decidim/voca/overrides/mod_secure/conversation_uuid.rb +34 -0
- data/lib/decidim/voca/overrides/mod_secure/user_conversations_redirect_overrides.rb +53 -0
- data/lib/decidim/voca/overrides/mod_secure/user_profile_verification_override.rb +31 -0
- data/lib/decidim/voca/overrides/newsletter_helper_overrides.rb +30 -0
- data/lib/decidim/voca/overrides/resource_presenter_overrides.rb +30 -0
- data/lib/decidim/voca/overrides/sanitize_helper_overrides.rb +39 -0
- data/lib/decidim/voca/sync_locales/README.md +13 -0
- data/lib/decidim/voca/sync_locales/awesome_menu_label_sync.rb +89 -0
- data/lib/decidim/voca/sync_locales/command.rb +54 -0
- data/lib/decidim/voca/sync_locales/component_setting_sync.rb +72 -0
- data/lib/decidim/voca/sync_locales/content_block_setting_sync.rb +86 -0
- data/lib/decidim/voca/sync_locales/field_hash_normalizer.rb +98 -0
- data/lib/decidim/voca/sync_locales/locale_context.rb +589 -0
- data/lib/decidim/voca/sync_locales/machine_translation_enqueuer.rb +60 -0
- data/lib/decidim/voca/sync_locales/relation_lint_runner.rb +55 -0
- data/lib/decidim/voca/sync_locales/runner.rb +352 -0
- data/lib/decidim/voca/sync_locales.rb +11 -0
- data/lib/decidim/voca/update_column_without_callbacks.rb +21 -0
- data/lib/decidim/voca/version.rb +13 -3
- data/lib/decidim/voca.rb +40 -14
- data/lib/decidim-voca.rb +5 -0
- data/lib/tasks/decidim/voca/voca_anonymize.rake +41 -0
- data/lib/tasks/decidim/voca/voca_clean_machine_translations.rake +22 -0
- data/lib/tasks/decidim/voca/voca_enhanced_invalid_record.rake +141 -0
- data/lib/tasks/decidim/voca/voca_install_migration.rake +45 -0
- data/lib/tasks/decidim/voca/voca_relation_lint.rake +12 -0
- data/lib/tasks/decidim/voca/voca_sync_locales.rake +10 -0
- data/lib/tasks/decidim/voca/voca_upgrade.rake +13 -0
- data/lib/tasks/decidim/voca/voca_webpacker.rake +58 -0
- metadata +247 -55
- data/app/assets/config/voca_manifest.js +0 -0
- data/app/assets/images/decidim/voca/icon.svg +0 -1
- data/app/commands/decidim/voca/organization/command.rb +0 -16
- data/app/commands/decidim/voca/organization/organization_command.rb +0 -17
- data/app/commands/decidim/voca/organization/update_color_command.rb +0 -35
- data/app/commands/decidim/voca/organization/update_environment_command.rb +0 -23
- data/app/commands/decidim/voca/organization/update_feature_command.rb +0 -32
- data/app/commands/decidim/voca/organization/update_file_upload_command.rb +0 -45
- data/app/commands/decidim/voca/organization/update_locale_command.rb +0 -53
- data/app/commands/decidim/voca/organization/update_naming_command.rb +0 -30
- data/app/commands/decidim/voca/organization/update_permission_command.rb +0 -31
- data/app/commands/decidim/voca/organization/update_smtp_command.rb +0 -51
- data/app/jobs/decidim/voca/command_job.rb +0 -36
- data/app/jobs/decidim/voca/webhook_notifier_job.rb +0 -57
- data/app/rpc/decidim/voca/decidim_service_controller.rb +0 -68
- data/app/rpc/decidim/voca/rpc/enum_casting.rb +0 -58
- data/app/rpc/decidim/voca/rpc/get_settings.rb +0 -144
- data/app/rpc/decidim/voca/rpc/health.rb +0 -18
- data/app/rpc/decidim/voca/rpc/seed_admin.rb +0 -75
- data/app/rpc/decidim/voca/rpc/set_settings.rb +0 -56
- data/app/rpc/decidim/voca/rpc/setup_db.rb +0 -38
- data/config/environments/development.rb +0 -6
- data/config/spring.rb +0 -2
- data/lib/decidim/voca/admin.rb +0 -10
- data/lib/decidim/voca/admin_engine.rb +0 -27
- data/lib/decidim/voca/backup/app_backup.rb +0 -169
- data/lib/decidim/voca/backup/app_decrypt_backup_file.rb +0 -50
- data/lib/decidim/voca/backup/app_encrypt_backup_file.rb +0 -49
- data/lib/decidim/voca/backup/app_upload_to_s3.rb +0 -49
- data/lib/decidim/voca/middleware/dynamic_config_middleware.rb +0 -42
- data/lib/decidim/voca/rpc/decidim_pb.rb +0 -134
- data/lib/decidim/voca/rpc/decidim_services_pb.rb +0 -30
- data/lib/decidim/voca/test/factories.rb +0 -9
- data/lib/decidim/voca/updater.rb +0 -50
- data/lib/tasks/voca.rake +0 -88
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Decidim
|
|
4
|
+
module Voca
|
|
5
|
+
module CodeCensus
|
|
6
|
+
class CodeForm < AuthorizationHandler
|
|
7
|
+
attribute :code, String
|
|
8
|
+
|
|
9
|
+
validates :code, presence: true
|
|
10
|
+
validate :code_exists
|
|
11
|
+
|
|
12
|
+
def metadata
|
|
13
|
+
{ code: code.to_s.strip }
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def unique_id
|
|
17
|
+
code.to_s.strip
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
private
|
|
21
|
+
|
|
22
|
+
def code_exists
|
|
23
|
+
return if validation_code.present?
|
|
24
|
+
|
|
25
|
+
errors.add(:code, I18n.t("decidim.voca.code_census.authorizations.create.error"))
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def validation_code
|
|
29
|
+
@validation_code ||= Decidim::Voca::ValidationCode.find_by(
|
|
30
|
+
decidim_organization_id: organization.id,
|
|
31
|
+
code: code.to_s.strip
|
|
32
|
+
)
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def organization
|
|
36
|
+
current_organization || user.organization
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Decidim
|
|
4
|
+
module Voca
|
|
5
|
+
class EditorFileForm < ::Decidim::Form
|
|
6
|
+
mimic :editor_file
|
|
7
|
+
|
|
8
|
+
attribute :file
|
|
9
|
+
attribute :author_id, Integer
|
|
10
|
+
attribute :path, String
|
|
11
|
+
|
|
12
|
+
validates :author_id, presence: true
|
|
13
|
+
validates :file, presence: true
|
|
14
|
+
|
|
15
|
+
alias organization current_organization
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Decidim
|
|
4
|
+
module Voca
|
|
5
|
+
# Persists machine translation for one Awesome menu item label (nested JSONB in +value+).
|
|
6
|
+
class MachineTranslateAwesomeMenuLabelJob < Decidim::ApplicationJob
|
|
7
|
+
queue_as :translations
|
|
8
|
+
|
|
9
|
+
def perform(awesome_config_id, item_url, target_locale, source_locale)
|
|
10
|
+
return unless Decidim.machine_translation_service_klass
|
|
11
|
+
return unless defined?(Decidim::DecidimAwesome::AwesomeConfig)
|
|
12
|
+
|
|
13
|
+
config = Decidim::DecidimAwesome::AwesomeConfig.find_by(id: awesome_config_id)
|
|
14
|
+
return unless config
|
|
15
|
+
|
|
16
|
+
source_text = extract_source_text(config, item_url, source_locale)
|
|
17
|
+
return if source_text.blank?
|
|
18
|
+
|
|
19
|
+
translated = MachineTranslation::TranslateString.call(
|
|
20
|
+
text: source_text,
|
|
21
|
+
source_locale:,
|
|
22
|
+
target_locale:,
|
|
23
|
+
html: false,
|
|
24
|
+
context: "Decidim::DecidimAwesome::AwesomeConfig id=#{config.id} url=#{item_url}"
|
|
25
|
+
)
|
|
26
|
+
return if translated.nil?
|
|
27
|
+
|
|
28
|
+
config.with_lock do
|
|
29
|
+
merge_translation_into_value(config, item_url, target_locale, translated)
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
private
|
|
34
|
+
|
|
35
|
+
def extract_source_text(config, item_url, source_locale)
|
|
36
|
+
item = find_item(config.value, item_url)
|
|
37
|
+
return unless item
|
|
38
|
+
|
|
39
|
+
label = item["label"]
|
|
40
|
+
return unless label.is_a?(Hash)
|
|
41
|
+
|
|
42
|
+
label[source_locale.to_s].presence || label[source_locale.to_sym].presence
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def merge_translation_into_value(config, item_url, target_locale, translated)
|
|
46
|
+
items = AwesomeMenuLabels.menu_items(config.reload.value)
|
|
47
|
+
item = items.find { |i| i["url"].to_s == item_url.to_s }
|
|
48
|
+
return unless item
|
|
49
|
+
|
|
50
|
+
label = item["label"]
|
|
51
|
+
return unless label.is_a?(Hash)
|
|
52
|
+
|
|
53
|
+
label["machine_translations"] ||= {}
|
|
54
|
+
label["machine_translations"][target_locale.to_s] = translated
|
|
55
|
+
UpdateColumnWithoutCallbacks.call(config, :value, items)
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
def find_item(value, item_url)
|
|
59
|
+
AwesomeMenuLabels.menu_items(value).find { |i| i["url"].to_s == item_url.to_s }
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Decidim
|
|
4
|
+
module Voca
|
|
5
|
+
# Persists machine translation for a single translated global component setting (nested JSONB).
|
|
6
|
+
class MachineTranslateComponentSettingJob < Decidim::ApplicationJob
|
|
7
|
+
queue_as :translations
|
|
8
|
+
|
|
9
|
+
# @param html [Boolean] rich text (+true+) vs plain (+false+)
|
|
10
|
+
# @param [Object] component_id
|
|
11
|
+
# @param [Object] setting_key
|
|
12
|
+
# @param [Object] target_locale
|
|
13
|
+
# @param [Object] source_locale
|
|
14
|
+
def perform(component_id, setting_key, target_locale, source_locale, html: true)
|
|
15
|
+
return unless Decidim.machine_translation_service_klass
|
|
16
|
+
|
|
17
|
+
component = Decidim::Component.find_by(id: component_id)
|
|
18
|
+
return unless component
|
|
19
|
+
|
|
20
|
+
source_text = extract_source_text(component, setting_key, source_locale)
|
|
21
|
+
return if source_text.blank?
|
|
22
|
+
|
|
23
|
+
translated = MachineTranslation::TranslateString.call(
|
|
24
|
+
text: source_text,
|
|
25
|
+
source_locale:,
|
|
26
|
+
target_locale:,
|
|
27
|
+
html:,
|
|
28
|
+
context: "Decidim::Component id=#{component.id} setting=#{setting_key}"
|
|
29
|
+
)
|
|
30
|
+
return if translated.nil?
|
|
31
|
+
|
|
32
|
+
component.with_lock do
|
|
33
|
+
merge_translation_into_settings(component, setting_key, target_locale, translated)
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
private
|
|
38
|
+
|
|
39
|
+
def extract_source_text(component, setting_key, source_locale)
|
|
40
|
+
field = (component.read_attribute(:settings) || {}).deep_dup.deep_stringify_keys.dig("global", setting_key.to_s)
|
|
41
|
+
return unless field.is_a?(Hash)
|
|
42
|
+
|
|
43
|
+
field[source_locale.to_s].presence || field[source_locale.to_sym].presence
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def merge_translation_into_settings(component, setting_key, target_locale, translated)
|
|
47
|
+
fresh = (component.reload.read_attribute(:settings) || {}).deep_dup.deep_stringify_keys
|
|
48
|
+
fg = fresh["global"] ||= {}
|
|
49
|
+
f = fg[setting_key.to_s]
|
|
50
|
+
return unless f.is_a?(Hash)
|
|
51
|
+
|
|
52
|
+
f["machine_translations"] ||= {}
|
|
53
|
+
f["machine_translations"][target_locale.to_s] = translated
|
|
54
|
+
UpdateColumnWithoutCallbacks.call(component, :settings, fresh)
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Decidim
|
|
4
|
+
module Voca
|
|
5
|
+
# Persists machine translation for a single translated content-block setting.
|
|
6
|
+
# Writes Decidim-canonical flat keys (+welcome_text_en+) so front/admin resolve EN.
|
|
7
|
+
class MachineTranslateContentBlockSettingJob < Decidim::ApplicationJob
|
|
8
|
+
queue_as :translations
|
|
9
|
+
|
|
10
|
+
# @param html [Boolean] rich text (+true+) vs plain (+false+)
|
|
11
|
+
# @param [Object] content_block_id
|
|
12
|
+
# @param [Object] setting_key
|
|
13
|
+
# @param [Object] target_locale
|
|
14
|
+
# @param [Object] source_locale
|
|
15
|
+
def perform(content_block_id, setting_key, target_locale, source_locale, html: false)
|
|
16
|
+
return unless Decidim.machine_translation_service_klass
|
|
17
|
+
|
|
18
|
+
content_block = Decidim::ContentBlock.find_by(id: content_block_id)
|
|
19
|
+
return unless content_block
|
|
20
|
+
|
|
21
|
+
source_text = extract_source_text(content_block, setting_key, source_locale)
|
|
22
|
+
return if source_text.blank?
|
|
23
|
+
|
|
24
|
+
translated = translate_text(
|
|
25
|
+
source_text,
|
|
26
|
+
source_locale,
|
|
27
|
+
target_locale,
|
|
28
|
+
html,
|
|
29
|
+
"Decidim::ContentBlock id=#{content_block.id} setting=#{setting_key}"
|
|
30
|
+
)
|
|
31
|
+
return if translated.nil?
|
|
32
|
+
|
|
33
|
+
content_block.with_lock do
|
|
34
|
+
merge_translation_into_settings(content_block, setting_key, target_locale, source_locale, translated)
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
private
|
|
39
|
+
|
|
40
|
+
def extract_source_text(content_block, setting_key, source_locale)
|
|
41
|
+
settings = (content_block.read_attribute(:settings) || {}).deep_dup.deep_stringify_keys
|
|
42
|
+
keys = [setting_key.to_s]
|
|
43
|
+
locales = content_block.organization.available_locales.map(&:to_s)
|
|
44
|
+
ContentBlockSettingManifest.coalesce_flat_keys!(settings, keys, locales)
|
|
45
|
+
|
|
46
|
+
field = settings[setting_key.to_s]
|
|
47
|
+
return unless field.is_a?(Hash)
|
|
48
|
+
|
|
49
|
+
field[source_locale.to_s].presence || field[source_locale.to_sym].presence
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def translate_text(source_text, source_locale, target_locale, html, context)
|
|
53
|
+
MachineTranslation::TranslateString.call(
|
|
54
|
+
text: source_text,
|
|
55
|
+
source_locale:,
|
|
56
|
+
target_locale:,
|
|
57
|
+
html:,
|
|
58
|
+
context:
|
|
59
|
+
)
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
def merge_translation_into_settings(content_block, setting_key, target_locale, source_locale, translated)
|
|
63
|
+
fresh = (content_block.reload.read_attribute(:settings) || {}).deep_dup.deep_stringify_keys
|
|
64
|
+
keys = [setting_key.to_s]
|
|
65
|
+
locales = content_block.organization.available_locales.map(&:to_s)
|
|
66
|
+
ContentBlockSettingManifest.coalesce_flat_keys!(fresh, keys, locales)
|
|
67
|
+
|
|
68
|
+
field = fresh[setting_key.to_s]
|
|
69
|
+
return unless field.is_a?(Hash)
|
|
70
|
+
|
|
71
|
+
field["machine_translations"] ||= {}
|
|
72
|
+
field["machine_translations"][target_locale.to_s] = translated
|
|
73
|
+
# Keep human source at the default locale root for expand.
|
|
74
|
+
field[source_locale.to_s] ||= extract_source_from_field(field, source_locale)
|
|
75
|
+
|
|
76
|
+
ContentBlockSettingManifest.expand_to_flat_keys!(fresh, keys)
|
|
77
|
+
UpdateColumnWithoutCallbacks.call(content_block, :settings, fresh)
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
def extract_source_from_field(field, source_locale)
|
|
81
|
+
field[source_locale.to_s].presence || field[source_locale.to_sym].presence
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Decidim
|
|
4
|
+
module Voca
|
|
5
|
+
class ConversationUuid < ApplicationRecord
|
|
6
|
+
self.table_name = "decidim_voca_conversation_uuids"
|
|
7
|
+
|
|
8
|
+
before_create :generate_uuid
|
|
9
|
+
belongs_to :conversation, foreign_key: :decidim_conversation_id, class_name: "Decidim::Messaging::Conversation"
|
|
10
|
+
|
|
11
|
+
private
|
|
12
|
+
|
|
13
|
+
def generate_uuid
|
|
14
|
+
self.uuid = SecureRandom.uuid
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Decidim
|
|
4
|
+
module Voca
|
|
5
|
+
class EditorFile < ApplicationRecord
|
|
6
|
+
include Decidim::HasUploadValidations
|
|
7
|
+
|
|
8
|
+
self.table_name = "decidim_voca_editor_files"
|
|
9
|
+
|
|
10
|
+
belongs_to :author, foreign_key: :decidim_author_id, class_name: "Decidim::User"
|
|
11
|
+
belongs_to :organization, foreign_key: :decidim_organization_id, class_name: "Decidim::Organization"
|
|
12
|
+
|
|
13
|
+
has_one_attached :file
|
|
14
|
+
validates :file, presence: true
|
|
15
|
+
validates_upload :file
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Decidim
|
|
4
|
+
module Voca
|
|
5
|
+
class ValidationCode < ApplicationRecord
|
|
6
|
+
self.table_name = "voca_validation_codes"
|
|
7
|
+
|
|
8
|
+
belongs_to :organization, class_name: "Decidim::Organization", foreign_key: :decidim_organization_id
|
|
9
|
+
|
|
10
|
+
validates :code, presence: true, length: { minimum: 3 }
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Add a flag on main.main to indicate the current organization is using admin
|
|
4
|
+
# with machine translation enabled.
|
|
5
|
+
# This will be used to hide the language chooser and the language tabs in text fields.
|
|
6
|
+
#
|
|
7
|
+
# :original = SHA1(match) without whitespace (Deface); Decidim 0.29.7 admin templates.
|
|
8
|
+
|
|
9
|
+
module AdminAddMachineTranslationFlag
|
|
10
|
+
Deface::Override.new(
|
|
11
|
+
virtual_path: "layouts/decidim/admin/_title_bar_responsive",
|
|
12
|
+
name: "admin_voca_machine_translation_responsive_flag",
|
|
13
|
+
set_attributes: ".title-bar",
|
|
14
|
+
attributes: {
|
|
15
|
+
"data-machine-translated" => "<%= current_organization.enable_machine_translations? %>",
|
|
16
|
+
"data-minimalistic-deepl" => "<%= current_organization.minimalistic_deepl? %>"
|
|
17
|
+
},
|
|
18
|
+
original: "9e9359026457bb1a289c94b183011e814d64893d"
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
Deface::Override.new(
|
|
22
|
+
virtual_path: "layouts/decidim/admin/_title_bar",
|
|
23
|
+
name: "admin_voca_machine_translation_desktop_flag",
|
|
24
|
+
set_attributes: ".title-bar",
|
|
25
|
+
attributes: {
|
|
26
|
+
"data-machine-translated" => "<%= current_organization.enable_machine_translations? %>",
|
|
27
|
+
"data-minimalistic-deepl" => "<%= current_organization.minimalistic_deepl? %>"
|
|
28
|
+
},
|
|
29
|
+
original: "978289390dedd19463db6ac36784ca94ae4a7d30"
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
# Force admin to manage only default locale, and let machine translation do the rest.
|
|
33
|
+
Deface::Override.new(
|
|
34
|
+
virtual_path: "layouts/decidim/admin/_js_configuration",
|
|
35
|
+
name: "admin_voca_force_only_default_locale",
|
|
36
|
+
insert_after: "script",
|
|
37
|
+
partial: "decidim/voca/deepl/overrides/admin_machine_translation_alert",
|
|
38
|
+
original: "387d0b7c5fc52d2ee5e5c6d4b276791d69b4432e"
|
|
39
|
+
)
|
|
40
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Add css/js for admin
|
|
4
|
+
module InsertAssets
|
|
5
|
+
Deface::Override.new(
|
|
6
|
+
virtual_path: "layouts/decidim/admin/_header",
|
|
7
|
+
name: "admin_voca_css_pack",
|
|
8
|
+
insert_before: "erb[loud]:contains('stylesheet_pack_tag')",
|
|
9
|
+
text: "<%= append_stylesheet_pack_tag 'admin_decidim_voca' %><%= append_javascript_pack_tag 'admin_decidim_voca_js' %>"
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
# Add js/css for frontpage
|
|
13
|
+
Deface::Override.new(
|
|
14
|
+
virtual_path: "layouts/decidim/_head",
|
|
15
|
+
name: "voca_css_pack",
|
|
16
|
+
insert_before: "erb[loud]:contains('decidim_overrides')",
|
|
17
|
+
text: "<%= append_stylesheet_pack_tag 'decidim_voca' %><%= prepend_javascript_pack_tag 'decidim_voca_js' %>"
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
Deface::Override.new(
|
|
21
|
+
virtual_path: "layouts/decidim/_head",
|
|
22
|
+
name: "voca_css_fixes_pack",
|
|
23
|
+
insert_after: "erb[loud]:contains('decidim_overrides')",
|
|
24
|
+
text: "<%= append_stylesheet_pack_tag 'decidim_voca_fixes' %>"
|
|
25
|
+
)
|
|
26
|
+
end
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module InsertWeglotScripts
|
|
4
|
+
Deface::Override.new(
|
|
5
|
+
virtual_path: "layouts/decidim/_js_configuration",
|
|
6
|
+
name: "insert_weglot_scripts",
|
|
7
|
+
insert_after: "script",
|
|
8
|
+
partial: "decidim/voca/weglot/js_configuration"
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
# Add a locale switcher for weglot
|
|
12
|
+
Deface::Override.new(
|
|
13
|
+
virtual_path: "layouts/decidim/footer/_main_language_chooser",
|
|
14
|
+
name: "insert_weglot_locale_switcher",
|
|
15
|
+
surround: "erb[silent]:contains('available_locales.length > 1')",
|
|
16
|
+
closing_selector: "erb[silent]:contains('end')",
|
|
17
|
+
text: <<~ERB
|
|
18
|
+
<% if current_organization.weglot? %>
|
|
19
|
+
<%= render partial: "decidim/voca/weglot/locale_switcher", locals: { switcher_id: "desktop" } %>
|
|
20
|
+
<% end %>
|
|
21
|
+
<div class="voca-js--original-language-chooser" data-weglot-active="<%= current_organization.weglot? %>">
|
|
22
|
+
<%= render_original %>
|
|
23
|
+
</div>
|
|
24
|
+
ERB
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
# layouts/decidim/header/_mobile_language_chooser
|
|
28
|
+
Deface::Override.new(
|
|
29
|
+
virtual_path: "layouts/decidim/header/_mobile_language_choose",
|
|
30
|
+
name: "insert_weglot_mobile_language_chooser",
|
|
31
|
+
surround: "erb[silent]:contains('available_locales.length > 1')",
|
|
32
|
+
closing_selector: "erb[silent]:contains('end')",
|
|
33
|
+
text: <<~ERB
|
|
34
|
+
<% if current_organization.weglot? %>
|
|
35
|
+
<%= render partial: "decidim/voca/weglot/locale_switcher_mobile", locals: { switcher_id: "mobile" } %>
|
|
36
|
+
<% end %>
|
|
37
|
+
<div class="voca-js--original-language-chooser" data-weglot-active="<%= current_organization.weglot? %>">
|
|
38
|
+
<%= render_original %>
|
|
39
|
+
</div>
|
|
40
|
+
ERB
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
Deface::Override.new(
|
|
44
|
+
virtual_path: "layouts/decidim/header/_main_links_desktop",
|
|
45
|
+
name: "insert_weglot_main_links_desktop_classes",
|
|
46
|
+
set_attributes: "div:has(erb[loud]:contains('decidim.pages_path'))",
|
|
47
|
+
attributes: {
|
|
48
|
+
class: "main-bar__links-desktop__item-wrapper"
|
|
49
|
+
}
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
Deface::Override.new(
|
|
53
|
+
virtual_path: "layouts/decidim/header/_main_links_desktop",
|
|
54
|
+
name: "insert_weglot_main_links_desktop",
|
|
55
|
+
insert_bottom: "div:has(erb[loud]:contains('decidim.pages_path'))",
|
|
56
|
+
text: <<~ERB
|
|
57
|
+
<%= render partial: "decidim/voca/weglot/topbar_locale_switcher" %>
|
|
58
|
+
ERB
|
|
59
|
+
)
|
|
60
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module ProposalCamera
|
|
4
|
+
Deface::Override.new(
|
|
5
|
+
virtual_path: "decidim/proposals/proposals/_edit_form_fields",
|
|
6
|
+
name: "feat_proposal_camera_button",
|
|
7
|
+
insert_after: "erb[loud]:contains('form.attachment :attachments')",
|
|
8
|
+
text: <<~ERB
|
|
9
|
+
<label class="button button__lg button__transparent-secondary w-full use_camera">
|
|
10
|
+
<%= icon "camera", class: "use_camera__icon" %>
|
|
11
|
+
<span class="use_camera__label">
|
|
12
|
+
<%= t("decidim.voca.proposals.take_photo") %>
|
|
13
|
+
</span>
|
|
14
|
+
<input type="file" name="photo_placeholder" class="use_camera__input hidden hide" accept="image/*" capture="environment">
|
|
15
|
+
</label>
|
|
16
|
+
ERB
|
|
17
|
+
)
|
|
18
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module ShowVotes
|
|
4
|
+
Deface::Override.new(
|
|
5
|
+
virtual_path: "decidim/proposals/admin/proposals/_proposals-thead",
|
|
6
|
+
name: "show_votes_th",
|
|
7
|
+
replace_contents: "erb[silent]:contains('if current_settings.votes_enabled?')",
|
|
8
|
+
closing_selector: "erb[silent]:contains('end')",
|
|
9
|
+
text: "<th>
|
|
10
|
+
<%= sort_link(query, :proposal_votes_count, t('models.proposal.fields.votes_on_going', scope: 'decidim.proposals') ) %>
|
|
11
|
+
</th>
|
|
12
|
+
<% else %>
|
|
13
|
+
<th>
|
|
14
|
+
<%= sort_link(query, :proposal_votes_count, t('models.proposal.fields.votes', scope: 'decidim.proposals') ) %>
|
|
15
|
+
</th>"
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
Deface::Override.new(
|
|
19
|
+
virtual_path: "decidim/proposals/admin/proposals/_proposal-tr",
|
|
20
|
+
name: "show_votes_tr",
|
|
21
|
+
replace: "erb[silent]:contains('if current_settings.votes_enabled?')",
|
|
22
|
+
closing_selector: "erb[silent]:contains('end')",
|
|
23
|
+
text: "<td>
|
|
24
|
+
<%= proposal.proposal_votes_count %>
|
|
25
|
+
</td>"
|
|
26
|
+
)
|
|
27
|
+
end
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Remove CC-BY-SA mention and replace it by voca logo
|
|
4
|
+
# CC-BY-SA is not the default license for platform content
|
|
5
|
+
|
|
6
|
+
module VocaFooter
|
|
7
|
+
Deface::Override.new(virtual_path: "layouts/decidim/footer/_mini",
|
|
8
|
+
name: "add_voca_icon",
|
|
9
|
+
replace: "a.flex.gap-1",
|
|
10
|
+
text: <<~SVG
|
|
11
|
+
<div class="voca__footer-wrapper">
|
|
12
|
+
<a href="https://voca.city" class="voca__footer-link " target="_blank">
|
|
13
|
+
<svg class="voca__footer-logo" viewBox="0 0 400 124" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
14
|
+
<path d="M190.986 39.5683C190.682 40.8706 190.028 41.4015 188.966 41.6271L188.34 40.787L185.381 38.9752C185.381 38.4936 185.475 38.1432 185.362 37.8842C185.142 37.384 184.844 36.8785 185.024 36.3507C185.303 35.534 185.598 34.6875 186.077 33.9824C186.793 32.9299 187.674 31.9897 188.432 31.0659H189.424C190.274 31.8036 191.057 32.3316 191.635 33.0298C192.217 33.7341 192.595 34.6077 193.098 35.4686C191.876 36.8051 190.814 38.1079 190.986 39.5683Z" fill="white"/>
|
|
15
|
+
<path d="M154.7 16.0204C154.845 16.8297 155.766 17.222 155.816 18.1837C155.84 18.6302 156.068 18.9914 155.775 19.4804C155.454 20.016 155.305 20.6548 155.081 21.2469C155.004 21.1805 154.916 21.1044 154.829 21.0279C154.221 21.508 154.126 21.6231 153.701 22.7195L150.463 23.5542C149.743 23.0627 148.73 22.9387 147.901 22.3806C147.707 20.9891 146.098 20.0544 146.681 18.391L147.614 17.434C147.799 17.5605 147.993 17.674 148.195 17.7737C149.096 18.1524 149.834 17.7092 150.476 17.1869C151.15 16.6377 151.725 15.966 152.392 15.2988H153.717L152.916 16.5381C153.821 17.1707 153.917 15.9493 154.7 16.0204Z" fill="white"/>
|
|
16
|
+
<path d="M196.52 57.4125H197.12L198.521 59.1804C198.611 60.1452 198.707 61.2334 197.819 62.1011C197.895 62.8947 197.293 63.5376 197.387 64.3791C197.456 64.99 197.251 65.6782 196.999 66.2594C196.863 66.5725 196.375 66.7329 196.046 66.9627L192.913 64.8338C191.766 62.8825 192.442 61.4031 192.906 59.9031C193.5 57.9813 193.982 57.3626 195.824 56.2827L196.52 57.4125Z" fill="white"/>
|
|
17
|
+
<path d="M114.708 43.6933C114.968 45.0174 113.936 46.3399 112.127 47.2069L111.778 46.8996L111.357 47.2585L108.919 46.279L108.121 44.8788C108.379 44.6414 108.57 44.3803 108.827 44.2576C109.026 44.1621 109.309 44.2382 109.575 44.2382C109.694 43.6558 109.81 43.0929 109.924 42.5332C109.484 41.7649 108.995 40.9111 108.475 40.0024L109.587 38.9678H110.532C112.062 40.0915 113.887 40.9164 114.708 43.6933Z" fill="white"/>
|
|
18
|
+
<path d="M139.575 86.15L140.455 84.9233L141.947 84.3765C142.035 84.8497 142.1 85.1918 142.191 85.6812L142.966 85.447C143.761 85.2224 143.299 86.3769 144.079 86.4656C144.421 86.5044 144.682 87.2588 145.08 87.8322C145.274 88.6537 145.024 89.5362 144.38 90.3515L144.727 90.7444L144.161 91.2517C144.056 91.1438 143.942 91.0449 143.82 90.956C142.838 91.7983 142.068 90.9054 141.251 90.6229C140.559 90.3499 139.882 90.042 139.222 89.7004C138.833 88.922 138.444 88.1449 137.999 87.253C137.944 85.6252 138.062 85.3325 139.299 84.4153C139.39 84.9841 139.468 85.4783 139.575 86.15Z" fill="white"/>
|
|
19
|
+
<path d="M168.341 82.4339L166.556 81.7667V81.3478L164.02 80.5325C163.815 79.4368 163.634 78.4682 163.48 77.6503C164.114 76.8964 165.022 76.8434 165.263 75.9094C165.359 75.5381 166.09 75.3306 166.737 74.9194L167.133 75.8885L166.901 76.4978L167.177 76.6673L167.824 75.619C168.497 76.5186 169.287 77.1697 169.496 77.9718C169.685 78.7017 170.175 79.4083 169.851 80.3803C169.528 81.3522 168.265 81.2435 168.341 82.4339Z" fill="white"/>
|
|
20
|
+
<path d="M126.463 61.9162H124.552C124.129 62.5104 124.859 63.4589 123.319 63.8137C121.975 63.7625 120.474 63.0373 119.504 61.3599V59.8395L120.777 58.5668L121.21 58.9056C121.75 58.2529 122.472 58.6532 122.952 58.5639C124.463 59.3214 125.893 59.9864 126.463 61.9162Z" fill="white"/>
|
|
21
|
+
<path d="M115.549 93.1763H116.348C116.415 93.3782 116.488 93.595 116.604 93.9392C117.339 93.8394 118.331 93.8769 118.654 94.4996C119.05 95.264 120.059 95.2076 120.249 96.3375V99.4031C119.006 100.197 118.211 98.5763 117.119 98.8372C116.341 98.344 116.031 97.4716 115.272 96.9661C115.039 96.7823 114.855 96.5429 114.738 96.2699C114.621 95.9969 114.574 95.6989 114.601 95.403C114.636 94.9719 114.608 94.5355 114.608 94.1174L115.549 93.1763Z" fill="white"/>
|
|
22
|
+
<path d="M100.322 72.8531C100.624 71.7272 99.0682 71.2613 99.6191 70.1288L101.147 68.5981C102.074 69.0625 103.152 69.5049 104.124 70.1166C105.121 70.7445 105.465 71.8928 106.028 72.8937C105.846 73.3629 105.678 73.794 105.489 74.2826C103.621 74.6728 102.091 73.7593 100.322 72.8531Z" fill="white"/>
|
|
23
|
+
<path d="M159.649 104.551C158.931 103.603 157.932 103.577 156.975 103.266L156.047 101.92V98.9503L157.228 98.0659L159.035 98.4283C160.639 99.2437 160.652 100.899 161.348 102.322L159.649 104.551Z" fill="white"/>
|
|
24
|
+
<path d="M126.722 80.2822L127.336 80.4388V82.2379L126.493 83.3769L123.351 82.5252C123.31 82.2907 123.251 81.946 123.188 81.583L122.633 81.4607C122.083 80.0178 123.456 79.1165 123.684 77.8908C124.51 77.9296 124.736 76.5593 125.81 77.091L125.979 77.6602L126.897 77.7961L127.747 78.6459L126.722 80.2822Z" fill="white"/>
|
|
25
|
+
<path d="M177.567 59.0064L178.413 58.6376C179.19 59.9576 180.702 60.9934 180.452 63.0053L178.433 64.1242L176.978 63.3815C176.489 62.7629 176.047 62.2032 175.556 61.5809C175.412 60.7197 175.255 59.7783 175.09 58.7896L176.341 57.8242H177.399C177.45 58.1843 177.499 58.5308 177.567 59.0064Z" fill="white"/>
|
|
26
|
+
<path d="M182.313 89.5421C182.184 89.7807 182.054 90.0191 181.89 90.3198C182.472 90.6236 182.935 90.7158 183.393 90.0245C183.448 90.3788 183.531 90.5649 183.49 90.7175C183.386 91.1036 183.226 91.4746 183.069 91.9046C183.722 91.5394 183.773 91.487 184.158 90.7276C184.467 91.5713 184.866 92.2505 184.933 92.96C184.995 93.62 184.703 94.3138 184.564 95.0066C184.341 94.9096 184.067 94.7217 184.006 94.7752C183.452 95.2648 182.901 95.1922 182.34 94.8335C181.78 94.4747 181.312 94.6353 180.939 95.2163L180.24 94.6555C180.339 94.2519 180.441 93.8349 180.549 93.3937L179.699 92.988C179.865 92.2421 180.031 91.4973 180.234 90.5871L182.129 89.3208L182.313 89.5421Z" fill="white"/>
|
|
27
|
+
<path d="M158.648 40.4562C158.091 40.1224 157.657 39.845 157.207 39.5967C156.042 38.9537 156.044 38.9572 155.637 37.6669C155.541 37.3354 155.414 37.0138 155.257 36.7064C155.035 36.297 154.727 35.9328 154.522 35.5166C154.364 35.1357 154.232 34.7441 154.129 34.3449C154.484 33.8837 154.858 33.4288 155.348 33.2285C157.839 34.7382 157.826 34.2925 159.41 38.5793C159.154 39.2098 158.897 39.8448 158.648 40.4562Z" fill="white"/>
|
|
28
|
+
<path d="M174.341 20.8665L175.121 20.9553C176.223 22.3591 177.045 23.8368 176.669 25.5788L175.032 25.8031L173.851 24.5219C173.203 24.2637 172.661 24.2219 172.479 23.9442C171.835 22.9601 171.697 21.8282 171.888 20.5678L173.445 19.6475L174.341 20.8665Z" fill="white"/>
|
|
29
|
+
<path d="M173.326 38.5991V39.6363L174.772 39.777V40.6269C176.575 41.2659 176.359 42.7133 176.33 44.1653C174.163 44.5495 172.845 43.2322 171.593 41.9329L171.047 39.6928C171.471 38.8875 172.216 38.5616 173.326 38.5991Z" fill="white"/>
|
|
30
|
+
<path d="M132.307 41.3126L133.597 40.5361C134.737 41.5184 136.364 41.9288 137.041 43.1597C137.235 43.765 137.36 44.1497 137.533 44.6884L137.067 45.6235L136.269 45.9923L134.505 45.2506C133.144 44.3871 132.218 43.195 132.307 41.3126Z" fill="white"/>
|
|
31
|
+
<path d="M129.7 109.616L128.543 107.921L128.789 107.054L128.572 106.963L130.19 104.816C132.243 105.269 132.697 106.965 133.29 108.39L132.479 110L129.7 109.616Z" fill="white"/>
|
|
32
|
+
<path d="M123.514 27.2312L124.601 26.1636C125.517 26.2166 126.358 26.1082 127.148 27.1148C128.068 28.2875 128.491 28.3929 128.749 29.2008C128.766 29.2534 128.834 29.2899 128.878 29.3342C128.4 29.7686 128.532 30.8303 127.276 30.6554C126.858 30.2335 126.212 29.9668 125.389 29.8575C124.738 29.7709 124.174 29.0187 123.512 28.5165C123.706 28.2405 123.839 28.0518 123.979 27.8538L123.514 27.2312Z" fill="white"/>
|
|
33
|
+
<path d="M96.5204 15.9282L63.6698 108.139H39.6474L6.79688 15.9282H29.9784L51.1782 84.4259H52.1391L73.3988 15.9282H96.5204Z" fill="white"/>
|
|
34
|
+
<path d="M251.555 109.94C242.346 109.94 234.439 107.919 227.833 103.877C221.266 99.8344 216.202 94.2513 212.638 87.1274C209.115 79.9635 207.353 71.7189 207.353 62.3938C207.353 53.0286 209.155 44.7641 212.759 37.6001C216.362 30.3962 221.447 24.7931 228.013 20.7909C234.619 16.7486 242.426 14.7275 251.434 14.7275C258.921 14.7275 265.548 16.1083 271.313 18.8698C277.118 21.5913 281.743 25.4534 285.186 30.4562C288.629 35.4189 290.591 41.2221 291.071 47.8658H270.292C269.451 43.4233 267.449 39.7213 264.286 36.7597C261.164 33.758 256.98 32.2572 251.735 32.2572C247.291 32.2572 243.387 33.4578 240.024 35.8592C236.661 38.2205 234.038 41.6223 232.157 46.0648C230.315 50.5072 229.394 55.8302 229.394 62.0336C229.394 68.317 230.315 73.72 232.157 78.2425C233.998 82.725 236.581 86.1869 239.904 88.6282C243.267 91.0295 247.211 92.2302 251.735 92.2302C254.938 92.2302 257.8 91.6299 260.323 90.4292C262.885 89.1885 265.027 87.4076 266.749 85.0863C268.47 82.765 269.651 79.9434 270.292 76.6216H291.071C290.551 83.1452 288.629 88.9284 285.306 93.9712C281.983 98.9739 277.459 102.896 271.733 105.738C266.008 108.539 259.282 109.94 251.555 109.94Z" fill="white"/>
|
|
35
|
+
<path d="M335.468 110C329.622 110 324.357 108.959 319.673 106.878C315.029 104.757 311.345 101.635 308.623 97.5131C305.94 93.3909 304.599 88.3081 304.599 82.2647C304.599 77.0619 305.56 72.7595 307.482 69.3576C309.403 65.9557 312.026 63.2342 315.349 61.1931C318.672 59.152 322.416 57.6112 326.579 56.5706C330.783 55.49 335.127 54.7095 339.612 54.2293C345.017 53.669 349.401 53.1687 352.764 52.7285C356.127 52.2482 358.569 51.5278 360.091 50.5673C361.652 49.5667 362.433 48.0259 362.433 45.9447V45.5845C362.433 41.062 361.092 37.5601 358.409 35.0787C355.727 32.5974 351.863 31.3567 346.818 31.3567C341.493 31.3567 337.269 32.5173 334.146 34.8386C331.064 37.1599 328.982 39.9014 327.901 43.0631L307.602 40.1816C309.203 34.5785 311.846 29.8959 315.529 26.1338C319.213 22.3317 323.717 19.4902 329.042 17.6091C334.367 15.6881 340.252 14.7275 346.698 14.7275C351.142 14.7275 355.566 15.2478 359.97 16.2884C364.375 17.329 368.398 19.0499 372.042 21.4512C375.685 23.8125 378.608 27.0343 380.81 31.1166C383.052 35.1988 384.173 40.3016 384.173 46.425V108.139H363.274V95.472H362.553C361.232 98.0334 359.37 100.435 356.968 102.676C354.605 104.877 351.623 106.658 348.019 108.019C344.456 109.34 340.272 110 335.468 110ZM341.113 94.0312C345.477 94.0312 349.26 93.1707 352.464 91.4498C355.666 89.6888 358.129 87.3675 359.85 84.4859C361.612 81.6044 362.493 78.4626 362.493 75.0608V64.1948C361.812 64.7551 360.651 65.2754 359.01 65.7556C357.408 66.2359 355.606 66.6561 353.605 67.0163C351.603 67.3765 349.621 67.6967 347.659 67.9769C345.697 68.257 343.996 68.4971 342.554 68.6973C339.311 69.1375 336.409 69.8579 333.846 70.8584C331.284 71.859 329.262 73.2598 327.781 75.0608C326.299 76.8217 325.558 79.103 325.558 81.9045C325.558 85.9067 327.02 88.9284 329.943 90.9695C332.865 93.0106 336.589 94.0312 341.113 94.0312Z" fill="white"/>
|
|
36
|
+
</svg>
|
|
37
|
+
<span class="text-xs"><%= t("decidim.voca.footer_text") %></span>
|
|
38
|
+
</a>
|
|
39
|
+
</div>
|
|
40
|
+
SVG
|
|
41
|
+
)
|
|
42
|
+
Deface::Override.new(
|
|
43
|
+
virtual_path: "layouts/decidim/footer/_main_intro",
|
|
44
|
+
name: "add_voca_classes_on_description",
|
|
45
|
+
surround: "p:has(erb[loud]:contains('organization_description_label'))",
|
|
46
|
+
text: <<~HTML
|
|
47
|
+
<div class="decidim_voca__footer-org-description">
|
|
48
|
+
<%= render_original %>
|
|
49
|
+
</div>
|
|
50
|
+
HTML
|
|
51
|
+
)
|
|
52
|
+
end
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@use "stylesheets/decidim/voca/admin/decidim_voca";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@use "stylesheets/decidim/voca/decidim_voca_fixes";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require("src/decidim/voca/voca");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@use "stylesheets/decidim/voca/decidim_voca";
|
|
Binary file
|