From 9a7d6fdcfa694f12c017fb66724008113c842c37 Mon Sep 17 00:00:00 2001 From: davidg73 <david.gunnarsson@univie.ac.at> Date: Mon, 19 May 2025 11:24:28 +0200 Subject: [PATCH] Add gazetteer description guideline to show locations on the map --- app/avo/resources/gazetteer.rb | 7 +++ .../avo/descriptions/_gazetteer.html.erb | 47 +++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 app/views/avo/descriptions/_gazetteer.html.erb diff --git a/app/avo/resources/gazetteer.rb b/app/avo/resources/gazetteer.rb index 991fa30..9fb3100 100644 --- a/app/avo/resources/gazetteer.rb +++ b/app/avo/resources/gazetteer.rb @@ -5,6 +5,13 @@ class Avo::Resources::Gazetteer < Avo::BaseResource query.order(name: :asc) } + def description + ApplicationController.render( + template: "avo/descriptions/_gazetteer", + layout: false + ).html_safe + end + # self.includes = [] # self.attachments = [] # self.search = { diff --git a/app/views/avo/descriptions/_gazetteer.html.erb b/app/views/avo/descriptions/_gazetteer.html.erb new file mode 100644 index 0000000..180bae0 --- /dev/null +++ b/app/views/avo/descriptions/_gazetteer.html.erb @@ -0,0 +1,47 @@ +<div class="flex gap-4"> + <div class="mb-4"> + <h6 class="font-bold mb-2">For a <i>production site</i> to appear on <a href="<%= facem_home_url %>/map?type=production" target="_blank">the map</a>:</h6> + <ul class="list-disc ml-4"> + <li class="mb-2"> + 1. Create a new location with at least: + <ul class="list-disc ml-4"> + <li>- a name</li> + <li>- latitude + longitude OR an ellipse</li> + </ul> + </li> + <li class="mb-2"> + 2. Create a fabric code with: + <ul class="list-disc ml-4"> + <li>- your new location as the production site</li> + <li>- a ware type</li> + <li>- a serial number</li> + </ul> + </li> + <li class="mb-2"> + 3. Add at least one sample with: + <ul class="list-disc ml-4"> + <li>- its fabric code set to the new fabric code</li> + </ul> + </li> + </ul> + </div> + + <div class="mb-4"> + <h6 class="font-bold mb-2">For a <i>discovery site</i> to appear on <a href="<%= facem_home_url %>/map?type=discovery" target="_blank">the map</a>:</h6> + <ul class="list-disc ml-4"> + <li class="mb-2"> + 1. Create a new location with at least: + <ul class="list-disc ml-4"> + <li>- a name</li> + <li>- latitude + longitude</li> + </ul> + </li> + <li class="mb-2"> + 2. Add at least one sample with: + <ul class="list-disc ml-4"> + <li>- its discovery site set to the new location</li> + </ul> + </li> + </ul> + </div> +</div> \ No newline at end of file -- GitLab