aboutsummaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorhellekin <hellekin@cepheide.org>2020-11-12 23:39:13 +0100
committerhellekin <hellekin@cepheide.org>2020-11-12 23:39:13 +0100
commit6c9922a87fb72b958b78014c45b6cd1efafdd30e (patch)
treec58addb0b39bafe5bc8aceebe659bb2cc86f3851 /app/views
parent8d9387cf64929b6467b6ba52f22ca0aa5ed35782 (diff)
downloadincommon-map-6c9922a87fb72b958b78014c45b6cd1efafdd30e.tar.gz
Add Stimulus Map and Taxonomy (WIP)
This commit add StimulusJS interaction for the map and taxonomy, as well as styling. It provides preliminary work to hook up live data on the map from the taxonomy.
Diffstat (limited to 'app/views')
-rw-r--r--app/views/taxonomies/_taxonomy.html.erb8
-rw-r--r--app/views/taxonomies/filter/_taxonomy.html.erb1
-rw-r--r--app/views/taxonomies/filter/show.html.erb1
-rw-r--r--app/views/taxonomies/index.html.erb5
-rw-r--r--app/views/taxonomies/show.html.erb1
-rw-r--r--app/views/welcome/index.html.erb16
6 files changed, 19 insertions, 13 deletions
diff --git a/app/views/taxonomies/_taxonomy.html.erb b/app/views/taxonomies/_taxonomy.html.erb
new file mode 100644
index 0000000..eff6931
--- /dev/null
+++ b/app/views/taxonomies/_taxonomy.html.erb
@@ -0,0 +1,8 @@
+<section id="taxonomy-<%= taxonomy.to_param %>" data-controller="taxonomy" data-taxonomy-uuid="<%= taxonomy.uuid %>">
+ <h3><%= taxonomy.name %></h3>
+ <p class="summary"><%= h taxonomy.summary %></p>
+ <div class="description"><%= m taxonomy.description %></div>
+ <button data-action="taxonomy#deploy">Preview</button>
+ <div class="deploy" data-target="taxonomy.deploy"></div>
+</section>
+
diff --git a/app/views/taxonomies/filter/_taxonomy.html.erb b/app/views/taxonomies/filter/_taxonomy.html.erb
new file mode 100644
index 0000000..99e9c89
--- /dev/null
+++ b/app/views/taxonomies/filter/_taxonomy.html.erb
@@ -0,0 +1 @@
+<%= taxonomy_filter %>
diff --git a/app/views/taxonomies/filter/show.html.erb b/app/views/taxonomies/filter/show.html.erb
new file mode 100644
index 0000000..99e9c89
--- /dev/null
+++ b/app/views/taxonomies/filter/show.html.erb
@@ -0,0 +1 @@
+<%= taxonomy_filter %>
diff --git a/app/views/taxonomies/index.html.erb b/app/views/taxonomies/index.html.erb
new file mode 100644
index 0000000..d060f6c
--- /dev/null
+++ b/app/views/taxonomies/index.html.erb
@@ -0,0 +1,5 @@
+<section id="taxonomies">
+ <h2>Available Taxonomies</h2>
+
+ <%= render collection: @taxonomies: %>
+</section>
diff --git a/app/views/taxonomies/show.html.erb b/app/views/taxonomies/show.html.erb
new file mode 100644
index 0000000..99e9c89
--- /dev/null
+++ b/app/views/taxonomies/show.html.erb
@@ -0,0 +1 @@
+<%= taxonomy_filter %>
diff --git a/app/views/welcome/index.html.erb b/app/views/welcome/index.html.erb
index eac1eff..2a154ae 100644
--- a/app/views/welcome/index.html.erb
+++ b/app/views/welcome/index.html.erb
@@ -1,23 +1,13 @@
-<% content_for :head do %>
- <%= stylesheet_link_tag("https://unpkg.com/leaflet@1.7.1/dist/leaflet.css",
- integrity: "sha512-xodZBNTC5n17Xt2atTPuE1HxjVMSvLVW9ocqUKLsCC5CXdbqCmblAshOMAS6/keqq/sMZMZ19scR4PsZChSR7A==",
- crossorigin: '') %>
- <%= javascript_include_tag("https://unpkg.com/leaflet@1.7.1/dist/leaflet.js",
- integrity: "sha512-XQoYMqMTK8LvdxXYG3nZ448hOEQiglfqkJs1NOQV44cWnUrBc8PkAOcXy20w0vlaXaVUearIOBhiXZ5V3ynxwA==",
- crossorigin: '') %>
-<% end %>
-
<h1>Bienvenue à l'atelier carto d'IN COMMON</h1>
<%= map_container %>
<% content_for :aside do %>
- <div data-controller="taxonomy" data-taxonomy-id="2519915f-d19c-4281-b758-f5ddb889d7fa">
+ <div data-controller="taxonomy" data-taxonomy-uuid="<%= @taxonomy.to_param %>">
<div class="leaflet-bar leaftlet-control" id="taxonomy-toggle">
- <button data-action="taxonomy#toggle"></button>
+ <button data-action="taxonomy#toggle" data-target="taxonomy.toggle"></button>
</div>
- <nav data-target="taxonomy.filter">
- </nav>
+ <div data-target="taxonomy.filter"></div>
</div>
<% end %>