decidim-decidim_awesome 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE-AGPLv3.txt +661 -0
- data/README.md +307 -0
- data/Rakefile +51 -0
- data/app/assets/config/decidim_admin_decidim_awesome_manifest.css +3 -0
- data/app/assets/config/decidim_admin_decidim_awesome_manifest.js +1 -0
- data/app/assets/config/decidim_decidim_awesome_manifest.css +5 -0
- data/app/assets/config/decidim_decidim_awesome_manifest.js +2 -0
- data/app/assets/images/decidim/decidim_awesome/loading.gif +0 -0
- data/app/assets/images/decidim/decidim_awesome/platoniq-logo.png +0 -0
- data/app/assets/javascripts/decidim/decidim_awesome/admin.js +2 -0
- data/app/assets/javascripts/decidim/decidim_awesome/admin/constraints.js.es6 +54 -0
- data/app/assets/javascripts/decidim/decidim_awesome/application.js +4 -0
- data/app/assets/javascripts/decidim/decidim_awesome/awesome_map/api_fetcher.js.es6 +38 -0
- data/app/assets/javascripts/decidim/decidim_awesome/awesome_map/categories.js.es6 +25 -0
- data/app/assets/javascripts/decidim/decidim_awesome/awesome_map/map.js.es6 +215 -0
- data/app/assets/javascripts/decidim/decidim_awesome/awesome_map/meetings.js.es6 +129 -0
- data/app/assets/javascripts/decidim/decidim_awesome/awesome_map/proposals.js.es6 +78 -0
- data/app/assets/javascripts/decidim/decidim_awesome/editors/markdown_view.js.es6 +12 -0
- data/app/assets/javascripts/decidim/decidim_awesome/editors/quill_editor.js.es6 +162 -0
- data/app/assets/javascripts/decidim/decidim_awesome/forms/autosave.js.es6 +90 -0
- data/app/assets/javascripts/decidim/decidim_awesome/proposals/images.js.es6 +25 -0
- data/app/assets/stylesheets/decidim/decidim_awesome/admin.scss +45 -0
- data/app/assets/stylesheets/decidim/decidim_awesome/admin/constraints.scss +37 -0
- data/app/assets/stylesheets/decidim/decidim_awesome/application.scss +8 -0
- data/app/assets/stylesheets/decidim/decidim_awesome/awesome_iframe/iframe.scss +10 -0
- data/app/assets/stylesheets/decidim/decidim_awesome/awesome_map/leaflet.scss.erb +9 -0
- data/app/assets/stylesheets/decidim/decidim_awesome/awesome_map/map.scss +66 -0
- data/app/assets/stylesheets/decidim/decidim_awesome/editors/markdown_editor.scss +17 -0
- data/app/assets/stylesheets/decidim/decidim_awesome/editors/markdown_view.scss +27 -0
- data/app/assets/stylesheets/decidim/decidim_awesome/editors/quill_editor.scss +7 -0
- data/app/assets/stylesheets/decidim/decidim_awesome/forms/autosave.scss +17 -0
- data/app/awesome_overrides/presenters/decidim/proposals/proposal_presenter_override.rb +31 -0
- data/app/commands/decidim/decidim_awesome/admin/create_constraint.rb +47 -0
- data/app/commands/decidim/decidim_awesome/admin/destroy_constraint.rb +31 -0
- data/app/commands/decidim/decidim_awesome/admin/update_config.rb +44 -0
- data/app/commands/decidim/decidim_awesome/admin/update_constraint.rb +44 -0
- data/app/commands/decidim/decidim_awesome/create_editor_image.rb +34 -0
- data/app/controllers/concerns/decidim/decidim_awesome/needs_awesome_config.rb +17 -0
- data/app/controllers/decidim/decidim_awesome/admin/application_controller.rb +21 -0
- data/app/controllers/decidim/decidim_awesome/admin/checks_controller.rb +37 -0
- data/app/controllers/decidim/decidim_awesome/admin/config_controller.rb +44 -0
- data/app/controllers/decidim/decidim_awesome/admin/constraints_controller.rb +126 -0
- data/app/controllers/decidim/decidim_awesome/application_controller.rb +14 -0
- data/app/controllers/decidim/decidim_awesome/editor_images_controller.rb +50 -0
- data/app/controllers/decidim/decidim_awesome/iframe_component/application_controller.rb +15 -0
- data/app/controllers/decidim/decidim_awesome/iframe_component/iframe_controller.rb +33 -0
- data/app/controllers/decidim/decidim_awesome/map_component/application_controller.rb +15 -0
- data/app/controllers/decidim/decidim_awesome/map_component/map_controller.rb +31 -0
- data/app/forms/decidim/decidim_awesome/admin/config_form.rb +22 -0
- data/app/forms/decidim/decidim_awesome/admin/constraint_form.rb +20 -0
- data/app/forms/decidim/decidim_awesome/admin/intergram_form.rb +21 -0
- data/app/forms/decidim/decidim_awesome/editor_image_form.rb +16 -0
- data/app/helpers/decidim/decidim_awesome/admin/config_constraints_helpers.rb +90 -0
- data/app/helpers/decidim/decidim_awesome/application_helper.rb +10 -0
- data/app/helpers/decidim/decidim_awesome/map_helper.rb +121 -0
- data/app/models/decidim/decidim_awesome/application_record.rb +10 -0
- data/app/models/decidim/decidim_awesome/awesome_config.rb +23 -0
- data/app/models/decidim/decidim_awesome/config_constraint.rb +13 -0
- data/app/models/decidim/decidim_awesome/editor_image.rb +24 -0
- data/app/permissions/decidim/decidim_awesome/permissions.rb +29 -0
- data/app/uploaders/decidim/decidim_awesome/image_uploader.rb +22 -0
- data/app/views/decidim/decidim_awesome/admin/checks/index.html.erb +35 -0
- data/app/views/decidim/decidim_awesome/admin/config/_constraints.html.erb +27 -0
- data/app/views/decidim/decidim_awesome/admin/config/_form_editors.html.erb +20 -0
- data/app/views/decidim/decidim_awesome/admin/config/_form_livechat.html.erb +44 -0
- data/app/views/decidim/decidim_awesome/admin/config/_form_proposals.html.erb +12 -0
- data/app/views/decidim/decidim_awesome/admin/config/_form_surveys.html.erb +9 -0
- data/app/views/decidim/decidim_awesome/admin/config/_modal.html.erb +11 -0
- data/app/views/decidim/decidim_awesome/admin/config/show.html.erb +15 -0
- data/app/views/decidim/decidim_awesome/admin/constraints/_form.html.erb +56 -0
- data/app/views/decidim/decidim_awesome/admin/constraints/new.html.erb +14 -0
- data/app/views/decidim/decidim_awesome/admin/constraints/show.html.erb +14 -0
- data/app/views/decidim/decidim_awesome/iframe_component/iframe/show.html.erb +9 -0
- data/app/views/decidim/decidim_awesome/map_component/map/error.erb +7 -0
- data/app/views/decidim/decidim_awesome/map_component/map/show.html.erb +74 -0
- data/app/views/layouts/decidim/_head.html.erb +5 -0
- data/app/views/layouts/decidim/admin/_header.html.erb +5 -0
- data/app/views/layouts/decidim/admin/decidim_awesome.html.erb +47 -0
- data/app/views/layouts/decidim/decidim_awesome/_awesome_config.html.erb +20 -0
- data/app/views/layouts/decidim/decidim_awesome/_intergram_widget.html.erb +16 -0
- data/app/views/v0.21/layouts/decidim/_head.html.erb +34 -0
- data/app/views/v0.21/layouts/decidim/admin/_header.html.erb +9 -0
- data/app/views/v0.22/layouts/decidim/_head.html.erb +36 -0
- data/app/views/v0.22/layouts/decidim/admin/_header.html.erb +11 -0
- data/config/i18n-tasks.yml +10 -0
- data/config/locales/ca.yml +125 -0
- data/config/locales/cs.yml +125 -0
- data/config/locales/en.yml +176 -0
- data/config/locales/es.yml +125 -0
- data/config/locales/fr.yml +125 -0
- data/config/locales/sv.yml +125 -0
- data/db/migrate/20200324170000_create_decidim_awesome_config.rb +16 -0
- data/db/migrate/20200324230936_create_awesome_editor_images.rb +14 -0
- data/db/migrate/20200403142257_create_decidim_awesome_config_constraints.rb +13 -0
- data/db/seeds.rb +27 -0
- data/lib/decidim/decidim_awesome.rb +110 -0
- data/lib/decidim/decidim_awesome/admin.rb +10 -0
- data/lib/decidim/decidim_awesome/admin_engine.rb +45 -0
- data/lib/decidim/decidim_awesome/awesome_helpers.rb +55 -0
- data/lib/decidim/decidim_awesome/checksums.yml +15 -0
- data/lib/decidim/decidim_awesome/config.rb +129 -0
- data/lib/decidim/decidim_awesome/content_renderers.rb +9 -0
- data/lib/decidim/decidim_awesome/content_renderers/markdown_renderer.rb +18 -0
- data/lib/decidim/decidim_awesome/context_analyzers.rb +11 -0
- data/lib/decidim/decidim_awesome/context_analyzers/component_analyzer.rb +38 -0
- data/lib/decidim/decidim_awesome/context_analyzers/participatory_space_analyzer.rb +31 -0
- data/lib/decidim/decidim_awesome/context_analyzers/request_analyzer.rb +97 -0
- data/lib/decidim/decidim_awesome/engine.rb +38 -0
- data/lib/decidim/decidim_awesome/iframe_component/component.rb +59 -0
- data/lib/decidim/decidim_awesome/iframe_component/engine.rb +23 -0
- data/lib/decidim/decidim_awesome/map_component/component.rb +74 -0
- data/lib/decidim/decidim_awesome/map_component/engine.rb +23 -0
- data/lib/decidim/decidim_awesome/system_checker.rb +63 -0
- data/lib/decidim/decidim_awesome/test/factories.rb +36 -0
- data/lib/decidim/decidim_awesome/test/shared_examples/config_examples.rb +25 -0
- data/lib/decidim/decidim_awesome/test/themes/css.lvh.me.css +3 -0
- data/lib/decidim/decidim_awesome/test/themes/erb.lvh.me.scss.erb +2 -0
- data/lib/decidim/decidim_awesome/test/themes/scss.lvh.me.scss +1 -0
- data/lib/decidim/decidim_awesome/test/themes/test-theme/body.scss +4 -0
- data/lib/decidim/decidim_awesome/version.rb +10 -0
- data/vendor/assets/images/layers-2x.png +0 -0
- data/vendor/assets/images/layers.png +0 -0
- data/vendor/assets/images/marker-icon.png +0 -0
- data/vendor/assets/javascripts/codemirror-4.inline-attachment.js +89 -0
- data/vendor/assets/javascripts/form-storage.js +824 -0
- data/vendor/assets/javascripts/highlight.min.js +44 -0
- data/vendor/assets/javascripts/image-resize.min.js +1 -0
- data/vendor/assets/javascripts/image-upload.min.js +6 -0
- data/vendor/assets/javascripts/inline-attachment.js +399 -0
- data/vendor/assets/javascripts/inscrybmde.min.js +7 -0
- data/vendor/assets/javascripts/jquery.inline-attachment.js +66 -0
- data/vendor/assets/javascripts/leaflet.featuregroup.subgroup.js +6 -0
- data/vendor/assets/stylesheets/default.min.css +1 -0
- data/vendor/assets/stylesheets/foundation.min.css +1 -0
- data/vendor/assets/stylesheets/github.min.css +2 -0
- data/vendor/assets/stylesheets/inscrybmde.min.css +8 -0
- metadata +267 -0
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module DecidimAwesome
|
5
|
+
class AwesomeConfig < ApplicationRecord
|
6
|
+
self.table_name = "decidim_awesome_config"
|
7
|
+
|
8
|
+
belongs_to :organization, foreign_key: :decidim_organization_id, class_name: "Decidim::Organization"
|
9
|
+
|
10
|
+
has_many :constraints,
|
11
|
+
foreign_key: "decidim_awesome_config_id",
|
12
|
+
class_name: "Decidim::DecidimAwesome::ConfigConstraint",
|
13
|
+
dependent: :destroy
|
14
|
+
|
15
|
+
validates :organization, presence: true
|
16
|
+
validates :var, uniqueness: { scope: :decidim_organization_id }
|
17
|
+
|
18
|
+
def self.for_organization(organization)
|
19
|
+
where(organization: organization)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module DecidimAwesome
|
5
|
+
class ConfigConstraint < ApplicationRecord
|
6
|
+
self.table_name = "decidim_awesome_config_constraints"
|
7
|
+
|
8
|
+
belongs_to :awesome_config, foreign_key: :decidim_awesome_config_id, class_name: "Decidim::DecidimAwesome::AwesomeConfig"
|
9
|
+
|
10
|
+
validates :awesome_config, presence: true
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module DecidimAwesome
|
5
|
+
class EditorImage < ApplicationRecord
|
6
|
+
self.table_name = "decidim_awesome_editor_images"
|
7
|
+
|
8
|
+
belongs_to :author, foreign_key: :decidim_author_id, class_name: "Decidim::User"
|
9
|
+
belongs_to :organization, foreign_key: :decidim_organization_id, class_name: "Decidim::Organization"
|
10
|
+
|
11
|
+
validates :organization, presence: true
|
12
|
+
validates :author, presence: true
|
13
|
+
|
14
|
+
validates :image,
|
15
|
+
file_size: { less_than_or_equal_to: ->(_record) { Decidim.maximum_attachment_size } },
|
16
|
+
file_content_type: { allow: ["image/jpeg", "image/png"] }
|
17
|
+
|
18
|
+
mount_uploader :image, Decidim::DecidimAwesome::ImageUploader
|
19
|
+
|
20
|
+
delegate :url, to: :image
|
21
|
+
delegate :thumbnail, to: :image
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module DecidimAwesome
|
5
|
+
class Permissions < Decidim::DefaultPermissions
|
6
|
+
def permissions
|
7
|
+
return permission_action unless user
|
8
|
+
|
9
|
+
editor_image_action?
|
10
|
+
|
11
|
+
permission_action
|
12
|
+
end
|
13
|
+
|
14
|
+
def editor_image_action?
|
15
|
+
return unless permission_action.subject == :editor_image
|
16
|
+
|
17
|
+
config = context.fetch(:awesome_config, {})
|
18
|
+
|
19
|
+
return allow! if config[:allow_images_in_proposals]
|
20
|
+
|
21
|
+
if user.admin
|
22
|
+
return allow! if config[:allow_images_in_small_editor]
|
23
|
+
return allow! if config[:allow_images_in_full_editor]
|
24
|
+
return allow! if config[:allow_images_in_markdown_editor]
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module DecidimAwesome
|
5
|
+
# This class deals with uploading images to a Blueprints.
|
6
|
+
class ImageUploader < Decidim::ImageUploader
|
7
|
+
process :validate_size, :validate_dimensions
|
8
|
+
|
9
|
+
version :thumbnail do
|
10
|
+
process resize_to_fit: [nil, 237]
|
11
|
+
end
|
12
|
+
|
13
|
+
def extension_white_list
|
14
|
+
%w(jpg jpeg png)
|
15
|
+
end
|
16
|
+
|
17
|
+
def max_image_height_or_width
|
18
|
+
8000
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
<div class="card">
|
2
|
+
<div class="card-divider">
|
3
|
+
<h2 class="card-title"><%= t ".title" %></h2>
|
4
|
+
</div>
|
5
|
+
<div class="card-section">
|
6
|
+
<p>
|
7
|
+
<%= t ".decidim_version", version: decidim_version %>
|
8
|
+
<% if decidim_version_valid? %>
|
9
|
+
<span class="text-success"><%= icon("check", class: "icon", aria_label: "ok", role: "img") %></span>
|
10
|
+
<% else %>
|
11
|
+
<span class="text-alert"><%= icon("x", class: "icon", aria_label: "ko", role: "img") %></span>
|
12
|
+
<% end %>
|
13
|
+
</p>
|
14
|
+
<ul class="vertical menu">
|
15
|
+
<% overrides.each do |group, props| %>
|
16
|
+
<li>
|
17
|
+
<strong><%= t ".#{group}" %></strong>
|
18
|
+
<ul class="vertical menu">
|
19
|
+
<% props.files.each do |file, md5| %>
|
20
|
+
<li>
|
21
|
+
<%= file %>
|
22
|
+
<% if valid?(props.spec, file) %>
|
23
|
+
<span class="text-success"><%= icon("check", class: "icon", aria_label: "ok", role: "img") %></span>
|
24
|
+
<% else %>
|
25
|
+
<span class="text-alert"><%= icon("x", class: "icon", aria_label: "ko", role: "img") %></span>
|
26
|
+
<% end %>
|
27
|
+
</li>
|
28
|
+
<% end %>
|
29
|
+
</ul>
|
30
|
+
<br>
|
31
|
+
</li>
|
32
|
+
<% end %>
|
33
|
+
</ul>
|
34
|
+
</div>
|
35
|
+
</div>
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<div class="constraints-editor" data-key="<%= key %>">
|
2
|
+
<div class="callout" style="display:none" data-closable>
|
3
|
+
<p></p>
|
4
|
+
<button class="close-button" aria-label="Dismiss alert" type="button" data-close>
|
5
|
+
<span aria-hidden="true">×</span>
|
6
|
+
</button>
|
7
|
+
</div>
|
8
|
+
|
9
|
+
<h5><%= t ".title" %></h5>
|
10
|
+
<% if constraints.blank? %>
|
11
|
+
<span class="label warning"><%= t ".always" %></span>
|
12
|
+
<% end %>
|
13
|
+
|
14
|
+
<ul class="constraints-list">
|
15
|
+
<% constraints&.each do |constraint| %>
|
16
|
+
<li>
|
17
|
+
<% constraint.settings.reverse_each do |k, val| %>
|
18
|
+
<span class="label <%= k %>"><%= translate_constraint_value constraint, k %></span>
|
19
|
+
<% end %>
|
20
|
+
<a href="<%= constraint_path(id: constraint.id, key: key) %>" class="edit-condition"><%= t ".edit" %></a>
|
21
|
+
<%= link_to t(".delete"), constraint_path(id: constraint.id), remote: true, method: :delete %>
|
22
|
+
</li>
|
23
|
+
<% end %>
|
24
|
+
</ul>
|
25
|
+
<a href="<%= new_constraint_path(key: key) %>" class="add-condition"><%= t ".add_condition" %></a>
|
26
|
+
|
27
|
+
</div>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<div class="row column decidim_awesome-form">
|
2
|
+
<p class="help-text"><%= t("help.drag_and_drop_supported", scope: "decidim.decidim_awesome.admin.config.form") %></p>
|
3
|
+
|
4
|
+
<% enabled_configs([:allow_images_in_full_editor, :allow_images_in_small_editor]).each do |key| %>
|
5
|
+
<%= form.check_box key %>
|
6
|
+
<p class="help-text"><%= t("help.#{key}", scope: "decidim.decidim_awesome.admin.config.form") %></p>
|
7
|
+
|
8
|
+
<%= render(partial: "decidim/decidim_awesome/admin/config/constraints", locals: { key: key, constraints: constraints_for(key) }) %>
|
9
|
+
<% end %>
|
10
|
+
|
11
|
+
<h2 class="card-title"><%= t("experimental", scope: "decidim.decidim_awesome.admin.config") %></h2>
|
12
|
+
|
13
|
+
<% enabled_configs([:use_markdown_editor, :allow_images_in_markdown_editor]).each do |key| %>
|
14
|
+
<%= form.check_box key %>
|
15
|
+
<p class="help-text"><%= t("help.#{key}", scope: "decidim.decidim_awesome.admin.config.form") %></p>
|
16
|
+
|
17
|
+
<%= render(partial: "decidim/decidim_awesome/admin/config/constraints", locals: { key: key, constraints: constraints_for(key) }) %>
|
18
|
+
<% end %>
|
19
|
+
|
20
|
+
</div>
|
@@ -0,0 +1,44 @@
|
|
1
|
+
<div class="row column decidim_awesome-form">
|
2
|
+
<% if config_enabled? :intergram_for_public %>
|
3
|
+
<%= form.check_box :intergram_for_public %>
|
4
|
+
<p class="help-text"><%= t("help.intergram_about", scope: "decidim.decidim_awesome.admin.config.form").html_safe %></p>
|
5
|
+
|
6
|
+
<%= render(partial: "decidim/decidim_awesome/admin/config/constraints", locals: { key: :intergram_for_public, constraints: constraints_for(:intergram_for_public) }) %>
|
7
|
+
|
8
|
+
<%= fields_for "config[intergram_for_public_settings]", form.object.intergram_for_public_settings do |f| %>
|
9
|
+
<%= f.text_field :chat_id, label: t("intergram_chat_id", scope: "activemodel.attributes.config") %>
|
10
|
+
<p class="help-text"><%= t("help.intergram_config", scope: "decidim.decidim_awesome.admin.config.form").html_safe %></p>
|
11
|
+
<%= f.check_box :require_login, label: t("intergram_require_login", scope: "activemodel.attributes.config") %>
|
12
|
+
<%= f.check_box :use_floating_button, label: t("intergram_use_floating_button", scope: "activemodel.attributes.config") %>
|
13
|
+
<%= f.color_field :color, label: t("intergram_color", scope: "activemodel.attributes.config") %>
|
14
|
+
|
15
|
+
<%= f.text_field :title_open, label: t("intergram_title_open", scope: "activemodel.attributes.config"), placeholder: t("decidim.decidim_awesome.config.intergram.title_open") %>
|
16
|
+
<%= f.text_field :title_closed, label: t("intergram_title_closed", scope: "activemodel.attributes.config"), placeholder: t("decidim.decidim_awesome.config.intergram.title_closed") %>
|
17
|
+
<%= f.text_field :intro_message, label: t("intergram_intro_message", scope: "activemodel.attributes.config"), placeholder: t("decidim.decidim_awesome.config.intergram.intro_message") %>
|
18
|
+
<%= f.text_field :auto_no_response, label: t("intergram_auto_no_response", scope: "activemodel.attributes.config"), placeholder: t("decidim.decidim_awesome.config.intergram.auto_no_response") %>
|
19
|
+
<% end %>
|
20
|
+
<% end %>
|
21
|
+
</div>
|
22
|
+
|
23
|
+
<div class="row column decidim_awesome-form">
|
24
|
+
<% if config_enabled? :intergram_for_admins %>
|
25
|
+
<%= form.check_box :intergram_for_admins %>
|
26
|
+
<p class="help-text"><%= t("help.intergram_about", scope: "decidim.decidim_awesome.admin.config.form").html_safe %></p>
|
27
|
+
|
28
|
+
<%= render(partial: "decidim/decidim_awesome/admin/config/constraints", locals: { key: :intergram_for_admins, constraints: constraints_for(:intergram_for_admins) }) %>
|
29
|
+
|
30
|
+
<%= fields_for "config[intergram_for_admins_settings]", form.object.intergram_for_admins_settings do |f| %>
|
31
|
+
<%= f.text_field :chat_id, label: t("intergram_chat_id", scope: "activemodel.attributes.config") %>
|
32
|
+
<p class="help-text"><%= t("help.intergram_config", scope: "decidim.decidim_awesome.admin.config.form").html_safe %></p>
|
33
|
+
|
34
|
+
<%= f.check_box :use_floating_button, label: t("intergram_use_floating_button", scope: "activemodel.attributes.config") %>
|
35
|
+
<%= f.color_field :color, label: t("intergram_color", scope: "activemodel.attributes.config") %>
|
36
|
+
|
37
|
+
<%= f.text_field :title_open, label: t("intergram_title_open", scope: "activemodel.attributes.config"), placeholder: t("decidim.decidim_awesome.config.intergram.title_open") %>
|
38
|
+
<%= f.text_field :title_closed, label: t("intergram_title_closed", scope: "activemodel.attributes.config"), placeholder: t("decidim.decidim_awesome.config.intergram.title_closed") %>
|
39
|
+
<%= f.text_field :intro_message, label: t("intergram_intro_message", scope: "activemodel.attributes.config"), placeholder: t("decidim.decidim_awesome.config.intergram.intro_message") %>
|
40
|
+
<%= f.text_field :auto_no_response, label: t("intergram_auto_no_response", scope: "activemodel.attributes.config"), placeholder: t("decidim.decidim_awesome.config.intergram.auto_no_response") %>
|
41
|
+
<% end %>
|
42
|
+
|
43
|
+
<% end %>
|
44
|
+
</div>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<div class="row column decidim_awesome-form">
|
2
|
+
<h2 class="card-title"><%= t("experimental", scope: "decidim.decidim_awesome.admin.config") %></h2>
|
3
|
+
|
4
|
+
<% if config_enabled? :allow_images_in_proposals %>
|
5
|
+
<p class="text-info"><%= t("rich_text_editor_in_public_views", scope: "decidim.decidim_awesome.admin.config") if current_organization.rich_text_editor_in_public_views %></p>
|
6
|
+
|
7
|
+
<%= form.check_box :allow_images_in_proposals %>
|
8
|
+
<p class="help-text"><%= t("help.allow_images_in_proposals", scope: "decidim.decidim_awesome.admin.config.form") %></p>
|
9
|
+
|
10
|
+
<%= render(partial: "decidim/decidim_awesome/admin/config/constraints", locals: { key: :allow_images_in_proposals, constraints: constraints_for(:allow_images_in_proposals) }) %>
|
11
|
+
<% end %>
|
12
|
+
</div>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<div class="row column decidim_awesome-form">
|
2
|
+
<% if config_enabled? :auto_save_forms %>
|
3
|
+
|
4
|
+
<%= form.check_box :auto_save_forms %>
|
5
|
+
<p class="help-text"><%= t("help.auto_save_forms", scope: "decidim.decidim_awesome.admin.config.form") %></p>
|
6
|
+
|
7
|
+
<%= render(partial: "decidim/decidim_awesome/admin/config/constraints", locals: { key: :auto_save_forms, constraints: constraints_for(:auto_save_forms) }) %>
|
8
|
+
<% end %>
|
9
|
+
</div>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<div class="reveal decidim_awesome modal loading" id="constraintsModal" data-reveal>
|
2
|
+
<div class="modal-content">
|
3
|
+
|
4
|
+
</div>
|
5
|
+
|
6
|
+
<div class="spinner"></div>
|
7
|
+
|
8
|
+
<button class="close-button" data-close aria-label="Close modal" type="button">
|
9
|
+
<span aria-hidden="true">×</span>
|
10
|
+
</button>
|
11
|
+
</div>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<%= decidim_form_for(@form, method: :patch, url: decidim_admin_decidim_awesome.config_path(params[:var])) do |f| %>
|
2
|
+
<div class="card">
|
3
|
+
<div class="card-divider">
|
4
|
+
<h2 class="card-title"><%= t(".title", setting: params[:var]) %></h2>
|
5
|
+
</div>
|
6
|
+
<div class="card-section">
|
7
|
+
<%= render partial: "form_#{params[:var]}", locals: { form: f } %>
|
8
|
+
</div>
|
9
|
+
</div>
|
10
|
+
<div class="button--double form-general-submit">
|
11
|
+
<%= f.submit t(".update") %>
|
12
|
+
</div>
|
13
|
+
<% end %>
|
14
|
+
|
15
|
+
<%= render partial: "modal" %>
|
@@ -0,0 +1,56 @@
|
|
1
|
+
<div class="field" id="constraint-form-<%= params[:id] %>">
|
2
|
+
|
3
|
+
<%= form.select :participatory_space_manifest, participatory_space_manifests.invert, include_blank: true %>
|
4
|
+
<%= form.select :participatory_space_slug, participatory_spaces_list(@form.participatory_space_manifest).invert, include_blank: true %>
|
5
|
+
<%= form.select :component_manifest, component_manifests(@form.participatory_space_manifest).invert, include_blank: true %>
|
6
|
+
<%= form.select :component_id, components_list(@form.participatory_space_manifest, @form.participatory_space_slug).invert, include_blank: true %>
|
7
|
+
|
8
|
+
</div>
|
9
|
+
|
10
|
+
<script type="text/javascript">
|
11
|
+
|
12
|
+
(function() {
|
13
|
+
var div = document.getElementById('constraint-form-<%= params[:id] %>');
|
14
|
+
var space_manifest = div.getElementsByTagName("select")[0];
|
15
|
+
var space_slug = div.getElementsByTagName("select")[1];
|
16
|
+
var component_manifest = div.getElementsByTagName("select")[2];
|
17
|
+
var component_id = div.getElementsByTagName("select")[3];
|
18
|
+
|
19
|
+
space_manifest.addEventListener('change', function(e) {
|
20
|
+
var event = new CustomEvent("constraint:change", {
|
21
|
+
detail: [{
|
22
|
+
key: "participatory_space_manifest",
|
23
|
+
value: e.target.value
|
24
|
+
}]
|
25
|
+
});
|
26
|
+
// Dispatch detail as event so main processor will reload accordingly
|
27
|
+
document.body.dispatchEvent(event);
|
28
|
+
});
|
29
|
+
|
30
|
+
space_slug.addEventListener('change', function(e) {
|
31
|
+
var event = new CustomEvent("constraint:change", {
|
32
|
+
detail: [{
|
33
|
+
key: "participatory_space_manifest",
|
34
|
+
value: space_manifest.value
|
35
|
+
},{
|
36
|
+
key: "participatory_space_slug",
|
37
|
+
value: e.target.value
|
38
|
+
}]
|
39
|
+
});
|
40
|
+
// Dispatch detail as event so main processor will reload accordingly
|
41
|
+
document.body.dispatchEvent(event);
|
42
|
+
});
|
43
|
+
|
44
|
+
// Component manfiest and component id are mutually exclusive
|
45
|
+
component_manifest.addEventListener('change', function(e) {
|
46
|
+
if(e.target.value)
|
47
|
+
component_id.value = "";
|
48
|
+
});
|
49
|
+
|
50
|
+
component_id.addEventListener('change', function(e) {
|
51
|
+
if(e.target.value)
|
52
|
+
component_manifest.value = "";
|
53
|
+
});
|
54
|
+
})();
|
55
|
+
|
56
|
+
</script>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<%= decidim_form_for(@form, url: constraints_path(key: params[:key]), remote: true) do |f| %>
|
2
|
+
<div class="card">
|
3
|
+
<div class="card-divider">
|
4
|
+
<h2 class="card-title"><%= t ".constraint" %></h2>
|
5
|
+
</div>
|
6
|
+
<div class="card-section">
|
7
|
+
<%= render partial: "form", object: f %>
|
8
|
+
</div>
|
9
|
+
</div>
|
10
|
+
<div class="button--double form-general-submit">
|
11
|
+
<%= f.submit t(".save") %>
|
12
|
+
<button class="button hollow" type="button" data-close><%= t(".cancel") %></button>
|
13
|
+
</div>
|
14
|
+
<% end %>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<%= decidim_form_for(@form, url: constraint_path, method: :patch, remote: true) do |f| %>
|
2
|
+
<div class="card">
|
3
|
+
<div class="card-divider">
|
4
|
+
<h2 class="card-title"><%= t ".constraint" %></h2>
|
5
|
+
</div>
|
6
|
+
<div class="card-section">
|
7
|
+
<%= render partial: "form", object: f %>
|
8
|
+
</div>
|
9
|
+
</div>
|
10
|
+
<div class="button--double form-general-submit">
|
11
|
+
<%= f.submit t(".save") %>
|
12
|
+
<button class="button hollow" type="button" data-close><%= t(".cancel") %></button>
|
13
|
+
</div>
|
14
|
+
<% end %>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<%= stylesheet_link_tag "decidim/decidim_awesome/awesome_iframe/iframe" %>
|
2
|
+
|
3
|
+
<style rel="stylesheet" type="text/css">
|
4
|
+
<%= ".wrapper { padding: 0; }" if remove_margins? %>
|
5
|
+
</style>
|
6
|
+
|
7
|
+
<div class="awesome-iframe<%= " row" if viewport_width? %>">
|
8
|
+
<%= iframe %>
|
9
|
+
</div>
|
@@ -0,0 +1,74 @@
|
|
1
|
+
<%= render partial: "decidim/shared/component_announcement" %>
|
2
|
+
|
3
|
+
<%= dynamic_map_for map_components do %>
|
4
|
+
|
5
|
+
<template id="marker-proposal-popup">
|
6
|
+
<div class="map-info__content">
|
7
|
+
<h3>${title}</h3>
|
8
|
+
<div id="bodyContent">
|
9
|
+
<p>{{html body}}</p>
|
10
|
+
<div class="map__date-adress">
|
11
|
+
<div class="address card__extra">
|
12
|
+
<div class="address__icon">{{html icon}}</div>
|
13
|
+
<div class="address__details">
|
14
|
+
<span>${address}</span><br>
|
15
|
+
</div>
|
16
|
+
</div>
|
17
|
+
</div>
|
18
|
+
<div class="map-info__button">
|
19
|
+
<a href="${link}" class="button button--sc">
|
20
|
+
<%= t(".view_proposal") %>
|
21
|
+
</a>
|
22
|
+
</div>
|
23
|
+
</div>
|
24
|
+
</div>
|
25
|
+
</template>
|
26
|
+
|
27
|
+
<template id="marker-meeting-popup">
|
28
|
+
<div class="map-info__content">
|
29
|
+
<h3>${title.translation}</h3>
|
30
|
+
<div id="bodyContent">
|
31
|
+
<p>{{html description.translation}}</p>
|
32
|
+
<div class="map__date-adress">
|
33
|
+
<div class="card__datetime">
|
34
|
+
<div class="card__datetime__date">
|
35
|
+
${startTimeDay} <span class="card__datetime__month">${startTimeMonth} ${startTimeYear}</span>
|
36
|
+
</div>
|
37
|
+
<div class="card__datetime__time">${starTime}</div>
|
38
|
+
</div>
|
39
|
+
<div class="address card__extra">
|
40
|
+
<div class="address__icon">{{html icon}}</div>
|
41
|
+
<div class="address__details">
|
42
|
+
<strong>{{html location.translation}}</strong><br>
|
43
|
+
<span>${address}</span><br>
|
44
|
+
<span>{{html locationHints.translation}}</span>
|
45
|
+
</div>
|
46
|
+
</div>
|
47
|
+
</div>
|
48
|
+
<div class="map-info__button">
|
49
|
+
<a href="${link}" class="button button--sc">
|
50
|
+
<%= t("decidim.meetings.meetings_map.view_meeting") %>
|
51
|
+
</a>
|
52
|
+
</div>
|
53
|
+
</div>
|
54
|
+
</div>
|
55
|
+
</template>
|
56
|
+
|
57
|
+
<%= stylesheet_link_tag "decidim/decidim_awesome/awesome_map/map" %>
|
58
|
+
<style type="text/css">
|
59
|
+
#map {
|
60
|
+
height: <%= current_component.settings.map_height %>px;
|
61
|
+
}
|
62
|
+
<% current_categories.each do |category| %>
|
63
|
+
.awesome_map-category_<%= category[:id] %> {
|
64
|
+
background-color: <%= category[:color] %> !important;
|
65
|
+
margin-left: <%= category[:parent] ? "1" : "0" %>em;
|
66
|
+
}
|
67
|
+
<% end %>
|
68
|
+
</style>
|
69
|
+
<script>
|
70
|
+
window.AwesomeMap = window.AwesomeMap || {};
|
71
|
+
window.AwesomeMap.categories = <%= current_categories.to_json.html_safe %>;
|
72
|
+
</script>
|
73
|
+
<%= javascript_include_tag "decidim/decidim_awesome/awesome_map/map" %>
|
74
|
+
<% end %>
|