From 43c23e64ac7877dd61a573f35e9abc644a6dc2b6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20Bedna=C5=99=C3=ADk?= <jan.bednarik@gmail.com>
Date: Thu, 25 Mar 2021 17:12:09 +0100
Subject: [PATCH] uniweb: Markdown in tables

---
 uniweb/templates/uniweb/base.html         |  6 ++++++
 uniweb/templates/uniweb/blocks/table.html | 22 +++++-----------------
 2 files changed, 11 insertions(+), 17 deletions(-)

diff --git a/uniweb/templates/uniweb/base.html b/uniweb/templates/uniweb/base.html
index 5d528a47..bc37667b 100644
--- a/uniweb/templates/uniweb/base.html
+++ b/uniweb/templates/uniweb/base.html
@@ -30,6 +30,12 @@
       background-position: 0 0;
       padding: 0 0 1em 35px !important;
     }
+    .content-block a {
+      color: #004958;
+    }
+    .text-white a {
+      color: #FFFFFF;
+    }
   </style>
 
   {% if page.root_page.matomo_id %}
diff --git a/uniweb/templates/uniweb/blocks/table.html b/uniweb/templates/uniweb/blocks/table.html
index 3f2b07f0..6f57537e 100644
--- a/uniweb/templates/uniweb/blocks/table.html
+++ b/uniweb/templates/uniweb/blocks/table.html
@@ -1,7 +1,7 @@
-{% load table_block_tags %}
+{% load table_block_tags shared_filters %}
 
 <div class="my-6">
-  <table class="table table--bordered table--condensed mx-auto">
+  <table class="table table--bordered mx-auto content-block">
     {% if table_caption %}
        <caption class="head-heavy-sm my-4">{{ table_caption }}</caption>
     {% endif %}
@@ -12,11 +12,7 @@
             {% with forloop.counter0 as col_index %}
                 <th scope="col" {% cell_classname 0 col_index %}>
                     {% if column.strip %}
-                        {% if html_renderer %}
-                            {{ column.strip|safe|linebreaksbr }}
-                        {% else %}
-                            {{ column.strip|linebreaksbr }}
-                        {% endif %}
+                        {{ column.strip|markdown }}
                     {% endif %}
                 </th>
             {% endwith %}
@@ -33,21 +29,13 @@
                 {% if first_col_is_header and forloop.first %}
                     <th scope="row" {% cell_classname row_index col_index table_header %}>
                         {% if column.strip %}
-                            {% if html_renderer %}
-                                {{ column.strip|safe|linebreaksbr }}
-                            {% else %}
-                                {{ column.strip|linebreaksbr }}
-                            {% endif %}
+                            {{ column.strip|markdown }}
                         {% endif %}
                     </th>
                  {% else %}
                     <td {% cell_classname row_index col_index table_header %}>
                         {% if column.strip %}
-                            {% if html_renderer %}
-                                {{ column.strip|safe|linebreaksbr }}
-                            {% else %}
-                                {{ column.strip|linebreaksbr }}
-                            {% endif %}
+                            {{ column.strip|markdown }}
                         {% endif %}
                     </td>
                  {% endif %}
-- 
GitLab