From bd8d59b343767261e6025048b78d90ff2a9288a5 Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Fri, 2 Apr 2021 23:17:54 +0100 Subject: [PATCH] restoring wiki_markup where still used --- core/templatetags/wiki_markup.py | 6 ++++++ templates/cave_description.html | 19 ------------------- templates/entrance.html | 3 +-- templates/logbookentry.html | 2 +- templates/person.html | 3 +-- templates/personindex.html | 3 +-- templates/qm.html | 3 +-- 7 files changed, 11 insertions(+), 28 deletions(-) delete mode 100644 templates/cave_description.html diff --git a/core/templatetags/wiki_markup.py b/core/templatetags/wiki_markup.py index 9aafb39..fff2836 100644 --- a/core/templatetags/wiki_markup.py +++ b/core/templatetags/wiki_markup.py @@ -7,6 +7,12 @@ from troggle.core.models_caves import LogbookEntry, QM, Cave import re, urllib.parse register = template.Library() +'''Several templates are still (2021) using these wiki filters extensively to process data extracted from the database, +and to restructure values into valid URLs to go elsewhere in the system, even where these are not actually 'wiki'. See +the regexes at the end of this file. +So the data in the database needs to be checked that there is no wiki-format content before these are deleted, and the +filter functions of these regexes needs to be explored in practice. +''' @register.filter() def plusone(n): diff --git a/templates/cave_description.html b/templates/cave_description.html deleted file mode 100644 index 663096b..0000000 --- a/templates/cave_description.html +++ /dev/null @@ -1,19 +0,0 @@ -{% extends "cavebase.html" %} - -{% block title %} {{cave_description}} {% endblock title %} -{% block editLink %}Edit description {{cave_description}}{% endblock %} - -{% block contentheader %} - {{cave_description.long_name}} -{% endblock contentheader %} - - - -{% block content %} - -

{{cave_description.long_name}}

-

- {{cave_description.description|wiki_to_html}} -

- -{% endblock content %} \ No newline at end of file diff --git a/templates/entrance.html b/templates/entrance.html index b148837..a59410c 100644 --- a/templates/entrance.html +++ b/templates/entrance.html @@ -1,6 +1,5 @@ {% extends "base.html" %} - - +{% load wiki_markup %} {% block title %}{{ cave.official_name|wiki_to_html }} - {{ entrance_letter|wiki_to_html }}{% endblock %} diff --git a/templates/logbookentry.html b/templates/logbookentry.html index c8ed439..5691c4e 100644 --- a/templates/logbookentry.html +++ b/templates/logbookentry.html @@ -1,5 +1,5 @@ {% extends "base.html" %} - +{% load wiki_markup %} {% block title %}Logbook {{logbookentry.id}}{% endblock %} {% block editLink %}Edit logbook entry {{logbookentry|wiki_to_html_short}}{% endblock %} diff --git a/templates/person.html b/templates/person.html index 573c194..64896a7 100644 --- a/templates/person.html +++ b/templates/person.html @@ -1,6 +1,5 @@ {% extends "base.html" %} - - +{% load wiki_markup %} {% block title %}Person {{person|wiki_to_html_short}}{% endblock %} {% block editLink %}| Edit person {{person|wiki_to_html_short}}{% endblock %} diff --git a/templates/personindex.html b/templates/personindex.html index 0a0405b..10ac7f6 100644 --- a/templates/personindex.html +++ b/templates/personindex.html @@ -1,6 +1,5 @@ {% extends "base.html" %} - - +{% load wiki_markup %} {% block title %}Person Index{% endblock %} {% block content %} diff --git a/templates/qm.html b/templates/qm.html index 502c0a3..86ec2b5 100644 --- a/templates/qm.html +++ b/templates/qm.html @@ -1,7 +1,6 @@ {% extends "base.html" %} - +{% load wiki_markup %} {% load link %} - {% block title %} QM: {{qm|wiki_to_html_short}} {% endblock %} {% block editLink %}| Edit QM {{qm|wiki_to_html_short}}{% endblock %}