diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/images/icon-menu-off.svg | 36 | ||||
-rw-r--r-- | app/assets/images/icon-menu-on.svg | 36 | ||||
-rw-r--r-- | app/assets/stylesheets/application/_body.scss | 7 | ||||
-rw-r--r-- | app/assets/stylesheets/application/_map.scss | 2 | ||||
-rw-r--r-- | app/assets/stylesheets/application/_user_info.scss | 2 | ||||
-rw-r--r-- | app/assets/stylesheets/welcome.scss | 34 | ||||
-rw-r--r-- | app/controllers/welcome_controller.rb | 1 | ||||
-rw-r--r-- | app/helpers/agents_helper.rb | 7 | ||||
-rw-r--r-- | app/helpers/application_helper.rb | 14 | ||||
-rw-r--r-- | app/javascript/controllers/index.js | 9 | ||||
-rw-r--r-- | app/javascript/packs/application.js | 2 | ||||
-rw-r--r-- | app/jobs/agency_watcher_job.rb | 2 | ||||
-rw-r--r-- | app/models/map.rb | 4 | ||||
-rw-r--r-- | app/views/application/_user_info.html.erb | 4 | ||||
-rw-r--r-- | app/views/layouts/application.html.erb | 6 | ||||
-rw-r--r-- | app/views/resources/_resource.html.erb | 1 | ||||
-rw-r--r-- | app/views/welcome/index.html.erb | 32 |
17 files changed, 162 insertions, 37 deletions
diff --git a/app/assets/images/icon-menu-off.svg b/app/assets/images/icon-menu-off.svg new file mode 100644 index 0000000..850e76a --- /dev/null +++ b/app/assets/images/icon-menu-off.svg @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + id="svg4344" + width="36.25" + height="36.25" + version="1.1"> + <metadata + id="metadata4350"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <defs + id="defs4348" /> + <path + id="path4342" + d="m 19.48433,21.2344 q 0.64062,-1.4844 0.64062,-3.1094 0,-1.625 -0.64062,-3.0937 -0.625,-1.4844 -1.7031,-2.5625 -1.07814,-1.0781 -2.56249,-1.7031 -1.46873,-0.6407 -3.09371,-0.6407 -1.62497,0 -3.10939,0.6407 Q 7.5469,11.3907 6.46877,12.4688 5.39063,13.5469 4.75,15.0313 4.125,16.5 4.125,18.125 q 0,1.625 0.625,3.1094 0.64062,1.4687 1.71877,2.5469 1.07813,1.078 2.54687,1.7187 1.48435,0.625 3.10939,0.625 1.62498,0 3.09371,-0.625 1.48435,-0.6407 2.56249,-1.7187 1.07814,-1.0782 1.7031,-2.5469 z m 12.00006,0 q 0.64063,-1.4844 0.64063,-3.1094 0,-1.625 -0.64063,-3.0937 -0.625,-1.4844 -1.70309,-2.5625 -1.07813,-1.0781 -2.56248,-1.7031 -1.46874,-0.6407 -3.09371,-0.6407 h -6.03126 q 1.85933,1.4063 2.93747,3.5 1.09375,2.0938 1.09375,4.5 0,2.4063 -1.09375,4.5 -1.07814,2.0937 -2.93747,3.5 h 6.03126 q 1.62497,0 3.09371,-0.625 1.48435,-0.6407 2.56248,-1.7187 1.07814,-1.0782 1.70309,-2.5469 z M 33.32812,14.25 q 0.79688,1.8438 0.79688,3.875 0,2.0313 -0.79688,3.8906 -0.79687,1.8438 -2.14059,3.1875 -1.32811,1.3281 -3.18751,2.125 -1.84373,0.7969 -3.87498,0.7969 H 12.12496 q -2.03126,0 -3.89059,-0.7969 Q 6.39065,26.5312 5.04686,25.2031 3.71875,23.8594 2.92187,22.0156 2.125,20.1563 2.125,18.125 2.125,16.0938 2.92187,14.25 3.71875,12.3906 5.04686,11.0625 6.39058,9.7188 8.23437,8.9219 10.0937,8.125 12.12496,8.125 h 12.00008 q 2.03125,0 3.87498,0.7969 1.85933,0.7969 3.18751,2.1406 1.34372,1.3281 2.14059,3.1875 z" + style="fill:#008080" /> + <circle + r="8.0150003" + cy="18.133831" + cx="12.125704" + id="path4895" + style="opacity:1;fill:#edeec9;fill-opacity:1;stroke:none;stroke-width:18.63586235;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:fill markers stroke" /> +</svg> diff --git a/app/assets/images/icon-menu-on.svg b/app/assets/images/icon-menu-on.svg new file mode 100644 index 0000000..fa455f0 --- /dev/null +++ b/app/assets/images/icon-menu-on.svg @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + id="svg3443" + width="36.25" + height="36.25" + version="1.1"> + <metadata + id="metadata3449"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <defs + id="defs3447" /> + <path + id="path3441" + d="m 2.9188574,22.01679 q -0.7938571,-1.863674 -0.7938571,-3.89368 0,-2.030006 0.7938571,-3.874779 Q 3.7202749,12.388438 5.0471501,11.061562 6.3929268,9.7157853 8.2339194,8.9181483 10.093813,8.1242913 12.1276,8.1242913 h 11.998582 q 2.030006,0 3.874778,0.793857 1.859894,0.797637 3.186769,2.1434137 1.345777,1.326876 2.143415,3.186769 0.793856,1.844773 0.793856,3.874779 0,2.033785 -0.793856,3.89368 -0.797638,1.844772 -2.143415,3.186769 -1.323095,1.326875 -3.186769,2.124512 -1.844772,0.797638 -3.874778,0.797638 H 12.1276 q -2.033787,0 -3.8936806,-0.793858 Q 6.3929268,26.530434 5.0471501,25.203559 3.7202749,23.861562 2.9226376,22.01679 Z M 21.018799,25.5022 q 1.485646,0.623745 3.111163,0.623745 1.625517,0 3.092262,-0.623745 1.485647,-0.642646 2.563025,-1.720024 1.081157,-1.077377 1.701122,-2.547903 0.642646,-1.485646 0.642646,-3.111163 0,-1.625517 -0.642646,-3.092262 -0.619965,-1.485647 -1.701122,-2.563025 -1.077378,-1.077377 -2.563025,-1.701122 -1.466745,-0.642646 -3.092262,-0.642646 -1.625517,0 -3.111163,0.642646 -1.470526,0.623745 -2.547904,1.701122 -1.077377,1.077378 -1.720023,2.563025 -0.623745,1.466745 -0.623745,3.092262 0,1.625517 0.623745,3.111163 0.642646,1.470526 1.720023,2.547903 1.077378,1.077378 2.547904,1.720024 z" + style="fill:#008080;fill-opacity:1" /> + <circle + r="8.0150003" + cy="18.132078" + cx="24.122789" + id="path4895" + style="opacity:1;fill:#edeec9;fill-opacity:1;stroke:none;stroke-width:18.63586235;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:fill markers stroke" /> +</svg> diff --git a/app/assets/stylesheets/application/_body.scss b/app/assets/stylesheets/application/_body.scss index a282ba3..06db39a 100644 --- a/app/assets/stylesheets/application/_body.scss +++ b/app/assets/stylesheets/application/_body.scss @@ -61,6 +61,11 @@ main { } } +body>aside { + position: fixed; + z-index: 1001; +} + :root { --font-family: Helvetica, Arial, sans-serif; @@ -150,4 +155,6 @@ main { --gold: #e7c300; --silver: silver; --bronze: #cd7f32; + --icon-menu-off: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkv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Q2Njc0NSwtMC42NDI2NDYgLTMuMDkyMjYyLC0wLjY0MjY0NiAtMS42MjU1MTcsMCAtMy4xMTExNjMsMC42NDI2NDYgLTEuNDcwNTI2LDAuNjIzNzQ1IC0yLjU0NzkwNCwxLjcwMTEyMiAtMS4wNzczNzcsMS4wNzczNzggLTEuNzIwMDIzLDIuNTYzMDI1IC0wLjYyMzc0NSwxLjQ2Njc0NSAtMC42MjM3NDUsMy4wOTIyNjIgMCwxLjYyNTUxNyAwLjYyMzc0NSwzLjExMTE2MyAwLjY0MjY0NiwxLjQ3MDUyNiAxLjcyMDAyMywyLjU0NzkwMyAxLjA3NzM3OCwxLjA3NzM3OCAyLjU0NzkwNCwxLjcyMDAyNCB6IgogICAgIHN0eWxlPSJmaWxsOiMwMDgwODA7ZmlsbC1vcGFjaXR5OjEiIC8+CiAgPGNpcmNsZQogICAgIHI9IjguMDE1MDAwMyIKICAgICBjeT0iMTguMTMyMDc4IgogICAgIGN4PSIyNC4xMjI3ODkiCiAgICAgaWQ9InBhdGg0ODk1IgogICAgIHN0eWxlPSJvcGFjaXR5OjE7ZmlsbDojZWRlZWM5O2ZpbGwtb3BhY2l0eToxO3N0cm9rZTpub25lO3N0cm9rZS13aWR0aDoxOC42MzU4NjIzNTtzdHJva2UtbGluZWNhcDpyb3VuZDtzdHJva2UtbGluZWpvaW46cm91bmQ7c3Ryb2tlLW1pdGVybGltaXQ6NDtzdHJva2UtZGFzaGFycmF5Om5vbmU7c3Ryb2tlLWRhc2hvZmZzZXQ6MDtzdHJva2Utb3BhY2l0eToxO3BhaW50LW9yZGVyOmZpbGwgbWFya2VycyBzdHJva2UiIC8+Cjwvc3ZnPgo='); } diff --git a/app/assets/stylesheets/application/_map.scss b/app/assets/stylesheets/application/_map.scss index ba86dd4..e474843 100644 --- a/app/assets/stylesheets/application/_map.scss +++ b/app/assets/stylesheets/application/_map.scss @@ -12,7 +12,7 @@ position: fixed; height: 100%; width: 100%; - top: 0; + top: 4rem; left: 0; right: 0; bottom: 0; diff --git a/app/assets/stylesheets/application/_user_info.scss b/app/assets/stylesheets/application/_user_info.scss index 2d80a09..765be0a 100644 --- a/app/assets/stylesheets/application/_user_info.scss +++ b/app/assets/stylesheets/application/_user_info.scss @@ -10,7 +10,7 @@ User Info #user_info { position: absolute; - right: 0; + right: 0.8rem; nav { top: 0; diff --git a/app/assets/stylesheets/welcome.scss b/app/assets/stylesheets/welcome.scss index 8175046..aae15d5 100644 --- a/app/assets/stylesheets/welcome.scss +++ b/app/assets/stylesheets/welcome.scss @@ -7,3 +7,37 @@ // Place all the styles related to the welcome controller here. // They will automatically be included in application.css. // You can use Sass (SCSS) here: https://sass-lang.com/ + +button[data-action="taxonomy#toggle"] { + position: absolute; + top: 9rem; + left: 0.7rem; + display: block; + cursor: pointer; + padding: 16px; + color: transparent; + z-index: 990; + background: transparent var(--icon-menu-off) top left/32px no-repeat; + border: none; + text-align: center; +} +button[data-action="taxonomy#toggle"].on { + background-image: var(--icon-menu-on); +} + +[data-controller="taxonomy"] nav { + display: block; + position: fixed; + top: 9rem; + bottom: 0; + max-width: 35rem; + background-color: rgba(0,128,128,0.5); + z-index: -1; + display: none; + border-top-right-radius: 1rem; +} +[data-controller="taxonomy"] nav.on { + width: 89vw; + z-index: 900; + display: block; +} diff --git a/app/controllers/welcome_controller.rb b/app/controllers/welcome_controller.rb index cafddd1..e7743e8 100644 --- a/app/controllers/welcome_controller.rb +++ b/app/controllers/welcome_controller.rb @@ -5,6 +5,7 @@ class WelcomeController < ApplicationController # GET / def index + @map = Map.first @resources = Resource.order(:uuid).page params[:page] Rails.logger.info "WECLOME ///// #{@resources&.count || 0}" end diff --git a/app/helpers/agents_helper.rb b/app/helpers/agents_helper.rb index 6b2ff82..bbaeeca 100644 --- a/app/helpers/agents_helper.rb +++ b/app/helpers/agents_helper.rb @@ -3,11 +3,4 @@ # SPDX-License-Identifier: AGPL-3.0-or-later module AgentsHelper - # Form to select an Agent - def agent_selector_form - form_for current_agent, url: '/my/current_agent', method: :patch do |f| - f.submit('select') - f.select(:id, options_for_select(current_user.agents.map { |a| [a.name, a.id] }), selected: current_agent.id) - end - end end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 4689613..15d5082 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -12,6 +12,20 @@ module ApplicationHelper end end + def map_container(map = Map.first) + raw tag.div( + tag.div(id: 'map', + data: { + target: 'map.container' + }), + data: { + controller: 'map', + 'map-latitude': map.latitude, + 'map-longitude': map.longitude, + 'map-zoom': map.zoom + }) + end + # Markdown helper # Always use all extensions. Additional parser and render options may be # passed as a second argument. diff --git a/app/javascript/controllers/index.js b/app/javascript/controllers/index.js new file mode 100644 index 0000000..6f53d84 --- /dev/null +++ b/app/javascript/controllers/index.js @@ -0,0 +1,9 @@ +// Load all the controllers within this directory and all subdirectories. +// Controller files must be named *_controller.js. + +import { Application } from "stimulus" +import { definitionsFromContext } from "stimulus/webpack-helpers" + +const application = Application.start() +const context = require.context("controllers", true, /_controller\.js$/) +application.load(definitionsFromContext(context)) diff --git a/app/javascript/packs/application.js b/app/javascript/packs/application.js index 5512f7f..5e3eec0 100644 --- a/app/javascript/packs/application.js +++ b/app/javascript/packs/application.js @@ -14,3 +14,5 @@ require("@rails/activestorage").start() // // const images = require.context('../images', true) // const imagePath = (name) => images(name, true) + +import "controllers" diff --git a/app/jobs/agency_watcher_job.rb b/app/jobs/agency_watcher_job.rb index 7a114d2..23266e8 100644 --- a/app/jobs/agency_watcher_job.rb +++ b/app/jobs/agency_watcher_job.rb @@ -33,6 +33,8 @@ class AgencyWatcherJob < ApplicationJob Rails.logger.debug("AgencyWatcher: grant leader to %s in %s" % [user.username, g]) # Grant leader r.grant(:leader) + # Grant maintainer + r.grant(:maintainer) elsif r.roles == 0 # No role: grant editor Rails.logger.debug("AgencyWatcher: grant editor to %s in %s" % [user.username, g]) diff --git a/app/models/map.rb b/app/models/map.rb new file mode 100644 index 0000000..10a55f6 --- /dev/null +++ b/app/models/map.rb @@ -0,0 +1,4 @@ +class Map < ApplicationRecord + include UUIDParameter + belongs_to :taxonomy +end diff --git a/app/views/application/_user_info.html.erb b/app/views/application/_user_info.html.erb index be3b6c5..048e6fb 100644 --- a/app/views/application/_user_info.html.erb +++ b/app/views/application/_user_info.html.erb @@ -3,10 +3,6 @@ <% if current_user.present? %> <a href="/my/dashboard"><%= image_tag current_user.avatar_url, alt: current_user.username %></a> <ul> - <%#= tag.li(link_to(new_agent_switch_url, method: :get, remote: true, title: "Changer d'Agent") do - "Agent: %s" % current_agent - end, id: 'current_agent_name') %> - <%= tag.li agent_selector_form %> <%= tag.li link_to("Ajouter un point", new_agent_resource_url(agent_id: current_agent)) %> <%= tag.li link_to("Terminer la session", logout_url) %> </ul> diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 02c8553..210ace8 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -1,7 +1,9 @@ <!DOCTYPE html> <html> - <head> - <title>Carte IN COMMON</title> + <head> + <meta charset="UTF-8"> + <title>Carte IN COMMON</title> + <meta name="viewport" content="initial-width: device-width initial-scale=1.0 viewport-fit=cover"> <%= csrf_meta_tags %> <%= csp_meta_tag %> diff --git a/app/views/resources/_resource.html.erb b/app/views/resources/_resource.html.erb index 2debec2..37c0d66 100644 --- a/app/views/resources/_resource.html.erb +++ b/app/views/resources/_resource.html.erb @@ -8,7 +8,6 @@ <%= m resource.description %> <hr> <code><pre><%= h JSON.pretty_generate(resource.feature.as_json) %></pre></code> - <p>... <%= session[:current_agent] %>...</p> <nav> <ul> <li><%= link_to('show', resource_url(resource)) %></li> diff --git a/app/views/welcome/index.html.erb b/app/views/welcome/index.html.erb index 1b6ab77..eac1eff 100644 --- a/app/views/welcome/index.html.erb +++ b/app/views/welcome/index.html.erb @@ -9,7 +9,17 @@ <h1>Bienvenue à l'atelier carto d'IN COMMON</h1> -<%= tag.div(id: 'map') %> +<%= map_container %> + +<% content_for :aside do %> + <div data-controller="taxonomy" data-taxonomy-id="2519915f-d19c-4281-b758-f5ddb889d7fa"> + <div class="leaflet-bar leaftlet-control" id="taxonomy-toggle"> + <button data-action="taxonomy#toggle"></button> + </div> + <nav data-target="taxonomy.filter"> + </nav> + </div> +<% end %> <% content_for :debug do %> <% if current_user.present? %> @@ -19,23 +29,3 @@ <p><%= res.feature["geometry"]["coordinates"] %></p> <% end %><%# ensure it does not break when we don't have a record... %> <% end %> - -<% content_for :body_end do %> -<script> - var mymap = L.map('map').setView([50.8503396, 4.3517103],13); - - L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}', { - attribution: 'Map data © <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery <a href="https://www.mapbox.com/">Mapbox</a>', - maxZoom: 18, - id: 'mapbox/streets-v11', - tileSize: 512, - zoomOffset: -1, - accessToken: 'pk.eyJ1IjoibmVtYWVsIiwiYSI6ImNrZzBrYjBudTB3bnMyenFmNWtrN3h3bmMifQ.Rkeyhm-9iIQOV7NAMA5LaA' - }).addTo(mymap); - var marker = L.marker([50.850, 4.351]).addTo(mymap); - //CONTINUER AVEC LES WHILE ET CONDITIONS, @resources ne contient que 25 elements (lié au nombre d'élément par page?) -- oui - //OU PLUTOT UTILISER POSTGRES POUR FAIRE DES REQUESTES SUR @resources - var count = 0 - console.log(count) -</script> -<% end %> |