From c93b2631cbf80a1bfa0a589e2416a0c4e934c2e1 Mon Sep 17 00:00:00 2001
From: moanos
Date: Mon, 11 Aug 2025 22:16:26 +0200
Subject: [PATCH] feat: Add shortcut to open rescue org website
---
.../js/rescue-org-check-shortcuts.js | 10 +++++++++
.../partials/partial-check-rescue-org.html | 21 +++++++++++++------
2 files changed, 25 insertions(+), 6 deletions(-)
diff --git a/src/fellchensammlung/static/fellchensammlung/js/rescue-org-check-shortcuts.js b/src/fellchensammlung/static/fellchensammlung/js/rescue-org-check-shortcuts.js
index ab46256..d630ce3 100644
--- a/src/fellchensammlung/static/fellchensammlung/js/rescue-org-check-shortcuts.js
+++ b/src/fellchensammlung/static/fellchensammlung/js/rescue-org-check-shortcuts.js
@@ -2,4 +2,14 @@ function mark_checked(index) {
document.getElementById('mark_checked_'+index).submit();
}
+function open_information(index) {
+ let link = document.getElementById('species_url_'+index+'_1');
+ if (!link) {
+ link = document.getElementById('rescue_org_website_'+index);
+ }
+ window.open(link.href);
+}
+
Mousetrap.bind('c', function() { mark_checked(1); });
+
+Mousetrap.bind('o', function() { open_information(1); });
\ No newline at end of file
diff --git a/src/fellchensammlung/templates/fellchensammlung/partials/partial-check-rescue-org.html b/src/fellchensammlung/templates/fellchensammlung/partials/partial-check-rescue-org.html
index 3b25cc7..34910e8 100644
--- a/src/fellchensammlung/templates/fellchensammlung/partials/partial-check-rescue-org.html
+++ b/src/fellchensammlung/templates/fellchensammlung/partials/partial-check-rescue-org.html
@@ -15,18 +15,27 @@
{% translate 'Zuletzt geprüft:' %} {{ rescue_org.last_checked_hr }}
- {{ rescue_org.get_allows_using_materials_display }}
+ {{ rescue_org.get_allows_using_materials_display }}
{% if rescue_org.website %}
-
+
{{ rescue_org.website|domain }}
{% endif %}
- {% for species_url in rescue_org.species_urls %}
- {{ species_url.species }}: {{ species_url.url }}
-
- {% endfor %}
+ {% with rescue_org_counter=forloop.counter %}
+ {% for species_url in rescue_org.species_urls %}
+ {{ species_url.species }}:
+
+ {{ species_url.url }}
+
+
+ {% endfor %}
+
+ {% endwith %}
{% if set_internal_comment_available %}