From 7eb9a55ec1c58afe7dbde3aeccd04fa9d2d90a58 Mon Sep 17 00:00:00 2001
From: Benjamin Becker <benjamin.becker@dataport.de>
Date: Tue, 29 Oct 2019 10:53:28 +0000
Subject: [PATCH] adds hrefs for preview images, link location in read.html
 line 83 missing

---
 ckanext/odsh/public/odsh.css                      | 8 ++++++--
 ckanext/odsh/templates/package/read.html          | 4 +++-
 ckanext/odsh/templates/snippets/package_item.html | 6 ++++--
 3 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/ckanext/odsh/public/odsh.css b/ckanext/odsh/public/odsh.css
index 8997b708..58e25ca8 100644
--- a/ckanext/odsh/public/odsh.css
+++ b/ckanext/odsh/public/odsh.css
@@ -199,7 +199,11 @@ section#dataset-preview p {
     display: flex;
 }
 
-.container-preview-large > img {
+.container-preview-large a {
+    margin-left: auto;
+}
+
+.container-preview-large img {
     height: 100%;
     margin-left: auto;
     margin-right: auto;
@@ -642,7 +646,7 @@ label.rangesearch.disabled {
     }
 }
 
-.preview-image-container > img {
+.preview-image-container img {
     margin-top: auto;
     height: auto;
     max-width: 102px;
diff --git a/ckanext/odsh/templates/package/read.html b/ckanext/odsh/templates/package/read.html
index cbb909f9..885c0ce3 100644
--- a/ckanext/odsh/templates/package/read.html
+++ b/ckanext/odsh/templates/package/read.html
@@ -80,7 +80,9 @@
 <section id="dataset-preview">
     <h3>{{ _('Preview') }}:</h3>
     <div class="container-preview-large">
-        <img src= "{{ picture }}" alt= "Vorschau"/>     
+        <a href="#">
+            <img src= "{{ picture }}" alt= "Vorschau"/>
+        </a>
     </div>
 </section> 
 {% endif %}
diff --git a/ckanext/odsh/templates/snippets/package_item.html b/ckanext/odsh/templates/snippets/package_item.html
index a0800747..d6fe6070 100644
--- a/ckanext/odsh/templates/snippets/package_item.html
+++ b/ckanext/odsh/templates/snippets/package_item.html
@@ -35,8 +35,10 @@ Example:
 <div class="odsh-dataset-item">
     <div class="preview-image-container">
             {% if thumbnail %}
-            <img src= "{{ thumbnail }}" alt= "Vorschau" /> 
-           {% endif%}
+            <a href={{  h.url_for(controller='package', action='read', id=package.name) }}>
+                <img src= "{{ thumbnail }}" alt= "Vorschau" />
+            </a>
+            {% endif%}
     </div>
     {% block content %}
     <div class="dataset-content">
-- 
GitLab