From 70e665f52c8f9a1f22ceeb8d855cd4116c961d74 Mon Sep 17 00:00:00 2001 From: adinhodovic Date: Sat, 4 May 2024 20:33:20 +0200 Subject: [PATCH] feat: Compact resume printing --- pyproject.toml | 2 +- .../static/wagtail_resume/css/resume_page.css | 66 +++++++++++++++++-- .../blocks/work_experience_block.html | 4 +- .../wagtail_resume/resume_page_body.html | 4 +- 4 files changed, 64 insertions(+), 12 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 15a155d..47a6abc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "poetry.core.masonry.api" name = "wagtail-resume" authors = ["Adin Hodovic "] license = "MIT" -version = "2.8.0" +version = "2.9.0" readme = "README.md" homepage = "https://github.com/adinhodovic/wagtail-resume" repository = "https://github.com/adinhodovic/wagtail-resume" diff --git a/wagtail_resume/static/wagtail_resume/css/resume_page.css b/wagtail_resume/static/wagtail_resume/css/resume_page.css index ded0118..69f7c07 100644 --- a/wagtail_resume/static/wagtail_resume/css/resume_page.css +++ b/wagtail_resume/static/wagtail_resume/css/resume_page.css @@ -4,7 +4,11 @@ body { } p { + font-size: 1rem; line-height: 1.5; +} + +li { font-size: 1rem; } @@ -108,8 +112,6 @@ a { } .photo { - margin-bottom: 2.5rem; - margin-top: 1rem; border-radius: 50%; width: 250px; } @@ -126,11 +128,6 @@ a { color: #5b5b55; } -.fas, -.fab { - font-size: 1.5rem; -} - .pdf { display: None; } @@ -181,3 +178,58 @@ a { width: 45%; } } + +/* Print styles */ +@media print { + h1 { + font-size: 1.3rem; + } + + h2 { + font-size: 1.1rem; + } + + p, + li, + h3, + a { + font-size: 0.8rem; + } + + .mt-1 { + margin-top: 0.125rem; + } + + .mb-1 { + margin-bottom: 0.125rem; + } + + .mb-2 { + margin-bottom: 0.25rem; + } + + .mt-2 { + margin-top: 0.25rem; + } + + .mt-3 { + margin-top: 0.5rem; + } + + .mt-4 { + margin-top: 1.5rem; + } + + hr { + margin-top: 0.5rem; + margin-bottom: 0.5rem; + } + + .social-links img { + width: 1rem; + } + + .photo { + width: 200px; + } +} diff --git a/wagtail_resume/templates/wagtail_resume/blocks/work_experience_block.html b/wagtail_resume/templates/wagtail_resume/blocks/work_experience_block.html index ce147b9..2db108d 100644 --- a/wagtail_resume/templates/wagtail_resume/blocks/work_experience_block.html +++ b/wagtail_resume/templates/wagtail_resume/blocks/work_experience_block.html @@ -19,9 +19,9 @@

{{ experience.to_date }} {% endif %}

-
{{ experience.text | markdown }}
+
{{ experience.text | markdown }}
{% if not forloop.last %}
{% endif %} {% endfor %} {% if value.maximum_experiences_displayed > 0 %} -

{{ value.maximum_experiences_user_text }}

+

{{ value.maximum_experiences_user_text }}

{% endif %} diff --git a/wagtail_resume/templates/wagtail_resume/resume_page_body.html b/wagtail_resume/templates/wagtail_resume/resume_page_body.html index fcf2884..a69880a 100644 --- a/wagtail_resume/templates/wagtail_resume/resume_page_body.html +++ b/wagtail_resume/templates/wagtail_resume/resume_page_body.html @@ -23,7 +23,7 @@
-
+

{{ page.full_name }}

{% if page.role %}

{{ page.role }}

{% endif %} @@ -45,7 +45,7 @@

{{ page.full_name }}

Last update: {{ page.latest_revision_created_at|date }}

{% endif %}
-
{% image page.photo original class="photo" %}
+
{% image page.photo original class="photo" %}