Skip to content

Commit

Permalink
Add master template & remove utils/templates and tags
Browse files Browse the repository at this point in the history
  • Loading branch information
Floris272 committed Nov 27, 2024
1 parent 4a79fa5 commit ee4057d
Show file tree
Hide file tree
Showing 8 changed files with 85 additions and 103 deletions.
20 changes: 10 additions & 10 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[pycodestyle]
[pep8]
[flake8]
ignore=
# Formatting rules incompatible with black
ignore =
# Formatting rules incompatible with black
W293,W291,E501,E261,W503
max-line-length=88
exclude=migrations,static,media
max-line-length = 88
exclude = migrations,static,media
per-file-ignores =
# Config uses layered wildcard imports
src/open_producten/conf/*:F405
# Config uses layered wildcard imports
src/open_producten/conf/*:F405,F403

[isort]
combine_as_imports = true
Expand All @@ -21,9 +21,9 @@ use_parentheses = True
ensure_newline_before_comments = True
skip = env,node_modules
skip_glob = **/migrations/**
known_django=django
known_first_party=open_producten
sections=FUTURE,STDLIB,DJANGO,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
known_django = django
known_first_party = open_producten
sections = FUTURE,STDLIB,DJANGO,THIRDPARTY,FIRSTPARTY,LOCALFOLDER

[coverage:run]
branch = True
Expand All @@ -46,4 +46,4 @@ exclude_also =
@(abc\.)?abstractmethod
raise NotImplementedError
\.\.\.
pass
pass
65 changes: 65 additions & 0 deletions src/open_producten/templates/master.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{% load static %}<!DOCTYPE html>
<html lang="en" class="view {% block view_class %}view--{{ request.resolver_match.namespaces|join:'-' }}-{{ request.resolver_match.url_name }}{% endblock %}">
<head>
<meta charset="utf-8">
<title>{% block title %}Open_Producten{% endblock %}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="{% static 'ico/favicon.svg' %}" sizes="any" rel="icon" type="image/svg+xml" />
<link href="{% static 'ico/favicon-96x96.png' %}" sizes="96x96" rel="icon" type="image/png" />
<link href="{% static 'ico/favicon-32x32.png' %}" sizes="32x32" rel="icon" type="image/png" />
<link href="{% static 'ico/favicon.png' %}" sizes="16x16" rel="icon" type="image/png" />
<link href="{% static 'ico/favicon.png' %}" rel="shortcut icon">
{% block extra_css %}{% endblock %}
</head>

<body class="view__body">
<main>
{% block content %}
Override <code>{% verbatim %}{% block content %}{% endverbatim %}</code>
to get some actual content.
{% endblock %}
</main>

<footer class="footer container">
<div class="footer__row">
<div class="footer__col footer__col--small">
<img src="{% static 'ico/favicon-96x96.png' %}" alt="Maykin logo" height="48">
<p>
Developed by <a class="link" href="https://www.maykinmedia.nl">Maykin</a><br>
within the <a class="link" href="https://opengem.nl">Open Gemeente Initiatief</a> &copy; 2024<br>

</p>
</div>
<div class="footer__col">
<h5 class="footer__header">open_producten</h5>
<ul class="footer__list">
<li><a class="link link--muted" href="https://hub.docker.com/r/maykinmedia/open-producten">Docker images</a></li>
<li><a class="link link--muted" href="https://github.com/maykinmedia/open-producten">Code on Github</a></li>
</ul>
</div>
<div class="footer__col">
<h5 class="footer__header">Other</h5>
<ul class="footer__list">
<li>Report <a class="link link--muted" href="https://github.com/maykinmedia/open-producten/issues">issues</a> for questions, bugs or wishes</li>
<li>Read more on <a class="link link--muted" href="https://commonground.nl/">Common Ground</a></li>
</ul>
</div>
</div>

<div class="footer__row">
<div class="footer__col">
<code>{{ settings.RELEASE }}</code>
</div>
<div class="footer__col footer__col--right">
<code>{{ settings.GIT_SHA|default:"" }}</code>
</div>
</div>
</footer>

{% if dsn %}
<script src="https://browser.sentry-cdn.com/5.10.1/bundle.min.js" integrity="sha384-sAOze6ZTBIpiWBF3VlUteSInM4rYpjxrejp1wMmmKqA9clRZ1vZJ36Ihmt1ilTrG" crossorigin="anonymous"></script>
<script>Sentry.init({ dsn: '{{ dsn }}'});</script>
{% endif %}

</body>
</html>
11 changes: 9 additions & 2 deletions src/open_producten/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
)
from maykin_2fa import monkeypatch_admin
from maykin_2fa.urls import urlpatterns, webauthn_urlpatterns
from mozilla_django_oidc_db.views import AdminLoginFailure

from open_producten.accounts.views.password_reset import PasswordResetView

# from open_producten.locations.router import location_urlpatterns
# from open_producten.products.router import product_urlpatterns
# from open_producten.producttypen.router import product_type_urlpatterns
Expand All @@ -25,6 +27,8 @@
monkeypatch_admin()

handler500 = "open_producten.utils.views.server_error"

admin.site.enable_nav_sidebar = False
admin.site.site_header = "Open Producten admin"
admin.site.site_title = "Open Producten admin"
admin.site.index_title = "Open Producten dashboard"
Expand All @@ -42,6 +46,9 @@
auth_views.PasswordResetDoneView.as_view(),
name="password_reset_done",
),
# OIDC urls
path("admin/login/failure/", AdminLoginFailure.as_view(), name="admin-oidc-error"),
path("auth/oidc/", include("mozilla_django_oidc.urls")),
# Use custom login views for the admin + support hardware tokens
path("admin/", include((urlpatterns, "maykin_2fa"))),
path("admin/", include((webauthn_urlpatterns, "two_factor"))),
Expand Down Expand Up @@ -96,5 +103,5 @@
import debug_toolbar

urlpatterns = [
path("__debug__/", include(debug_toolbar.urls)),
] + urlpatterns
path("__debug__/", include(debug_toolbar.urls)),
] + urlpatterns
2 changes: 1 addition & 1 deletion src/open_producten/utils/geocode.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def __init__(
scheme="https",
user_agent=None,
ssl_context=DEFAULT_SENTINEL,
adapter_factory=None
adapter_factory=None,
):
super().__init__(
scheme=scheme,
Expand Down

This file was deleted.

Empty file.
37 changes: 0 additions & 37 deletions src/open_producten/utils/templatetags/utils.py

This file was deleted.

42 changes: 0 additions & 42 deletions src/open_producten/utils/tests/test_templatetags.py

This file was deleted.

0 comments on commit ee4057d

Please sign in to comment.