From 19434b3ec87f174103e6a842846abbafa94a6ea5 Mon Sep 17 00:00:00 2001 From: Jonathan Weth <git@jonathanweth.de> Date: Sun, 2 Jan 2022 20:16:49 +0100 Subject: [PATCH] Add base templates for plain prints --- aleksis/core/static/print-simple.css | 21 ++++++++ .../templates/core/base_simple_print.html | 52 +++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 aleksis/core/static/print-simple.css create mode 100644 aleksis/core/templates/core/base_simple_print.html diff --git a/aleksis/core/static/print-simple.css b/aleksis/core/static/print-simple.css new file mode 100644 index 000000000..f0e6536b4 --- /dev/null +++ b/aleksis/core/static/print-simple.css @@ -0,0 +1,21 @@ +@page { + padding: 0; + margin: 0; +} + +table.small-print, td.small-print, th.small-print { + font-size: 10pt; +} + +tr { + border-bottom: 1px solid rgba(0, 0, 0, 0.3); +} + +td, th { + padding: 1px; +} + +td.rotate, th.rotate { + text-align: center; + transform: rotate(-90deg); +} diff --git a/aleksis/core/templates/core/base_simple_print.html b/aleksis/core/templates/core/base_simple_print.html new file mode 100644 index 000000000..6e66e2898 --- /dev/null +++ b/aleksis/core/templates/core/base_simple_print.html @@ -0,0 +1,52 @@ +{% load static i18n any_js sass_tags %} +{% get_current_language as LANGUAGE_CODE %} + +<!DOCTYPE html> +<html lang="{{ LANGUAGE_CODE }}"> +<head> + {% include "core/partials/meta.html" %} + + <title> + {% block no_browser_title %} + {% block browser_title %}{% endblock %} — + {% endblock %} + {{ SITE_PREFERENCES.general__title }} + </title> + + {% include_css "material-design-icons" %} + {% include_css "Roboto100" %} + {% include_css "Roboto300" %} + {% include_css "Roboto400" %} + {% include_css "Roboto500" %} + {% include_css "Roboto700" %} + {% include_css "Roboto900" %} + {% include_css "paper-css" %} + <link rel="stylesheet" href="{% sass_src 'public/style.scss' %}"/> + <link rel="stylesheet" href="{% static "print-simple.css" %}"/> + + {% block size %} + <style> + @page { + size: {{ width }}mm {{ height }}mm; + } + + @media print { + html, body { + width: {{ width }}mm; + } + } + + .sheet { + width: {{ width }}mm; + height: {{ height|add:-1 }}.83mm; + } + </style> + {% endblock %} + + {% block extra_head %}{% endblock %} +</head> + +<body> +{% block content %}{% endblock %} +</body> +</html> -- GitLab