Skip to content

Commit

Permalink
Add django-datashow app with CMSApp and templates
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanw committed Jan 24, 2025
1 parent 37a25cb commit 898af28
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 12 deletions.
9 changes: 9 additions & 0 deletions fragdenstaat_de/fds_cms/cms_apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,12 @@ class FdsCmsPlainAPIApp(CMSApp):

def get_urls(self, page=None, language=None, **kwargs):
return ["fragdenstaat_de.fds_cms.urls_plainapi"]


@apphook_pool.register
class DatashowCMSApp(CMSApp):
name = "Datashow CMS App"
app_name = "datashow"

def get_urls(self, page=None, language=None, **kwargs):
return ["datashow.urls"]
3 changes: 1 addition & 2 deletions fragdenstaat_de/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ def INSTALLED_APPS(self):
# Additional CMS plugins
"sortabletable",
"contractor",
"django_jsonform",
"tabulator",
"datashow",
"djcelery_email",
"django.contrib.redirects",
"django_prices",
Expand Down
2 changes: 2 additions & 0 deletions fragdenstaat_de/templates/datashow/_filterform.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{% load i18n form_helper %}
{% render_form form %}
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{% extends "base.html" %}
{% load static i18n %}
{% load cms_tags %}
{% block css %}
{{ block.super }}
<link rel="stylesheet" href="{% static 'datashow/css/datashow.css' %}">
{% endblock %}
{% block body %}
<div class="text-bg-secondary mb-3">
<nav class="container-md" aria-label="breadcrumb">
Expand All @@ -13,7 +18,8 @@
</li>
<li class="breadcrumb-item">
{% if dataset %}
<a href="/daten/">{% translate "Datasets" %}</a>
{% page_url "datasets" as datasets_url %}
<a href="{{ datasets_url|default:'/daten/' }}">{% translate "Datasets" %}</a>
{% else %}
{% translate "Datasets" %}
{% endif %}
Expand All @@ -25,12 +31,12 @@
{{ dataset.name }}
{% endif %}
</li>
{% if table %}
{% if table and dataset.default_table != table %}
<li class="breadcrumb-item">
{% if row %}
<a href="{{ table.get_absolute_url }}">{{ table.name }}</a>
<a href="{{ table.get_absolute_url }}">{{ table.label }}</a>
{% else %}
{{ table.name }}
{{ table.label }}
{% endif %}
</li>
{% endif %}
Expand All @@ -44,10 +50,7 @@
{% endblock %}
</div>
{% endblock %}
{% block extra_css %}
{% comment %} <link rel="stylesheet" type="text/css" href="{% static 'tabulator/css/tabulator_bootstrap5.min.css' %}"> {% endcomment %}
{% endblock extra_css %}
{% block scripts %}
{{ block.super }}
<script type="text/javascript" src="{% static 'tabulator/js/htmx.min.js' %}"></script>
<script type="text/javascript" src="{% static 'datashow/js/htmx.min.js' %}"></script>
{% endblock %}
1 change: 0 additions & 1 deletion fragdenstaat_de/theme/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@
*admin_urls,
path("", include("fragdenstaat_de.fds_blog.redirect_urls"), name="blog-redirects"),
path("", include("fragdenstaat_de.fds_ogimage.urls")),
path(pgettext_lazy("url part", "data/"), include("tabulator.urls")),
path(pgettext_lazy("url part", "campaign/"), include(campaign_urls)),
path("", include("cms.urls")),
prefix_default_language=False,
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@ dependencies = [
"django-contractor>=0.0.8",
"django-contrib-comments>=2.2.0",
"django-crossdomainmedia>=0.0.4",
"django-datashow>=0.1.0",
"django-elasticsearch-dsl>=8.0,<9.0",
"django-filer>=3.0.0",
"django-filingcabinet @ git+https://github.com/okfde/django-filingcabinet.git@main",
"django-filter<24.1",
"django-floppyforms>=1.9.0",
"django-json-widget>=2.0.1",
"django-leaflet>=0.30.1",
"django-logentry-admin>=1.1.0",
"django-mfa3>=0.13.0",
Expand Down Expand Up @@ -104,7 +106,6 @@ dependencies = [
"django-legal-advice-builder @ git+https://github.com/fragdenstaat/django-legal-advice-builder.git@main",
"fcdocs-annotate @ git+https://github.com/okfde/fcdocs-annotate.git@main",
"froide-evidencecollection[gsheets] @ git+https://github.com/okfde/froide-evidencecollection.git@main",
"django-tabulator @ file:///Users/stefanwehrmeyer/Code/django-tabulator",
]

[project.optional-dependencies]
Expand Down

0 comments on commit 898af28

Please sign in to comment.