From b7c189d3d6912c91874de54d44f6346adc635060 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 7 Mar 2019 11:09:02 -0800 Subject: clean up HTML whitespace --- python/fatcat_web/__init__.py | 4 ++++ python/fatcat_web/templates/base.html | 24 ++++++++++++++++++------ python/fatcat_web/templates/release_view.html | 4 +++- 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/python/fatcat_web/__init__.py b/python/fatcat_web/__init__.py index 1ad278ba..e80393c2 100644 --- a/python/fatcat_web/__init__.py +++ b/python/fatcat_web/__init__.py @@ -28,6 +28,10 @@ conf = fatcat_client.Configuration() conf.host = Config.FATCAT_API_HOST api = fatcat_client.DefaultApi(fatcat_client.ApiClient(conf)) +# remove most jinja2 template whitespace +app.jinja_env.trim_blocks = True +app.jinja_env.lstrip_blocks = True + def auth_api(token): conf = fatcat_client.Configuration() conf.api_key["Authorization"] = token diff --git a/python/fatcat_web/templates/base.html b/python/fatcat_web/templates/base.html index 2a5e0dd6..d3353ca4 100644 --- a/python/fatcat_web/templates/base.html +++ b/python/fatcat_web/templates/base.html @@ -4,13 +4,21 @@ - {# sorry this line is so long; don't want any whitespace #} - {% block title %}{% if config.FATCAT_DOMAIN.startswith('qa.') %}[QA] {% elif config.FATCAT_DOMAIN.startswith('dev.') %}[DEV] {% endif %}fatcat!{% endblock %} + {%- block title -%} + {%- if config.FATCAT_DOMAIN.startswith('qa.') -%} + {{- "[QA] " -}} + {%- elif config.FATCAT_DOMAIN.startswith('dev.') -%} + {{- "[DEV] " -}} + {%- endif -%} + fatcat! + {%- endblock -%} - + {% block extra_head %}{% endblock %} @@ -112,8 +120,12 @@ - + crossorigin="anonymous"> + + {% block postscript %}{% endblock %} diff --git a/python/fatcat_web/templates/release_view.html b/python/fatcat_web/templates/release_view.html index 14e50953..14ff4b44 100644 --- a/python/fatcat_web/templates/release_view.html +++ b/python/fatcat_web/templates/release_view.html @@ -36,7 +36,9 @@ - {% if release.container.issnl %}{% endif %} + {% if release.container.issnl %} + + {% endif %} {% elif release.publisher %} -- cgit v1.2.3