decidim-decidim_geo 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (146) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE-AGPLv3.txt +661 -0
  3. data/README.md +172 -0
  4. data/Rakefile +119 -0
  5. data/app/cells/decidim/geo/content_blocks/geo_maps/show.erb +15 -0
  6. data/app/cells/decidim/geo/content_blocks/geo_maps_cell.rb +114 -0
  7. data/app/cells/decidim/geo/content_blocks/geo_maps_settings_form_cell.rb +14 -0
  8. data/app/cells/decidim/geo/geo_collection_map/show.erb +4 -0
  9. data/app/cells/decidim/geo/geo_collection_map_cell.rb +102 -0
  10. data/app/commands/decidim/admin/create_scope.rb +56 -0
  11. data/app/commands/decidim/admin/create_scope_type.rb +47 -0
  12. data/app/commands/decidim/admin/update_scope.rb +60 -0
  13. data/app/commands/decidim/admin/update_scope_type.rb +62 -0
  14. data/app/commands/decidim/geo/admin/create_shapefile.rb +51 -0
  15. data/app/commands/decidim/geo/admin/update_geo_config.rb +54 -0
  16. data/app/commands/decidim/geo/command.rb +14 -0
  17. data/app/controllers/decidim/admin/scopes_controller.rb +115 -0
  18. data/app/controllers/decidim/geo/admin/application_controller.rb +21 -0
  19. data/app/controllers/decidim/geo/admin/geo_configs_controller.rb +44 -0
  20. data/app/controllers/decidim/geo/admin/shapefiles_controller.rb +41 -0
  21. data/app/controllers/decidim/geo/application_controller.rb +13 -0
  22. data/app/controllers/decidim/geo/shapefile_controller.rb +11 -0
  23. data/app/forms/decidim/admin/scope_form.rb +43 -0
  24. data/app/forms/decidim/admin/scope_type_form.rb +27 -0
  25. data/app/forms/decidim/geo/admin/geo_config_form.rb +20 -0
  26. data/app/forms/decidim/geo/admin/shapefile_form.rb +23 -0
  27. data/app/helpers/decidim/admin/scopes_helper.rb +72 -0
  28. data/app/jobs/decidim/geo/shp2pgsql_job.rb +14 -0
  29. data/app/models/decidim/debates/debate.rb +226 -0
  30. data/app/models/decidim/geo/application_record.rb +10 -0
  31. data/app/models/decidim/geo/geo_config.rb +28 -0
  32. data/app/models/decidim/geo/shapedata.rb +23 -0
  33. data/app/models/decidim/geo/shapefile.rb +27 -0
  34. data/app/models/decidim/geo/space_location.rb +16 -0
  35. data/app/models/decidim/scope.rb +111 -0
  36. data/app/models/decidim/scope_type.rb +26 -0
  37. data/app/overrides/decidim/assemblies/admin/assemblies/_form/insert_location_form.html.erb.deface +13 -0
  38. data/app/overrides/decidim/assemblies/assemblies/show/insert_location.html.erb.deface +7 -0
  39. data/app/overrides/decidim/participatory_processes/admin/participatory_processes/_form/insert_location_form.html.erb.deface +13 -0
  40. data/app/overrides/decidim/participatory_processes/participatory_process_groups/show/insert_map.html.erb.deface +6 -0
  41. data/app/overrides/layouts/decidim/_assembly_header/insert_map.html.erb.deface +25 -0
  42. data/app/overrides/layouts/decidim/_process_header/insert_map.html.erb.deface +22 -0
  43. data/app/overrides/layouts/decidim/_wrapper/insert_map.html.erb.deface +5 -0
  44. data/app/overrides/remove_default_meetings_map.rb +4 -0
  45. data/app/overrides/remove_default_proposals_map.rb +4 -0
  46. data/app/packs/entrypoints/decidim_geo.js +3 -0
  47. data/app/packs/images/decidim/geo/not-geolocated.svg +3 -0
  48. data/app/packs/src/decidim/geo/actions/index.js +25 -0
  49. data/app/packs/src/decidim/geo/api/index.js +53 -0
  50. data/app/packs/src/decidim/geo/api/queries.js +77 -0
  51. data/app/packs/src/decidim/geo/bootstrap.js +6 -0
  52. data/app/packs/src/decidim/geo/index.js +101 -0
  53. data/app/packs/src/decidim/geo/models/configStore.js +44 -0
  54. data/app/packs/src/decidim/geo/models/dropdownFilterStore.js +65 -0
  55. data/app/packs/src/decidim/geo/models/filterStore.js +121 -0
  56. data/app/packs/src/decidim/geo/models/geoDatasourceNode/GeoDatasourceNode.js +124 -0
  57. data/app/packs/src/decidim/geo/models/geoDatasourceNode/index.js +1 -0
  58. data/app/packs/src/decidim/geo/models/geoScope/GeoScope.js +128 -0
  59. data/app/packs/src/decidim/geo/models/geoScope/index.js +1 -0
  60. data/app/packs/src/decidim/geo/models/geoStore.js +118 -0
  61. data/app/packs/src/decidim/geo/models/pointStore.js +134 -0
  62. data/app/packs/src/decidim/geo/models/scopeDropdownStore.js +20 -0
  63. data/app/packs/src/decidim/geo/ui/DrawerDetail/fallback.js +42 -0
  64. data/app/packs/src/decidim/geo/ui/DrawerDetail/index.js +2 -0
  65. data/app/packs/src/decidim/geo/ui/DrawerDetail/meetings.js +75 -0
  66. data/app/packs/src/decidim/geo/ui/DrawerMenuItem/fallback.js +45 -0
  67. data/app/packs/src/decidim/geo/ui/DrawerMenuItem/index.js +2 -0
  68. data/app/packs/src/decidim/geo/ui/DrawerMenuItem/meetings.js +62 -0
  69. data/app/packs/src/decidim/geo/ui/createClasses.js +7 -0
  70. data/app/packs/src/decidim/geo/ui/createCustomMarker.js +14 -0
  71. data/app/packs/src/decidim/geo/ui/createDomElement.js +2 -0
  72. data/app/packs/src/decidim/geo/ui/createDrawer.js +170 -0
  73. data/app/packs/src/decidim/geo/ui/createDrawerActions.js +197 -0
  74. data/app/packs/src/decidim/geo/ui/createFilterDropdown.js +320 -0
  75. data/app/packs/src/decidim/geo/ui/createGeoScopeLayer.js +20 -0
  76. data/app/packs/src/decidim/geo/ui/createGeoScopeMenuItem.js +8 -0
  77. data/app/packs/src/decidim/geo/ui/createNodeMarker.js +9 -0
  78. data/app/packs/src/decidim/geo/ui/createNodeMenuItem.js +13 -0
  79. data/app/packs/src/decidim/geo/ui/index.js +8 -0
  80. data/app/packs/src/decidim/geo/ui/initMap.js +22 -0
  81. data/app/packs/src/decidim/geo/utils/index.js +30 -0
  82. data/app/packs/src/decidim/geo/utils/saveConfig.js +15 -0
  83. data/app/packs/stylesheets/decidim/geo/_geo.scss +2 -0
  84. data/app/packs/stylesheets/decidim/geo/geo/_decidim_geo_decidimGeo.scss +476 -0
  85. data/app/packs/stylesheets/decidim/geo/geo/_decidim_geo_override.scss +65 -0
  86. data/app/permissions/decidim/geo/admin/permissions.rb +24 -0
  87. data/app/permissions/decidim/geo/permissions.rb +15 -0
  88. data/app/uploaders/decidim/geo/shapefile_uploader.rb +14 -0
  89. data/app/validators/geocoding_validator.rb +30 -0
  90. data/app/views/decidim/admin/scope_types/_form.html.erb +10 -0
  91. data/app/views/decidim/admin/scope_types/index.html.erb +46 -0
  92. data/app/views/decidim/admin/scopes/_form.html.erb +20 -0
  93. data/app/views/decidim/admin/scopes/index.html.erb +55 -0
  94. data/app/views/decidim/geo/admin/geo_configs/_form.html.erb +47 -0
  95. data/app/views/decidim/geo/admin/geo_configs/index.html.erb +8 -0
  96. data/app/views/decidim/geo/admin/shapefiles/_form.html.erb +29 -0
  97. data/app/views/decidim/geo/admin/shapefiles/index.html.erb +38 -0
  98. data/app/views/decidim/geo/admin/shapefiles/new.html.erb +8 -0
  99. data/app/views/layouts/decidim/decidim_geo/admin/application.html.erb +19 -0
  100. data/config/assets.rb +9 -0
  101. data/config/i18n-tasks.yml +10 -0
  102. data/config/locales/de.yml +102 -0
  103. data/config/locales/en.yml +108 -0
  104. data/config/locales/fr.yml +102 -0
  105. data/db/migrate/20221019184712_add_postgis_extension_to_database.rb +5 -0
  106. data/db/migrate/20221025195520_create_decidim_geo.rb +22 -0
  107. data/db/migrate/20231013082325_create_decidim_geo_config.rb +11 -0
  108. data/db/migrate/20231206115531_add_spaces_config_to_decidim_geo_configs.rb +6 -0
  109. data/db/migrate/20240309004347_add_organization_to_shapefiles.rb +6 -0
  110. data/db/migrate/20240326052727_create_space_locations.rb +18 -0
  111. data/lib/decidim/api/geo_config_type.rb +15 -0
  112. data/lib/decidim/api/geo_coordinates_type.rb +22 -0
  113. data/lib/decidim/api/geo_datasource_type.rb +147 -0
  114. data/lib/decidim/api/geo_dates_type.rb +15 -0
  115. data/lib/decidim/api/geo_query_extension.rb +25 -0
  116. data/lib/decidim/api/geo_scope_api_type.rb +26 -0
  117. data/lib/decidim/api/geo_shapedata_type.rb +18 -0
  118. data/lib/decidim/api/geo_shapefile_type.rb +22 -0
  119. data/lib/decidim/api/input_filters/assembly_input_filter.rb +13 -0
  120. data/lib/decidim/api/input_filters/geo_datasource_input_filter.rb +18 -0
  121. data/lib/decidim/api/input_filters/geoencoded_input_filter.rb +13 -0
  122. data/lib/decidim/api/input_filters/has_scopeable_input_filter.rb +17 -0
  123. data/lib/decidim/api/input_filters/process_input_filter.rb +13 -0
  124. data/lib/decidim/api/input_filters/resource_type_input_filter.rb +13 -0
  125. data/lib/decidim/api/input_filters/scope_input_filter.rb +13 -0
  126. data/lib/decidim/api/input_filters/time_input_filter.rb +13 -0
  127. data/lib/decidim/api/meetings_input_filter.rb +14 -0
  128. data/lib/decidim/api/query_extension.rb +320 -0
  129. data/lib/decidim/api/shapefile_query_extention.rb +18 -0
  130. data/lib/decidim/api/shapefile_type.rb +18 -0
  131. data/lib/decidim/decidim_geo/admin.rb +10 -0
  132. data/lib/decidim/decidim_geo/admin_engine.rb +69 -0
  133. data/lib/decidim/decidim_geo/api.rb +23 -0
  134. data/lib/decidim/decidim_geo/engine.rb +58 -0
  135. data/lib/decidim/decidim_geo/load_shp/app_load_shp.rb +85 -0
  136. data/lib/decidim/decidim_geo/space_location/assembly_create_command_override.rb +26 -0
  137. data/lib/decidim/decidim_geo/space_location/assembly_form_override.rb +33 -0
  138. data/lib/decidim/decidim_geo/space_location/assembly_update_command_override.rb +21 -0
  139. data/lib/decidim/decidim_geo/space_location/participatory_process_command_override.rb +21 -0
  140. data/lib/decidim/decidim_geo/space_location/participatory_process_form_override.rb +33 -0
  141. data/lib/decidim/decidim_geo/space_location/space_override.rb +15 -0
  142. data/lib/decidim/decidim_geo/test/factories.rb +13 -0
  143. data/lib/decidim/decidim_geo/version.rb +14 -0
  144. data/lib/decidim/decidim_geo.rb +25 -0
  145. data/lib/tasks/decidim_geo_webpacker_tasks.rake +61 -0
  146. metadata +335 -0
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This validator takes care of ensuring the validated content is
4
+ # an existing address and computes its coordinates.
5
+ class GeocodingValidator < ActiveModel::EachValidator
6
+ def validate_each(record, attribute, value)
7
+
8
+ component = record.respond_to?(:component) ? record.component : record
9
+
10
+ if Decidim::Map.available?(:geocoding)
11
+ geocoder = geocoder_for(component.organization)
12
+ coordinates = geocoder.coordinates(value)
13
+
14
+ if coordinates.present?
15
+ record.latitude = coordinates.first
16
+ record.longitude = coordinates.last
17
+ else
18
+ record.errors.add(attribute, :invalid)
19
+ end
20
+ else
21
+ record.errors.add(attribute, :invalid)
22
+ end
23
+ end
24
+
25
+ private
26
+
27
+ def geocoder_for(organization)
28
+ Decidim::Map.geocoding(organization: organization)
29
+ end
30
+ end
@@ -0,0 +1,10 @@
1
+
2
+ <div class="row column">
3
+ <%= form.translated :text_field, :name %>
4
+ </div>
5
+ <div class="row column">
6
+ <%= form.translated :text_field, :plural %>
7
+ </div>
8
+ <div class="row column">
9
+ <%= form.collection_select :shapefile, Decidim::Geo::Shapefile.all, :id, :title, :include_blank => true %>
10
+ </div>
@@ -0,0 +1,46 @@
1
+ <div class="card" id="scope-types">
2
+ <div class="card-divider">
3
+ <% if allowed_to? :creste, :scope_type %>
4
+ <h2 class="card-title"><%= t "decidim.admin.titles.scope_types" %> <%= link_to t("actions.add", scope: "decidim.admin"), [:new, :scope_type], class: "button tiny button--title new" %></h2>
5
+ <% end %>
6
+ </div>
7
+ <div class="card-section">
8
+ <div class="table-scroll">
9
+ <table class="table-list">
10
+ <thead>
11
+ <tr>
12
+ <th><%= t("models.scope_type.fields.name", scope: "decidim.admin") %></th>
13
+ <th><%= t("models.scope_type.fields.plural", scope: "decidim.admin") %></th>
14
+ <th><%= "Shapefile Name" %></th>
15
+ <th></th>
16
+ </tr>
17
+ </thead>
18
+ <tbody>
19
+ <% scope_types.each do |scope_type| %>
20
+ <tr>
21
+ <td>
22
+ <%= translated_attribute(scope_type.name) %>
23
+ </td>
24
+ <td>
25
+ <%= translated_attribute(scope_type.plural) %>
26
+ </td>
27
+ <td>
28
+ <%= scope_type.shapefile.title unless scope_type.shapefile.nil? %>
29
+ </td>
30
+ <td class="table-list__actions">
31
+
32
+ <% if allowed_to? :update, :scope_type, scope_type: scope_type %>
33
+ <%= icon_link_to "pencil", [:edit, scope_type], t("actions.edit", scope: "decidim.admin"), class: "action-icon--edit", method: :get, data: {} %>
34
+ <% end %>
35
+
36
+ <% if allowed_to? :destroy, :scope_type, scope_type: scope_type %>
37
+ <%= icon_link_to "circle-x", scope_type, t("actions.destroy", scope: "decidim.admin"), class: "action-icon--remove", method: :delete, data: { confirm: t("actions.confirm_destroy", scope: "decidim.admin") } %>
38
+ <% end %>
39
+ </td>
40
+ </tr>
41
+ <% end %>
42
+ </tbody>
43
+ </table>
44
+ </div>
45
+ </div>
46
+ </div>
@@ -0,0 +1,20 @@
1
+
2
+ <div class="row column">
3
+ <%= form.translated :text_field, :name %>
4
+ </div>
5
+
6
+ <div class="row">
7
+ <div class="columns xlarge-6">
8
+ <%= form.text_field :code %>
9
+ </div>
10
+ <div class="columns xlarge-6">
11
+ <%= form.collection_select :scope_type_id, organization_scope_types, :id, :name %>
12
+ </div>
13
+ <% if scope && scope.scope_type %>
14
+ <% unless shapedata_scope(scope).nil? %>
15
+ <div class="columns xlarge-6">
16
+ <%= form.collection_select :shapedata, shapedata_scope(scope), :id, :name, :include_blank => true %>
17
+ </div>
18
+ <% end %>
19
+ <% end %>
20
+ </div>
@@ -0,0 +1,55 @@
1
+ <div class="card">
2
+ <div class="card-divider">
3
+ <h2 class="card-title">
4
+ <% if parent_scope %>
5
+ <%= scope_breadcrumbs(parent_scope).join(" - ").html_safe %> <%= link_to t("actions.add", scope: "decidim.admin"), new_scope_scope_path(parent_scope), class: "button tiny button--title" if allowed_to? :create, :scope %><%= link_to t("actions.edit", scope: "decidim.admin"), edit_scope_path(parent_scope), class: "button tiny button--title" if allowed_to? :edit, :scope, scope: parent_scope %>
6
+ <% else %>
7
+ <%= t "decidim.admin.titles.scopes" %> <%= link_to t("actions.add", scope: "decidim.admin"), new_scope_path, class: "button tiny button--title" if allowed_to? :create, :scope %>
8
+ <% end %>
9
+ </h2>
10
+ </div>
11
+ <div class="card-section">
12
+ <% if @scopes.any? %>
13
+ <div class="table-scroll">
14
+ <table class="table-list">
15
+ <thead>
16
+ <tr>
17
+ <th><%= t("models.scope.fields.name", scope: "decidim.admin") %></th>
18
+ <th><%= t("models.scope.fields.scope_type", scope: "decidim.admin") %></th>
19
+ <th><%= "Shapedata" %></th>
20
+ <th></th>
21
+ </tr>
22
+ </thead>
23
+ <tbody>
24
+ <% @scopes.each do |scope| %>
25
+ <tr>
26
+ <td>
27
+ <%= link_to translated_attribute(scope.name), scope_scopes_path(scope) %>
28
+ </td>
29
+ <td>
30
+ <%= scope.scope_type ? translated_attribute(scope.scope_type.name) : "-" %>
31
+ </td>
32
+ <td>
33
+ <%= shapedata_name(scope) unless scope.shapedata.nil? %>
34
+ </td>
35
+ <td class="table-list__actions">
36
+ <%= icon_link_to "zoom-in", scope_scopes_path(scope), t("actions.browse", scope: "decidim.admin"), class: "action-icon--browse", method: :get, data: {} %>
37
+
38
+ <% if allowed_to? :update, :scope, scope: scope %>
39
+ <%= icon_link_to "pencil", [:edit, scope], t("actions.edit", scope: "decidim.admin"), class: "action-icon--edit", method: :get, data: {} %>
40
+ <% end %>
41
+
42
+ <% if allowed_to? :destroy, :scope, scope: scope %>
43
+ <%= icon_link_to "circle-x", scope, t("actions.destroy", scope: "decidim.admin"), class: "action-icon--remove", method: :delete, data: { confirm: t("actions.confirm_destroy", scope: "decidim.admin") } %>
44
+ <% end %>
45
+ </td>
46
+ </tr>
47
+ <% end %>
48
+ </tbody>
49
+ </table>
50
+ </div>
51
+ <% else %>
52
+ <p><%= t("decidim.admin.scopes.no_scopes") %></p>
53
+ <% end %>
54
+ </div>
55
+ </div>
@@ -0,0 +1,47 @@
1
+ <div class="card with-overflow" id="shapefiles">
2
+ <div class="card-divider">
3
+ <h2 class="card-title">
4
+ <%= t("map_config_title", scope: "decidim.geo.admin.geo_configs") %>
5
+ </h2>
6
+ </div>
7
+ <div class="card-section">
8
+ <div class="row">
9
+ <div class="columns xlarge-6">
10
+ <%= form.number_field :latitude %>
11
+ </div>
12
+ </div>
13
+ <div class="row">
14
+ <div class="columns xlarge-6">
15
+ <%= form.number_field :longitude %>
16
+ </div>
17
+ </div>
18
+ <div class="row">
19
+ <div class="columns xlarge-6">
20
+ <%= form.number_field :zoom %>
21
+ </div>
22
+ </div>
23
+ <div class="row">
24
+ <div class="columns xlarge-6">
25
+ <%= form.text_field :tile %>
26
+ </div>
27
+ </div>
28
+ </div>
29
+
30
+ <div class="card-divider">
31
+ <h2 class="card-title">
32
+ <%= t("spaces_config_title", scope: "decidim.geo.admin.geo_configs") %>
33
+ </h2>
34
+ </div>
35
+ <div class="card-section">
36
+ <div class="row">
37
+ <div class="columns xlarge-6">
38
+ <%= form.check_box :only_processes, label: t("only_processes", scope: "decidim.geo.admin.geo_configs") %>
39
+ </div>
40
+ </div>
41
+ <div class="row">
42
+ <div class="columns xlarge-6">
43
+ <%= form.check_box :only_assemblies, label: t("only_assemblies", scope: "decidim.geo.admin.geo_configs") %>
44
+ </div>
45
+ </div>
46
+ </div>
47
+ </div>
@@ -0,0 +1,8 @@
1
+
2
+ <%= decidim_form_for(@form, html: { class: "form geo_config_form_admin" }) do |form| %>
3
+ <%= render partial: "form", locals: { form: form, title: t(".title") } %>
4
+ <div class="button--double form-general-submit">
5
+ <%= form.submit t(".save") %>
6
+ </div>
7
+ <% end %>
8
+
@@ -0,0 +1,29 @@
1
+ <div class="card">
2
+ <div class="card-divider">
3
+ <h2 class="card-title"><%= title %></h2>
4
+ </div>
5
+ <div class="card-section">
6
+ <div class="row column">
7
+ <fieldset>
8
+ <div class="row column">
9
+ <%= form.text_field :title %>
10
+ </div>
11
+
12
+ <div class="row column">
13
+ <%= form.text_area :description %>
14
+ </div>
15
+
16
+ <div class="row column">
17
+ <div class="row column">
18
+ <%= label_tag(:shapefile) %>
19
+ </div>
20
+ <legend style="color: #202734; margin-top: -8px; font-size: 13px"><strong><%= t(".attachment_max_size") %></strong></legend>
21
+ <%= form.file_field :shapefile, optional: false, label: false %>
22
+ <legend class="help-text"><%= t(".support_shape_overlaping") %></legend>
23
+ <legend class="help-text"><%= t(".attachment_legend") %></legend>
24
+ <legend class="help-text"><%= t(".attachment_format") %></legend>
25
+ </div>
26
+ </fieldset>
27
+ </div>
28
+ </div>
29
+ </div>
@@ -0,0 +1,38 @@
1
+ <div class="card with-overflow" id="shapefiles">
2
+ <div class="card-divider">
3
+ <h2 class="card-title">
4
+ <%= t("title", scope: "decidim.geo.admin.shapefiles") %>
5
+ <%= link_to t("actions.new_shapefile", scope: "decidim.geo.admin.shapefiles"),
6
+ new_shapefile_path,
7
+ class: "button tiny button--title" %>
8
+ </h2>
9
+ </div>
10
+
11
+ <div class="card-section">
12
+ <div class="table-scroll">
13
+ <table class="table-list">
14
+ <thead>
15
+ <tr>
16
+ <th><%= I18n.t("fields.title", scope: "decidim.geo.admin.shapefiles") %></th>
17
+ <th><%= I18n.t("fields.description", scope: "decidim.geo.admin.shapefiles") %></th>
18
+ <th><%= I18n.t("fields.file_name", scope: "decidim.geo.admin.shapefiles") %></th>
19
+ <th><%= I18n.t("fields.created_at", scope: "decidim.geo.admin.shapefiles") %></th>
20
+ <th><%= I18n.t("fields.actions", scope: "decidim.geo.admin.shapefiles") %></th>
21
+ <th><span class="action-space icon"></span></th>
22
+ </tr>
23
+ </thead>
24
+ <tbody>
25
+ <% @shapefiles.each do |shapefile| %>
26
+ <tr>
27
+ <td><%= shapefile.title %><br></td>
28
+ <td><%= shapefile.description %><br></td>
29
+ <td><%= shapefile.shapefile.filename %><br></td>
30
+ <td><%= shapefile.created_at %><br></td>
31
+ <td><span class="action-space icon"></span></td>
32
+ </tr>
33
+ <% end %>
34
+ </tbody>
35
+ </table>
36
+ </div>
37
+ </div>
38
+ </div>
@@ -0,0 +1,8 @@
1
+ <%= decidim_form_for(@form, html: { class: "form new_shapefile shapefile_form_admin" }) do |form| %>
2
+ <%= render partial: "form", locals: { form: form, title: t(".title") } %>
3
+
4
+ <div class="button--double form-general-submit">
5
+ <%= form.submit t(".create") %>
6
+ </div>
7
+ <% end %>
8
+
@@ -0,0 +1,19 @@
1
+ <% def icon_aria_selected_link_to(text, link, icon_name, options = {})
2
+ aria_selected_link_to(safe_join([icon(icon_name), text]), link, options)
3
+ end %>
4
+
5
+ <% content_for :secondary_nav do %>
6
+ <div class="secondary-nav">
7
+ <%= sidebar_menu(:admin_geo_menu).render %>
8
+ </div>
9
+ <% end %>
10
+
11
+ <%= render "layouts/decidim/admin/application" do %>
12
+ <div class="process-title">
13
+ <div class="process-title-content">
14
+ Decidim GEO
15
+ </div>
16
+ </div>
17
+
18
+ <%= yield %>
19
+ <% end %>
data/config/assets.rb ADDED
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ base_path = File.expand_path("..", __dir__)
4
+
5
+ Decidim::Webpacker.register_path("#{base_path}/app/packs")
6
+ Decidim::Webpacker.register_entrypoints(
7
+ decidim_geo: "#{base_path}/app/packs/entrypoints/decidim_geo.js"
8
+ )
9
+ Decidim::Webpacker.register_stylesheet_import("stylesheets/decidim/geo/geo")
@@ -0,0 +1,10 @@
1
+ ---
2
+
3
+ base_locale: en
4
+ locales: [en]
5
+
6
+ ignore_unused:
7
+ - "decidim.components.geo.name"
8
+
9
+ ignore_missing:
10
+ - decidim.participatory_processes.scopes.global
@@ -0,0 +1,102 @@
1
+ ---
2
+ de:
3
+ decidim:
4
+ assemblies:
5
+ admin:
6
+ assemblies:
7
+ form:
8
+ address: Adresse
9
+ address_help: Wenn die Versammlung eine physische Adresse hat, füllen Sie dieses Feld mit ihrer Adresse aus.
10
+ show:
11
+ address: Adresse
12
+ participatory_processes:
13
+ admin:
14
+ participatory_processes:
15
+ form:
16
+ geocoding: Adresse
17
+ address_help: Wenn der Prozess eine physische Adresse hat, füllen Sie dieses Feld mit seiner Adresse aus.
18
+ show:
19
+ address: Adresse
20
+ geo:
21
+ admin:
22
+ geo_configs:
23
+ map_config_title: Kartenkonfigurationen
24
+ spaces_config_title: Konfigurationen für partizipative Räume
25
+ only_assemblies: Zeige nur Versammlungen in den Versammlungen
26
+ only_processes: Zeige nur Prozesse in den Prozessen
27
+ index:
28
+ title: Konfigurationen
29
+ save: Speichern
30
+ edit:
31
+ title: Konfigurationen
32
+ save: Speichern
33
+ fields:
34
+ zoom: Zoom
35
+ longitude: Längengrad
36
+ latitude: Breitengrad
37
+ tile: Tile
38
+ actions:
39
+ update:
40
+ success: Konfigurationen aktualisiert
41
+ shapefiles:
42
+ title: Shapefiles
43
+ new:
44
+ title: Shapefile hochladen
45
+ create: Erstellen
46
+ actions:
47
+ new_shapefile: Neues Shapefile
48
+ new:
49
+ attachment_legend: Legen Sie Ihre Zip-Datei hier ab
50
+ create:
51
+ success: Datei hochgeladen
52
+ invalid: Datei-Upload fehlgeschlagen
53
+ fields:
54
+ title: Name
55
+ url: URL
56
+ file_name: Dateiname
57
+ created_at: Erstellt am
58
+ description: Beschreibung
59
+ actions: Aktionen
60
+ form:
61
+ attachment_legend: Laden Sie Shapefile komprimiert als Zip-Datei hoch
62
+ attachment_format: Shapefile muss im WGS84-Datum sein
63
+ attachment_max_size: Maximale Größe - 10 MB
64
+ support_shape_overlaping: Überlappende Formen werden derzeit nicht unterstützt
65
+ content_blocks:
66
+ name: Geo-Karten
67
+ fields:
68
+ zoom: Zoom
69
+ lng: Längengrad
70
+ lat: Breitengrad
71
+ scopes:
72
+ dropdown: "Bereiche"
73
+ all: "Alle Bereiche"
74
+ filters:
75
+ back: "Zurück"
76
+ button: "Filter"
77
+ geo:
78
+ label: Zeigen
79
+ all: Alle
80
+ only_geoencoded: "Nur kartierte Aktivität"
81
+ only_virtual: "Nur andere Aktivität"
82
+ time:
83
+ label: "Filtern nach Zeit"
84
+ all: "Alle"
85
+ only_past: "Vergangen"
86
+ only_active: "Aktiv"
87
+ only_future: "Zukunft"
88
+ type:
89
+ label: "Filtern nach Typ"
90
+ all: "Alle"
91
+ only_processes: "Prozesse"
92
+ only_assemblies: "Versammlungen"
93
+ only_proposals: "Vorschläge"
94
+ only_meetings: "Treffen"
95
+ components:
96
+ geo:
97
+ name: Geo
98
+ settings:
99
+ global:
100
+ announcement: Ankündigung
101
+ step:
102
+ announcement: Ankündigung
@@ -0,0 +1,108 @@
1
+ ---
2
+ en:
3
+ activemodel:
4
+ attributes:
5
+ assembly:
6
+ decidim_geo_space_address: Address
7
+ decidim:
8
+ assemblies:
9
+ admin:
10
+ assemblies:
11
+ form:
12
+ decidim_geo_space_address: Fisical Address
13
+ decidim_geo_space_address_help: If the Assembly has a fisical address, fill this field with its address.
14
+ show:
15
+ decidim_geo_space_location: Address
16
+ participatory_processes:
17
+ admin:
18
+ participatory_processes:
19
+ form:
20
+ decidim_geo_space_address: Fisical Address
21
+ decidim_geo_space_address_help: If the Process has a fisical address, fill this field with its address.
22
+ show:
23
+ decidim_geo_space_address: Address
24
+ geo:
25
+ admin:
26
+ geo_configs:
27
+ map_config_title: Map Configurations
28
+ spaces_config_title: Participatory Spaces Configurations
29
+ only_assemblies: Display only assemblies in Assemblies
30
+ only_processes: Display only processes in Processes
31
+ index:
32
+ title: Configurations
33
+ save: Save
34
+ edit:
35
+ title: Configurations
36
+ save: Save
37
+ fields:
38
+ zoom: Zoom
39
+ longitude: Longitude
40
+ latitude: Latitude
41
+ tile: Tile
42
+ actions:
43
+ update:
44
+ success: Configurations Updated
45
+ shapefiles:
46
+ title: Shapefiles
47
+ new:
48
+ title: Upload Shapefile
49
+ create: Create
50
+ actions:
51
+ new_shapefile: New Shapefile
52
+ new:
53
+ attachment_legend: Put your zip file here
54
+ create:
55
+ success: File uploaded
56
+ invalid: File upload failed
57
+ fields:
58
+ title: Name
59
+ url: URL
60
+ file_name: Filename
61
+ created_at: Created at
62
+ description: Description
63
+ actions: Actions
64
+ form:
65
+ attachment_legend: Upload shapefile compacted as a zip file
66
+ attachment_format: Shapefile has to be in WGS84 Datum
67
+ attachment_max_size: Max size - 10 MB
68
+ support_shape_overlaping: Overlapping shapes are not currently supported
69
+ content_blocks:
70
+ name: Geo Maps
71
+ fields:
72
+ zoom: Zoom
73
+ lng: Longitude
74
+ lat: Latitude
75
+ scopes:
76
+ dropdown: "Scopes"
77
+ all: "All Scopes"
78
+ filters:
79
+ back: "Back"
80
+ button: "Filters"
81
+ geo:
82
+ label: Show
83
+ all: All
84
+ only_geoencoded: "Mapped activity only"
85
+ only_virtual: "Other activity only"
86
+ time:
87
+ label: "Filter By Time"
88
+ all: "All"
89
+ only_past: "Past"
90
+ only_active: "Active"
91
+ only_future: "Future"
92
+ type:
93
+ label: "Filter By Type"
94
+ all: "All"
95
+ only_processes: "Processes"
96
+ only_assemblies: "Assemblies"
97
+ only_proposals: "Proposals"
98
+ only_meetings: "Meetings"
99
+ components:
100
+ geo:
101
+ name: Geo
102
+ settings:
103
+ global:
104
+ announcement: Announcement
105
+ step:
106
+ announcement: Announcement
107
+
108
+
@@ -0,0 +1,102 @@
1
+ ---
2
+ fr:
3
+ decidim:
4
+ assemblies:
5
+ admin:
6
+ assemblies:
7
+ form:
8
+ address: Adresse
9
+ address_help: Si l'Assemblée a une adresse physique, remplissez ce champ avec son adresse.
10
+ show:
11
+ address: Adresse
12
+ participatory_processes:
13
+ admin:
14
+ participatory_processes:
15
+ form:
16
+ geocoding: Adresse
17
+ address_help: Si le Processus a une adresse physique, remplissez ce champ avec son adresse.
18
+ show:
19
+ address: Adresse
20
+ geo:
21
+ admin:
22
+ geo_configs:
23
+ map_config_title: Configurations de la Carte
24
+ spaces_config_title: Configurations des Espaces Participatifs
25
+ only_assemblies: Afficher uniquement les assemblées dans Assemblées
26
+ only_processes: Afficher uniquement les processus dans Processus
27
+ index:
28
+ title: Configurations
29
+ save: Sauvegarder
30
+ edit:
31
+ title: Configurations
32
+ save: Sauvegarder
33
+ fields:
34
+ zoom: Zoom
35
+ longitude: Longitude
36
+ latitude: Latitude
37
+ tile: Tuile
38
+ actions:
39
+ update:
40
+ success: Configurations Mises à Jour
41
+ shapefiles:
42
+ title: Fichiers de forme
43
+ new:
44
+ title: Télécharger un Shapefile
45
+ create: Créer
46
+ actions:
47
+ new_shapefile: Nouveau Shapefile
48
+ new:
49
+ attachment_legend: Déposez votre fichier zip ici
50
+ create:
51
+ success: Fichier téléchargé
52
+ invalid: Échec du téléchargement du fichier
53
+ fields:
54
+ title: Nom
55
+ url: URL
56
+ file_name: Nom du fichier
57
+ created_at: Créé le
58
+ description: Description
59
+ actions: Actions
60
+ form:
61
+ attachment_legend: Téléchargez le shapefile compacté en tant que fichier zip
62
+ attachment_format: Le Shapefile doit être au format WGS84 Datum
63
+ attachment_max_size: Taille max - 10 Mo
64
+ support_shape_overlaping: Les formes superposées ne sont actuellement pas prises en charge
65
+ content_blocks:
66
+ name: Cartes Géo
67
+ fields:
68
+ zoom: Zoom
69
+ lng: Longitude
70
+ lat: Latitude
71
+ scopes:
72
+ dropdown: "Régions"
73
+ all: "Toutes les régions"
74
+ filters:
75
+ back: "Retour"
76
+ button: "Filtres"
77
+ geo:
78
+ label: Montrer
79
+ all: Tout
80
+ only_geoencoded: "Activité mappée uniquement"
81
+ only_virtual: "Autre activité uniquement"
82
+ time:
83
+ label: "Filtrer par Temps"
84
+ all: "Tout"
85
+ only_past: "Passé"
86
+ only_active: "Actif"
87
+ only_future: "Futur"
88
+ type:
89
+ label: "Filtrer par Type"
90
+ all: "Tout"
91
+ only_processes: "Processus"
92
+ only_assemblies: "Assemblées"
93
+ only_proposals: "Propositions"
94
+ only_meetings: "Réunions"
95
+ components:
96
+ geo:
97
+ name: Géo
98
+ settings:
99
+ global:
100
+ announcement: Annonce
101
+ step:
102
+ announcement: Annonce
@@ -0,0 +1,5 @@
1
+ class AddPostgisExtensionToDatabase < ActiveRecord::Migration[6.0]
2
+ def change
3
+ enable_extension 'postgis'
4
+ end
5
+ end