Skip to content

Commit

Permalink
Merge pull request #1019 from okfn/clean-up-old-frontend-stuff
Browse files Browse the repository at this point in the history
#883 Clean up old frontend stuff
  • Loading branch information
pdelboca committed Dec 1, 2023
2 parents 743f69b + 1aa2713 commit 6bca3fa
Show file tree
Hide file tree
Showing 14 changed files with 4 additions and 118 deletions.
1 change: 0 additions & 1 deletion .env.base
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
CONTACT_EMAIL_SENDER=<change me>
DJANGO_ADMINS=name1 <email1>, name2 <email2>
DJANGO_ALLOWED_HOSTS=localhost,127.0.0.1
DJANGO_COMPRESS_OFFLINE=true
DJANGO_CUSTOM_ASSETS_DOMAIN=<change me>
DJANGO_DEBUG=true
DJANGO_EMAIL_DEBUG=false
Expand Down
21 changes: 0 additions & 21 deletions foundation/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,6 @@ def _parse_email_list(varname):
'sendemail',
'captcha',

# Asset pipeline
'compressor',

# CMS plugins
'djangocms_picture',
'djangocms_text_ckeditor',
Expand Down Expand Up @@ -311,7 +308,6 @@ def _parse_email_list(varname):
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
'compressor.finders.CompressorFinder',
)

# Where else to find static files
Expand Down Expand Up @@ -438,19 +434,6 @@ def _parse_email_list(varname):
# CSP_REPORT_URI = env.get('DJANGO_CSP_REPORT_URI')
# CSP_REPORT_ONLY = True

COMPRESS_OFFLINE = env.get('DJANGO_COMPRESS_OFFLINE') == 'true'
COMPRESS_OFFLINE_CONTEXT = {
'STATIC_URL': STATIC_URL,
}

COMPRESS_PRECOMPILERS = (
('text/sass', 'lib.precompilers.SassFilter'),
)

COMPRESS_FILTERS = {
'css': ['compressor.filters.cssmin.CSSMinFilter']
}

CMS_CACHE_DURATIONS = {
'content': 60,
'menus': 3600,
Expand All @@ -473,10 +456,6 @@ def _parse_email_list(varname):

THUMBNAIL_DEBUG = DEBUG # easy-thumbnails debugging

QUOTE_STYLES = (
'carousel',
)

DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'

CAPTCHA_IMAGE_SIZE = (150, 75)
Expand Down
26 changes: 0 additions & 26 deletions lib/precompilers.py

This file was deleted.

1 change: 0 additions & 1 deletion requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ cssmin==0.2.0

Django==4.2.3
django-cms==3.11.4
django-compressor==4.4
django-countries==7.5.1
django-csp==3.7
django-environ==0.10.0
Expand Down
9 changes: 0 additions & 9 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ cssselect2==0.4.1
django==4.2.3
# via
# -r requirements.in
# django-appconf
# django-classy-tags
# django-cms
# django-csp
Expand All @@ -44,8 +43,6 @@ django==4.2.3
# djangocms-admin-style
# easy-thumbnails
# jsonfield
django-appconf==1.0.4
# via django-compressor
django-classy-tags==3.0.1
# via
# django-cms
Expand All @@ -56,8 +53,6 @@ django-cms==3.11.4
# djangocms-attributes-field
# djangocms-picture
# djangocms-text-ckeditor
django-compressor==4.4
# via -r requirements.in
django-countries==7.5.1
# via -r requirements.in
django-csp==3.7
Expand Down Expand Up @@ -186,8 +181,6 @@ pyasn1-modules==0.2.8
# via google-auth
pyparsing==3.0.9
# via packaging
rcssmin==1.1.1
# via django-compressor
redis==4.5.3
# via django-redis
reportlab==3.6.5
Expand All @@ -199,8 +192,6 @@ requests==2.31.0
# -r requirements.in
# google-api-core
# google-cloud-storage
rjsmin==1.2.1
# via django-compressor
rsa==4.7.2
# via google-auth
sgmllib3k==1.0.0
Expand Down
2 changes: 0 additions & 2 deletions templates/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
{% page_attribute "page_title" %}
{% endblock %}

{% block body-class %}page-template{% endblock %}

{% block body %}
<div class="headline -tighten-1 text-center mb-20">
<h1 class="col-span-full px-3 py-5 font-bold text-center text-h1">We&#x27;re sorry, but the requested page could not be found. If you think there should have been something here, you can try searching for it:</h1>
Expand Down
17 changes: 3 additions & 14 deletions templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
<title>{% block title %}SET A TITLE{% endblock %}</title>

{% block head-icons %}{% endblock %}
{% block head-links %}{% endblock %}
{% block head-alternate %}{% endblock %}
{% render_block "css" %}
{% block head-css %}{% endblock %}
{% block head-meta %}
{% block head-meta-fb-open-graph %}
Expand All @@ -20,7 +17,7 @@
<meta property="og:type" content="website"/>
<meta property="og:url"
content="{% if request.is_secure %}https://{% else %}http://{% endif %}{{ request.get_host }}{{ request.get_absolute_url }}"/>
<meta property="og:description" content="{% page_attribute 'meta_description' %}"/>
<meta property="og:description" content="{% page_attribute 'meta_description' %}"/>
{% if request.current_page.sidebarextension.image.url != '' %}
<meta property="og:image" content="{{ request.current_page.sidebarextension.image.url }}"/>
{% else %}
Expand All @@ -30,24 +27,16 @@
{% block head-meta-fb-open-graph-extra %}{% endblock %}
{% endblock %}
{% endblock %}
{% block head-scripts %}{% endblock head-scripts %}

{% if environment == 'PRODUCTION' %}
<script defer data-domain="{{ host }}" src="https://plausible.io/js/plausible.js"></script>
{% endif %}

{% render_block "css" %}
</head>
<body {% block body-attributes %}{% endblock %} class='{% block body-class %}{% endblock %}'>
{# django-cms toolbar injector -- this must remain in base #}
<body>
{% cms_toolbar %}

{% block body-sheath %}{% endblock %}

{% render_block "js" %}
<script>
{% block javascript-variables %}{% endblock %}
</script>
{% block javascript-libraries %}{% endblock %}
{% block javascript-asynchronous %}{% endblock %}
</body>
</html>
2 changes: 0 additions & 2 deletions templates/cms_article.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{% extends "cms_default.html" %}
{% load cms_tags %}
{% block body-class %}article-template{% endblock %}

{% block body %}
<section class="sect sect-generic -tighten-1 mx-auto mb-20 text-center">
Expand All @@ -9,4 +8,3 @@

{% include 'includes/cta.html' %}
{% endblock %}
{% block template-js %}$( ".carousel-item" ).first().addClass( "active" );{% endblock template-js %}
2 changes: 0 additions & 2 deletions templates/cms_childlist.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{% extends "cms_default.html" %}
{% load cms_tags %}

{% block body-class %}childlist-template{% endblock %}

{% block body %}
<section id="more" class="primary-section">
<div class="article-list">
Expand Down
5 changes: 0 additions & 5 deletions templates/cms_contact.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{% extends "cms_default.html" %}
{% load cms_tags %}

{% block body-class %}contact-template{% endblock %}

{% block body %}

<section class="sect sect-features -tighten-1 mb-20">
Expand Down Expand Up @@ -74,6 +72,3 @@
</section>

{% endblock %}

{% block template-scripts %}
{% endblock template-scripts %}
4 changes: 0 additions & 4 deletions templates/cms_default.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
{% page_attribute "page_title" %}
{% endblock %}

{% block body-class %}page-template{% endblock %}

{% block body %}
{% placeholder "page content" %}
{% endblock %}

{% block breadcrumb %}
{% endblock %}
5 changes: 0 additions & 5 deletions templates/cms_twocolumn.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
{% page_attribute "page_title" %}
{% endblock %}

{% block body-class %}page-template{% endblock %}

{% block body %}
<section class="sect sect-features -tighten-1 mb-20">
<div class="sect__content">
Expand All @@ -17,6 +15,3 @@
</div>
</section>
{% endblock %}

{% block breadcrumb %}
{% endblock %}
23 changes: 1 addition & 22 deletions templates/general.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{% extends "base.html" %}

{% load compress %}
{% load cms_tags %}
{% load menu_tags %}
{% load static %}
Expand All @@ -10,7 +9,6 @@
{% endblock %}

{% block head-css %}
{% load static %}
<link rel="stylesheet" href="{% static 'css/styles.css' %}">
{% endblock %}

Expand Down Expand Up @@ -70,24 +68,5 @@
{% endblock %}

{% block javascript-libraries %}

{% comment %}
NB: The inline script tags here get compiled into the single JavaScript file
for the page, so changes to these *will only show up* if the application is
redeployed.

The reason for this is simple. If we excise all inline script tags from our
pages, then we can serve in production with a Content-Security-Policy which
includes `unsafe-inline`, thus protecting ourselves from a wide range of XSS
attacks.
{% endcomment %}

<script type="text/javascript" src="{% static 'js/scripts.js' %}"
charset="utf-8"></script>
{% block template-scripts %}{% endblock template-scripts %}
<script>
$(function () {
{% block template-js %}{% endblock template-js %}
});
</script>
<script type="text/javascript" src="{% static 'js/scripts.js' %}" charset="utf-8"></script>
{% endblock %}
4 changes: 0 additions & 4 deletions templates/sitemap.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,3 @@
</div>
{% endblock %}

{% block breadcrumb %}
<li><a href='/'>{% trans 'Home' %}</a></li>
<li class="active">{% trans 'Sitemap' %}</li>
{% endblock %}

0 comments on commit 6bca3fa

Please sign in to comment.