Skip to content

Commit

Permalink
Feature/747 jinja3 (#784)
Browse files Browse the repository at this point in the history
* Update jina2 versions. Refs #747

* Remove unneeded with assignments. Refs #747

* Update changelog. Refs #747

* Update copyright in static admin. Refs #747

* Remove unneeded copyright sets. Refs #747

* fix typo

* Remove old IE 9 code. Refs #747

* Remove unneeded jinja2 template. Refs #747

---------

Co-authored-by: Vanderhaegen Cedrik <cedrik.vanderhaegen@vlaanderen.be>
  • Loading branch information
koenedaele and cedrikv committed Mar 2, 2023
1 parent 4f63129 commit 6d7c67b
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 103 deletions.
11 changes: 8 additions & 3 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
in progress
-----------

- Easier and more flexible configuration of analytics snippets, such as `Plausible Analytics <https://plausible.io>`_. (#738)
- Show acutal language tags in admin interface drop downs, as opposed to just the labels to reduce confusion. (#766)
- Update label of default language `vls` to `Vlaams` to be inline with the normal IANA label. (#767)
- Jinja2 3.x is now the expected template engine. Users who have overridden and
customised many templates might need to update them. (#747)
- Easier and more flexible configuration of analytics snippets, such as
`Plausible Analytics <https://plausible.io>`_. (#738)
- Show acutal language tags in admin interface drop downs, as opposed to just
the labels to reduce confusion. (#766)
- Update label of default language `vls` to `Vlaams` to be inline with the normal
IANA label. (#767)
- Update language-tags to latest version. (#754)
- Stop building universal wheels (#752)
- Update docs to no longer reference mkvirtualenv, use standard venv instead (#773)
Expand Down
2 changes: 1 addition & 1 deletion atramhasis/static/admin/src/app/ui/templates/AppUi.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ <h1 class="left logo-small-text">Atramhasis</h1>
</div>

<footer>
© Copyright 2014-2021 <a href="https://www.onroerenderfgoed.be/">Flanders Heritage Agency</a>
© Copyright 2014-2023 <a href="https://www.onroerenderfgoed.be/">Flanders Heritage Agency</a>
<div class="right">nl | fr | en</div>
</footer>

Expand Down
79 changes: 0 additions & 79 deletions atramhasis/templates/d3cloud.jinja2

This file was deleted.

6 changes: 1 addition & 5 deletions atramhasis/templates/home.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<link rel="canonical" href="{{ request.route_url('home') }}" />
{% endblock %}
{% set app_package = app_package|default('atramhasis', true) %}
{% set copyright_year = copyright_year|default('2014-2021') %}

{% block html_title %}Home{% endblock %}

Expand All @@ -17,7 +16,6 @@
<div class="row">
{% include 'welcome.jinja2' %}
{% include 'search_form.jinja2' %}
{# {% include 'd3cloud.jinja2' %}#}
</div>
</div>
{% endblock %}
Expand All @@ -28,9 +26,7 @@
{% endblock %}

{% block footer %}
{% with copyright_year = copyright_year %}
{% include 'footer-main.jinja2' %}
{% endwith %}
{% include 'footer-main.jinja2' %}
{% endblock %}

{% block custom_js %}{% endblock %}
Expand Down
2 changes: 0 additions & 2 deletions atramhasis/templates/layout.jinja2
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
{% extends "staticlayout-page.jinja2" %}

{% set copyright_year = '2014-2021' %}
5 changes: 2 additions & 3 deletions atramhasis/templates/scheme_tree.jinja2
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<!DOCTYPE html>
<!--[if IE 9]><html class="lt-ie10" lang="en" > <![endif]-->
<html class="no-js" lang="{{ request.locale_name }}" prefix="dcat: https://www.w3.org/TR/vocab-dcat/">
<html class="no-js" lang="{{ request.locale_name }}">

{% set app_package = app_package|default('atramhasis', true) -%}
{% set app_name = app_name|default('Atramhasis') %}
{% set copyright_year = copyright_year|default('2014-2021') %}
{% set copyright_year = '2014-2023' %}

<head>
<meta charset="utf-8" />
Expand Down
5 changes: 1 addition & 4 deletions atramhasis/templates/staticlayout-page.jinja2
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{% extends "staticlayout.jinja2" %}

{% set app_name = app_name|default('Atramhasis') %}
{% set copyright_year = copyright_year|default('2014-2021') %}

{% block js_files_head %}
<script src="{{ request.static_path(app_package + ':static/node_modules/foundation-sites/js/vendor/jquery.js') }}"></script>
Expand All @@ -25,9 +24,7 @@
{% endblock %}

{% block footer %}
{% with copyright_year = copyright_year %}
{% include 'footer-page.jinja2' %}
{% endwith %}
{% include 'footer-page.jinja2' %}
{% endblock %}

{% block custom_js %}{% endblock %}
3 changes: 1 addition & 2 deletions atramhasis/templates/staticlayout.jinja2
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<!DOCTYPE html>
<!--[if IE 9]><html class="lt-ie10" lang="en" > <![endif]-->
<html class="no-js" lang="{{ request.locale_name }}" prefix="dcat: https://www.w3.org/TR/vocab-dcat/">

{% set app_package = app_package|default('atramhasis', true) -%}
{% set app_name = app_name|default('Atramhasis') %}
{% set copyright_year = copyright_year|default('2014-2021') %}
{% set copyright_year = '2014-2023' %}

<head>
{% block head %}
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ zope.sqlalchemy==1.6
transaction==3.0.1

# jinja2
jinja2==2.11.3
jinja2==3.1.2
markupsafe==2.0.1
pyramid-jinja2==2.10
Babel==2.11.0
Expand All @@ -41,4 +41,4 @@ bleach==5.0.1

# requests
requests==2.28.2
cachecontrol==0.12.11
cachecontrol==0.12.11
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ def run(self):
'pyramid_openapi3',
'openapi-spec-validator==0.4.0', # https://github.com/p1c2u/openapi-core/issues/442
'language_tags',
'jinja2 < 3.0.0',
'markupsafe==2.0.1', # necessary for <3 jinja2 versions
'jinja2 >= 3.0.0',
'markupsafe',
'pyramid_jinja2',
'alembic',
'babel',
Expand Down

0 comments on commit 6d7c67b

Please sign in to comment.