decidim-navigation_maps 1.0.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 +144 -0
- data/Rakefile +40 -0
- data/app/assets/config/admin/decidim_navigation_maps_manifest.css +3 -0
- data/app/assets/config/admin/decidim_navigation_maps_manifest.js +3 -0
- data/app/assets/config/decidim_navigation_maps_manifest.css +3 -0
- data/app/assets/config/decidim_navigation_maps_manifest.js +1 -0
- data/app/assets/images/decidim/navigation_maps/icon.svg +1 -0
- data/app/assets/javascripts/decidim/navigation_maps/admin/map_editor.js +88 -0
- data/app/assets/javascripts/decidim/navigation_maps/admin/navigation_maps.js +143 -0
- data/app/assets/javascripts/decidim/navigation_maps/map_view.js +123 -0
- data/app/assets/javascripts/decidim/navigation_maps/navigation_maps.js +44 -0
- data/app/assets/stylesheets/decidim/navigation_maps/_variables.scss +3 -0
- data/app/assets/stylesheets/decidim/navigation_maps/admin/navigation_maps.scss +102 -0
- data/app/assets/stylesheets/decidim/navigation_maps/navigation_maps.scss +58 -0
- data/app/cells/decidim/navigation_maps/content_blocks/navigation_map/_styles.erb +18 -0
- data/app/cells/decidim/navigation_maps/content_blocks/navigation_map/_tabs.erb +5 -0
- data/app/cells/decidim/navigation_maps/content_blocks/navigation_map/_tabs_content.erb +8 -0
- data/app/cells/decidim/navigation_maps/content_blocks/navigation_map/_template.erb +13 -0
- data/app/cells/decidim/navigation_maps/content_blocks/navigation_map/show.erb +21 -0
- data/app/cells/decidim/navigation_maps/content_blocks/navigation_map_cell.rb +22 -0
- data/app/cells/decidim/navigation_maps/content_blocks/navigation_map_settings_form/_form.erb +36 -0
- data/app/cells/decidim/navigation_maps/content_blocks/navigation_map_settings_form/_modal.erb +12 -0
- data/app/cells/decidim/navigation_maps/content_blocks/navigation_map_settings_form/_tabs.erb +6 -0
- data/app/cells/decidim/navigation_maps/content_blocks/navigation_map_settings_form/_tabs_content.erb +11 -0
- data/app/cells/decidim/navigation_maps/content_blocks/navigation_map_settings_form/show.erb +35 -0
- data/app/cells/decidim/navigation_maps/content_blocks/navigation_map_settings_form_cell.rb +32 -0
- data/app/commands/decidim/navigation_maps/save_area.rb +58 -0
- data/app/commands/decidim/navigation_maps/save_blueprints.rb +72 -0
- data/app/controllers/decidim/navigation_maps/admin/application_controller.rb +13 -0
- data/app/controllers/decidim/navigation_maps/admin/areas_controller.rb +94 -0
- data/app/controllers/decidim/navigation_maps/admin/blueprints_controller.rb +64 -0
- data/app/forms/decidim/navigation_maps/area_form.rb +37 -0
- data/app/forms/decidim/navigation_maps/blueprint_form.rb +39 -0
- data/app/forms/decidim/navigation_maps/blueprint_forms.rb +9 -0
- data/app/models/decidim/navigation_maps/application_record.rb +10 -0
- data/app/models/decidim/navigation_maps/blueprint.rb +27 -0
- data/app/models/decidim/navigation_maps/blueprint_area.rb +32 -0
- data/app/queries/decidim/navigation_maps/organization_blueprints.rb +20 -0
- data/app/uploaders/decidim/navigation_maps/blueprint_uploader.rb +22 -0
- data/app/views/decidim/navigation_maps/admin/areas/_form.html.erb +39 -0
- data/app/views/decidim/navigation_maps/admin/areas/new.html.erb +17 -0
- data/app/views/decidim/navigation_maps/admin/areas/show.html.erb +14 -0
- data/config/i18n-tasks.yml +10 -0
- data/config/locales/ca.yml +45 -0
- data/config/locales/cs.yml +45 -0
- data/config/locales/en.yml +46 -0
- data/config/locales/es.yml +45 -0
- data/db/migrate/20191022092624_create_decidim_navigation_maps_blueprints.rb +13 -0
- data/db/migrate/20191120185739_add_title_to_navigation_maps_blueprints.rb +10 -0
- data/db/migrate/20191125142751_create_decidim_navigation_maps_blueprint_areas.rb +18 -0
- data/db/migrate/20191126045831_add_link_type_to_decidim_navigation_maps_blueprint_areas.rb +8 -0
- data/db/migrate/20191126154019_add_area_id_to_decidim_navigation_maps_blueprint_areas.rb +16 -0
- data/db/migrate/20191127093746_add_color_to_navigation_maps_blueprint_areas.rb +7 -0
- data/lib/decidim/navigation_maps.rb +13 -0
- data/lib/decidim/navigation_maps/admin.rb +10 -0
- data/lib/decidim/navigation_maps/admin_engine.rb +34 -0
- data/lib/decidim/navigation_maps/engine.rb +34 -0
- data/lib/decidim/navigation_maps/navigation_map_cell_helpers.rb +28 -0
- data/lib/decidim/navigation_maps/test/factories.rb +29 -0
- data/lib/decidim/navigation_maps/version.rb +9 -0
- data/vendor/assets/images/draw/layers-2x.png +0 -0
- data/vendor/assets/images/draw/layers.png +0 -0
- data/vendor/assets/images/draw/marker-icon-2x.png +0 -0
- data/vendor/assets/images/draw/marker-icon.png +0 -0
- data/vendor/assets/images/draw/marker-shadow.png +0 -0
- data/vendor/assets/images/draw/spritesheet-2x.png +0 -0
- data/vendor/assets/images/draw/spritesheet.png +0 -0
- data/vendor/assets/images/draw/spritesheet.svg +156 -0
- data/vendor/assets/images/images/layers-2x.png +0 -0
- data/vendor/assets/images/images/layers.png +0 -0
- data/vendor/assets/images/images/marker-icon-2x.png +0 -0
- data/vendor/assets/images/images/marker-icon.png +0 -0
- data/vendor/assets/images/images/marker-shadow.png +0 -0
- data/vendor/assets/javascripts/jquery.form.js +1277 -0
- data/vendor/assets/javascripts/jsrender.min.js +4 -0
- data/vendor/assets/javascripts/jsrender.min.js.map +1 -0
- data/vendor/assets/javascripts/leaflet-geoman.min.js +1 -0
- data/vendor/assets/javascripts/leaflet.js +5 -0
- data/vendor/assets/stylesheets/leaflet-geoman.css +164 -0
- metadata +183 -0
@@ -0,0 +1,44 @@
|
|
1
|
+
// Place all the behaviors and hooks related to the matching controller here.
|
2
|
+
// All this logic will automatically be available in application.js.
|
3
|
+
//= require decidim/navigation_maps/map_view
|
4
|
+
//= require jsrender.min
|
5
|
+
//= require_self
|
6
|
+
|
7
|
+
$(function() {
|
8
|
+
|
9
|
+
var $maps = $('.navigation_maps .map');
|
10
|
+
var $tabs = $('#navigation_maps-tabs');
|
11
|
+
var maps = {};
|
12
|
+
var tmpl = $.templates("#navigation_maps-popup");
|
13
|
+
|
14
|
+
$maps.each(function() {
|
15
|
+
var id = $(this).data('id');
|
16
|
+
maps[id] = new NavigationMapView(this);
|
17
|
+
maps[id].onSetLayerProperties(function(layer, props) {
|
18
|
+
if(!props.popup) {
|
19
|
+
var node = document.createElement("div");
|
20
|
+
var html = tmpl.render(props);
|
21
|
+
$(node).html(html);
|
22
|
+
|
23
|
+
layer.bindPopup(node, {
|
24
|
+
maxHeight: 400,
|
25
|
+
// autoPan: false,
|
26
|
+
maxWidth: 640,
|
27
|
+
minWidth: 200,
|
28
|
+
keepInView: true,
|
29
|
+
className: `navigation_map-info map-info-${id}-${layer._leaflet_id}`
|
30
|
+
});
|
31
|
+
}
|
32
|
+
});
|
33
|
+
maps[id].onClickArea(function(area) {
|
34
|
+
var popup = area.feature.properties && area.feature.properties.link && area.feature.properties.popup;
|
35
|
+
if(popup) location = area.feature.properties.link;
|
36
|
+
});
|
37
|
+
});
|
38
|
+
|
39
|
+
$tabs.on('change.zf.tabs', function(e, $tab, $content) {
|
40
|
+
var id = $content.find('.map').data('id');
|
41
|
+
maps[id].reload();
|
42
|
+
});
|
43
|
+
|
44
|
+
});
|
@@ -0,0 +1,102 @@
|
|
1
|
+
//= require leaflet
|
2
|
+
//= require leaflet-geoman
|
3
|
+
//= require_self
|
4
|
+
|
5
|
+
@import "decidim/variables";
|
6
|
+
@import "decidim/utils/settings";
|
7
|
+
@import "decidim/utils/mixins";
|
8
|
+
@import "decidim/navigation_maps/variables";
|
9
|
+
|
10
|
+
.navigation_maps.admin {
|
11
|
+
.accordion-item {
|
12
|
+
.accordion-title {
|
13
|
+
border: 1px solid #ccc !important;
|
14
|
+
}
|
15
|
+
&.is-active {
|
16
|
+
.accordion-title {
|
17
|
+
background-color: #039be5;
|
18
|
+
border-color: "rgba(#{$leaflet-background-color}, 1)" !important;
|
19
|
+
}
|
20
|
+
}
|
21
|
+
}
|
22
|
+
|
23
|
+
>.content {
|
24
|
+
position: relative;
|
25
|
+
}
|
26
|
+
.loading {
|
27
|
+
display: none;
|
28
|
+
z-index: 10000;
|
29
|
+
content: "";
|
30
|
+
position: absolute;
|
31
|
+
background-color: rgba(255,255,255,.8);
|
32
|
+
top: 0;
|
33
|
+
left: 0;
|
34
|
+
width: 100%;
|
35
|
+
height: 100%;
|
36
|
+
.inner-loading {
|
37
|
+
margin-top: 25%;
|
38
|
+
width: 90%;
|
39
|
+
display: inline-block;
|
40
|
+
text-align: center;
|
41
|
+
|
42
|
+
}
|
43
|
+
.spinner {
|
44
|
+
@include spinner(25px, #aaa, var(--secondary), 800ms);
|
45
|
+
vertical-align: middle;
|
46
|
+
}
|
47
|
+
.progress {
|
48
|
+
background-color: #aaa;
|
49
|
+
display: inline-block;
|
50
|
+
width: 90%;
|
51
|
+
margin-left: 1em;
|
52
|
+
}
|
53
|
+
.progress-meter {
|
54
|
+
color: #fff;
|
55
|
+
background-color: var(--secondary);
|
56
|
+
width: 30%;
|
57
|
+
padding:0 0.5em;
|
58
|
+
font-size: 0.7em;
|
59
|
+
font-weight: bold;
|
60
|
+
}
|
61
|
+
|
62
|
+
}
|
63
|
+
|
64
|
+
.tabs-content {
|
65
|
+
.map {
|
66
|
+
height: 475px;
|
67
|
+
}
|
68
|
+
.thumbnail {
|
69
|
+
img {
|
70
|
+
max-height: 100px;
|
71
|
+
}
|
72
|
+
}
|
73
|
+
.delete-tab {
|
74
|
+
border-top: 1px solid $dark-gray;
|
75
|
+
padding: 1em 1em 0;
|
76
|
+
}
|
77
|
+
.leaflet-interactive {
|
78
|
+
fill: "rgba(#{$leaflet-background-color}, 1)";
|
79
|
+
color: "rgba(#{$leaflet-background-color}, 1)";
|
80
|
+
weight: 3;
|
81
|
+
opacity: 0.6;
|
82
|
+
fill-opacity: 0.5;
|
83
|
+
&.selected {
|
84
|
+
opacity: 1;
|
85
|
+
}
|
86
|
+
}
|
87
|
+
}
|
88
|
+
|
89
|
+
}
|
90
|
+
|
91
|
+
.navigation_maps.modal {
|
92
|
+
.spinner {
|
93
|
+
@include spinner(25px, #aaa, var(--secondary), 800ms);
|
94
|
+
vertical-align: middle;
|
95
|
+
display: none;
|
96
|
+
}
|
97
|
+
&.loading {
|
98
|
+
.spinner {
|
99
|
+
display: inline-block;
|
100
|
+
}
|
101
|
+
}
|
102
|
+
}
|
@@ -0,0 +1,58 @@
|
|
1
|
+
//= require leaflet
|
2
|
+
//= require leaflet-geoman
|
3
|
+
//= require_self
|
4
|
+
|
5
|
+
@import "decidim/navigation_maps/variables";
|
6
|
+
|
7
|
+
.home-section {
|
8
|
+
.navigation_maps {
|
9
|
+
margin: 1em 0;
|
10
|
+
.tabs {
|
11
|
+
background-color: #f4f4f4;
|
12
|
+
}
|
13
|
+
.tabs-title {
|
14
|
+
a {
|
15
|
+
font-size: 1.2em;
|
16
|
+
color: var(--secondary);
|
17
|
+
}
|
18
|
+
}
|
19
|
+
.tabs-content {
|
20
|
+
border-color: #f4f4f4;
|
21
|
+
}
|
22
|
+
.map {
|
23
|
+
height: 475px;
|
24
|
+
@media (max-width: 480px) {
|
25
|
+
height: 240px;
|
26
|
+
}
|
27
|
+
}
|
28
|
+
.map-info__content {
|
29
|
+
padding-top: 0;
|
30
|
+
padding-left: 0;
|
31
|
+
}
|
32
|
+
.leaflet-container {
|
33
|
+
background-color: #fafafa;
|
34
|
+
border-color:#f4f4f4;
|
35
|
+
.navigation_map-info {
|
36
|
+
border-style: solid;
|
37
|
+
border-width: 3px;
|
38
|
+
border-radius: 10px;
|
39
|
+
.leaflet-popup-content-wrapper {
|
40
|
+
border-radius: 10px;
|
41
|
+
}
|
42
|
+
.leaflet-popup-tip {
|
43
|
+
border-width: 3px;
|
44
|
+
}
|
45
|
+
}
|
46
|
+
}
|
47
|
+
.leaflet-interactive {
|
48
|
+
fill: "rgba(#{$leaflet-background-color}, 1)";
|
49
|
+
color: "rgba(#{$leaflet-background-color}, 1)";
|
50
|
+
weight: 3;
|
51
|
+
opacity: 0.6;
|
52
|
+
fill-opacity: 0.5;
|
53
|
+
&.selected {
|
54
|
+
opacity: 1;
|
55
|
+
}
|
56
|
+
}
|
57
|
+
}
|
58
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<style type="text/css">
|
2
|
+
<% blueprints.each do |blueprint| %>
|
3
|
+
<% next unless blueprint.areas %>
|
4
|
+
<% blueprint.areas.each do |area| %>
|
5
|
+
.map-info-<%= blueprint.id %>-<%= area.area_id %> {
|
6
|
+
border-color: <%= area.color %> !important;
|
7
|
+
}
|
8
|
+
.map-info-<%= blueprint.id %>-<%= area.area_id %> .leaflet-popup-tip {
|
9
|
+
border-color: <%= area.color %> !important;
|
10
|
+
}
|
11
|
+
.map-info-<%= blueprint.id %>-<%= area.area_id %> .button {
|
12
|
+
background-color: <%= area.color %>;
|
13
|
+
color: #fff;
|
14
|
+
}
|
15
|
+
|
16
|
+
<% end %>
|
17
|
+
<% end %>
|
18
|
+
</style>
|
@@ -0,0 +1,5 @@
|
|
1
|
+
<ul class="tabs" data-deep-link="true" data-update-history="true" data-deep-link-smudge="true" data-deep-link-smudge-delay="500" data-tabs id="navigation_maps-tabs">
|
2
|
+
<% tabs.each_with_index do |item, index| %>
|
3
|
+
<li class="tabs-title<%= " is-active" if index.zero? %>"><a data-tabs-target="map<%= index %>" href="#map<%= index %>"><%= translated_attribute(item.title).presence || "Tab #{index + 1}" %></a></li>
|
4
|
+
<% end %>
|
5
|
+
</ul>
|
@@ -0,0 +1,8 @@
|
|
1
|
+
|
2
|
+
<div class="tabs-content admin" data-tabs-content="navigation_maps-tabs">
|
3
|
+
<% tabs.each_with_index do |item, index| %>
|
4
|
+
<div class="tabs-panel<%= " is-active" if index.zero? %>" id="map<%= index %>">
|
5
|
+
<%= content_tag(:div, "", id: "navigation_maps-map-#{item.id}", class: "map", data: { id: item.id, image: item.image.url, blueprint: item.blueprint }) %>
|
6
|
+
</div>
|
7
|
+
<% end %>
|
8
|
+
</div>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<script id="navigation_maps-popup" type="text/x-jsrender">
|
2
|
+
<div class="map-info__content">
|
3
|
+
<h3>{{:title}}</h3>
|
4
|
+
<div id="bodyContent">
|
5
|
+
<p>{{:description}}</p>
|
6
|
+
<div class="map-info__button">
|
7
|
+
<a href="{{:link}}" class="button button--sc">
|
8
|
+
<%= t(".view") %>
|
9
|
+
</a>
|
10
|
+
</div>
|
11
|
+
</div>
|
12
|
+
</div>
|
13
|
+
</script>
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<%= stylesheet_link_tag "decidim/navigation_maps/navigation_maps" %>
|
2
|
+
<%= render partial: "styles", locals: { blueprints: valid_blueprints } %>
|
3
|
+
|
4
|
+
<section class="extended home-section">
|
5
|
+
<div class="wrapper-home">
|
6
|
+
<div class="row column text-center">
|
7
|
+
|
8
|
+
<% if translated_title.present? %>
|
9
|
+
<h3 class="heading3"><%= decidim_sanitize translated_title %></h3>
|
10
|
+
<% end %>
|
11
|
+
|
12
|
+
<div class="navigation_maps">
|
13
|
+
<%= render partial: "tabs", locals: { tabs: valid_blueprints } %>
|
14
|
+
<%= render partial: "tabs_content", locals: { tabs: valid_blueprints } %>
|
15
|
+
</div>
|
16
|
+
</div>
|
17
|
+
</div>
|
18
|
+
</section>
|
19
|
+
|
20
|
+
<%= render partial: "template" %>
|
21
|
+
<%= javascript_include_tag "decidim/navigation_maps/navigation_maps" %>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module NavigationMaps
|
5
|
+
module ContentBlocks
|
6
|
+
class NavigationMapCell < Decidim::ViewModel
|
7
|
+
include NavigationMaps::NavigationMapCellHelpers
|
8
|
+
include Decidim::SanitizeHelper
|
9
|
+
|
10
|
+
view_paths << "#{Decidim::NavigationMaps::Engine.root}/app/cells/decidim/navigation_maps/content_blocks/navigation_map"
|
11
|
+
|
12
|
+
def show
|
13
|
+
render if valid_blueprints?
|
14
|
+
end
|
15
|
+
|
16
|
+
def translated_title
|
17
|
+
translated_attribute(model.settings.title)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
<ul class="accordion" data-accordion>
|
2
|
+
<li class="accordion-item<%= " is-active" unless form.image? %>" data-accordion-item>
|
3
|
+
<a href="#" class="accordion-title"><%= t ".info" %></a>
|
4
|
+
|
5
|
+
<div class="accordion-content" data-tab-content>
|
6
|
+
<%= translated_field_tag :text_field_tag, "blueprints[#{form.ident}]", :title, form.title, { tabs_id: "blueprints_#{form.ident}_title", label: t(".title") } %>
|
7
|
+
|
8
|
+
<%= label_tag t(".blueprint_image") %>
|
9
|
+
<div class="thumbnail">
|
10
|
+
<%= image_tag form.image.thumbnail.url if form.image? %>
|
11
|
+
</div>
|
12
|
+
<%= file_field_tag "blueprints[#{form.ident}][image]", { id: "blueprints_#{form.ident}_image", label: t(".title") } %>
|
13
|
+
|
14
|
+
<%= hidden_field_tag "blueprints[#{form.ident}][id]", form.id, { id: "blueprints_#{form.ident}_id" } %>
|
15
|
+
<%= hidden_field_tag "blueprints[#{form.ident}][blueprint]", form.blueprint.to_json, { id: "blueprints_#{form.ident}_blueprint" } %>
|
16
|
+
|
17
|
+
<% if form.id %>
|
18
|
+
<label class="delete-tab">
|
19
|
+
<%= check_box_tag("blueprints[#{form.ident}][remove]", form.id) %>
|
20
|
+
<%= t(".remove_blueprint") %>
|
21
|
+
</label>
|
22
|
+
<% end %>
|
23
|
+
</div>
|
24
|
+
</li>
|
25
|
+
|
26
|
+
<% if form.image? %>
|
27
|
+
<li class="accordion-item is-active" data-accordion-item>
|
28
|
+
<a href="#" class="accordion-title"><%= t ".editor" %></a>
|
29
|
+
<div class="accordion-content navigation_maps-content" data-tab-content>
|
30
|
+
|
31
|
+
<%= content_tag(:div, "", id: "navigation_maps-map-#{form.ident}", class: "map", data: { id: form.ident, image: form.image.url, blueprint: form.blueprint }) %>
|
32
|
+
|
33
|
+
</div>
|
34
|
+
</li>
|
35
|
+
<% end %>
|
36
|
+
</ul>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
|
2
|
+
<div class="reveal navigation_maps modal loading" id="mapEditModal" data-reveal>
|
3
|
+
<div class="modal-content">
|
4
|
+
|
5
|
+
</div>
|
6
|
+
|
7
|
+
<div class="spinner"></div>
|
8
|
+
|
9
|
+
<button class="close-button" data-close aria-label="Close modal" type="button">
|
10
|
+
<span aria-hidden="true">×</span>
|
11
|
+
</button>
|
12
|
+
</div>
|
@@ -0,0 +1,6 @@
|
|
1
|
+
<ul class="tabs" data-deep-link="true" data-update-history="true" data-deep-link-smudge="true" data-deep-link-smudge-delay="500" data-tabs id="navigation_maps-tabs">
|
2
|
+
<% tabs.each_with_index do |item, index| %>
|
3
|
+
<li class="tabs-title<%= " is-active" if index.zero? %>"><a data-tabs-target="map<%= index %>" href="#map<%= index %>"><%= translated_attribute(item.title).presence || "Tab #{index + 1}" %></a></li>
|
4
|
+
<% end %>
|
5
|
+
<li class="tabs-title"><a href="#map-new">+ <%= t ".add" %></a></li>
|
6
|
+
</ul>
|
data/app/cells/decidim/navigation_maps/content_blocks/navigation_map_settings_form/_tabs_content.erb
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
|
2
|
+
<div class="tabs-content" data-tabs-content="navigation_maps-tabs">
|
3
|
+
<% tabs.each_with_index do |item, index| %>
|
4
|
+
<div class="tabs-panel<%= " is-active" if index.zero? %>" id="map<%= index %>">
|
5
|
+
<%= render partial: "form", locals: { form: blueprint_form(item) } %>
|
6
|
+
</div>
|
7
|
+
<% end %>
|
8
|
+
<div class="tabs-panel" id="map-new">
|
9
|
+
<%= render partial: "form", locals: { form: blueprint_form } %>
|
10
|
+
</div>
|
11
|
+
</div>
|
@@ -0,0 +1,35 @@
|
|
1
|
+
<!-- Original settings -->
|
2
|
+
<% form.fields_for :settings, form.object.settings do |settings_fields| %>
|
3
|
+
<%= settings_fields.translated :text_field, :title %>
|
4
|
+
<% end %>
|
5
|
+
|
6
|
+
<!-- Override rails default patch (using post via ajax) -->
|
7
|
+
<%= hidden_field_tag :_method, "post" %>
|
8
|
+
<%= hidden_field_tag :action, blueprints_path %>
|
9
|
+
|
10
|
+
<div class="navigation_maps admin">
|
11
|
+
<div class="callout" style="display:none" data-closable>
|
12
|
+
<p></p>
|
13
|
+
<button class="close-button" aria-label="Dismiss alert" type="button" data-close>
|
14
|
+
<span aria-hidden="true">×</span>
|
15
|
+
</button>
|
16
|
+
</div>
|
17
|
+
|
18
|
+
<div class="content">
|
19
|
+
<%= render partial: "tabs", locals: { tabs: blueprints } %>
|
20
|
+
<%= render partial: "tabs_content", locals: { tabs: blueprints } %>
|
21
|
+
|
22
|
+
<div class="loading">
|
23
|
+
<div class="inner-loading">
|
24
|
+
<div class="spinner"></div>
|
25
|
+
<div class="progress" role="progressbar" tabindex="0" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100">
|
26
|
+
<div class="progress-meter">0%</div>
|
27
|
+
</div>
|
28
|
+
</div>
|
29
|
+
</div>
|
30
|
+
</div>
|
31
|
+
</div>
|
32
|
+
|
33
|
+
<%= render partial: "modal" %>
|
34
|
+
<%= javascript_include_tag "decidim/navigation_maps/admin/navigation_maps" %>
|
35
|
+
<%= stylesheet_link_tag "decidim/navigation_maps/admin/navigation_maps" %>
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module NavigationMaps
|
5
|
+
module ContentBlocks
|
6
|
+
class NavigationMapSettingsFormCell < Decidim::ViewModel
|
7
|
+
include NavigationMaps::NavigationMapCellHelpers
|
8
|
+
alias form model
|
9
|
+
|
10
|
+
view_paths << "#{Decidim::NavigationMaps::Engine.root}/app/cells/decidim/navigation_maps/content_blocks/navigation_map_settings_form"
|
11
|
+
|
12
|
+
def blueprint_form(blueprint = nil)
|
13
|
+
blueprint ||= Blueprint.new
|
14
|
+
BlueprintForm.from_model(blueprint).with_context(organization: current_organization)
|
15
|
+
end
|
16
|
+
|
17
|
+
# it should come from the Engine Routes
|
18
|
+
def blueprints_path
|
19
|
+
"/admin/navigation_maps/blueprints"
|
20
|
+
end
|
21
|
+
|
22
|
+
def content_block
|
23
|
+
options[:content_block]
|
24
|
+
end
|
25
|
+
|
26
|
+
def label
|
27
|
+
I18n.t("decidim.content_blocks.html.html_content")
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|