Skip to content

Commit

Permalink
Merge pull request #83 from adinhodovic/add-last-update
Browse files Browse the repository at this point in the history
feat: Add last update date
  • Loading branch information
adinhodovic committed Apr 17, 2024
2 parents 01d6f14 + 30404a6 commit b4cc9c7
Show file tree
Hide file tree
Showing 10 changed files with 206 additions and 225 deletions.
21 changes: 13 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "wagtail-resume"
authors = ["Adin Hodovic <hodovicadin@gmail.com>"]
license = "MIT"
version = "2.6.0"
version = "2.7.0"
readme = "README.md"
homepage = "https://github.com/adinhodovic/wagtail-resume"
repository = "https://github.com/adinhodovic/wagtail-resume"
Expand Down Expand Up @@ -58,9 +62,6 @@ pytest-mock = "^3.0.0"
djlint = "^1.34.0"
pudb = "^2022.1.3"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.pytest.ini_options]
addopts = "--ds=tests.settings --reuse-db --pdbcls=pudb.debugger:Debugger"
Expand Down Expand Up @@ -118,9 +119,13 @@ ignore-docstrings = "yes"
ignore-imports = "yes"

[tool.djlint]
ignore = "H006,H030,H031"
profile = "django"
preserve_blank_lines = true
use_gitignore = true
blank_line_after_tag = "load,extends"
close_void_tags = true
format_css = true
format_js = true
# TODO: remove T002 when fixed https://github.com/Riverside-Healthcare/djLint/issues/687
ignore = "H006,H030,H031,T002"
include = "H017,H035"
indent = 2
max_line_length = 119
profile = "django"
9 changes: 3 additions & 6 deletions tests/test_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,11 @@ def test_template(site, resume, client):
res = client.get(resume.full_url)
soup = BeautifulSoup(res.content, "html.parser")

template_name = soup.find("h2", {"class": "name"}).string
assert template_name == resume.full_name
assert resume.full_name in soup.text

template_role = soup.find("h2", {"class": "role"}).string
assert template_role == resume.role
assert resume.role in soup.text

template_about = soup.find("p", {"class": "about"})
assert about in str(template_about)
assert about in soup.text


def test_resume_preferences(site, resume, client):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Generated by Django 5.0.2 on 2024-04-17 15:28

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("wagtail_resume", "0013_alter_baseresumepage_resume"),
]

operations = [
migrations.AddField(
model_name="baseresumepage",
name="display_last_update",
field=models.BooleanField(
default=True,
help_text="If enabled, the last update date will be displayed.",
),
),
]
4 changes: 4 additions & 0 deletions wagtail_resume/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ class BaseResumePage(MetadataMixin, Page): # pylint: disable=too-many-ancestors
""",
max_length=64,
)
display_last_update = models.BooleanField(
default=True, help_text="If enabled, the last update date will be displayed."
)

role = models.CharField(max_length=100, null=True, blank=True)
about = MarkdownField(max_length=2500, null=True, blank=True)
Expand Down Expand Up @@ -87,6 +90,7 @@ class BaseResumePage(MetadataMixin, Page): # pylint: disable=too-many-ancestors
FieldPanel("font"),
FieldPanel("background_color"),
FieldPanel("pdf_generation_visibility"),
FieldPanel("display_last_update"),
],
heading="Customization",
),
Expand Down
138 changes: 51 additions & 87 deletions wagtail_resume/static/wagtail_resume/css/resume_page.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,34 @@ body {

p {
line-height: 1.5;
font-size: 1rem
font-size: 1rem;
}

h2 {
font-weight: 600;
font-size: 1.3rem;
}

h3 {
font-weight: 600;
font-size: 1rem;
}

hr {
border-color: #fdfcfc;
border-width: 0.1px;
margin-top: 1rem;
margin-bottom: 1rem;
}

.small {
font-size: 0.8rem;
}

.italic {
font-style: italic;
}

.mt-0 {
margin-top: 0rem;
}
Expand All @@ -28,6 +41,10 @@ hr {
margin-bottom: 0rem;
}

.ml-0 {
margin-left: 0 !important;
}

.mt-1 {
margin-top: 0.25rem;
}
Expand All @@ -36,9 +53,32 @@ hr {
margin-bottom: 0.25rem;
}

.name {
.ml-1 {
margin-left: 0.25rem;
}

.mb-2 {
margin-bottom: 0.5rem;
margin-top: 0;
}

.mt-2 {
margin-top: 0.5rem;
}

.ml-2 {
margin-left: 0.5rem;
}

.mr-2 {
margin-right: 0.5rem;
}

.mt-3 {
margin-top: 1rem;
}

.mt-4 {
margin-top: 2rem;
}

.container {
Expand All @@ -49,10 +89,6 @@ hr {
min-height: 100vh;
}

.work-experience-heading, .contribution-title {
font-size: 1.10rem;
}

.resume {
box-shadow: 0px 5px 5px 0 rgb(159, 159, 159);
margin: 0 auto;
Expand All @@ -66,86 +102,40 @@ img {
}

a {
color: #4652F6;
color: #4652f6;
text-decoration: none;
background-color: transparent;
}

.personal-info {
margin-bottom: 0.1rem;
margin-top: 0.3rem;
}

.personal-info > div {
display: inline-block;
}

.personal-info > div:last-of-type {
float: right;
}

.photo {
margin-bottom: 3rem;
margin-bottom: 2.5rem;
margin-top: 1rem;
border-radius: 50%;
width: 250px;
}

.social-links img {
margin-top: 0.4rem;
width: 30px;
width: 1.5rem;
}

.social-links span {
margin-left: 0.3rem;
vertical-align: super;
}

.date {
color: #5b5b55;
}

.text {
margin: 2rem 1rem;
}

.section-title {
margin-top: 2rem;
margin-bottom: 0rem;
align-items: center;
}

.section-title i {
margin-right: 0.6rem;
}

.post-date {
margin-top: 0.2rem;
}

.post-degree {
margin-top: 0.2rem;
margin-bottom: 0.2rem;
}

.contribution-title {
margin-bottom: 0.2rem;
}

.contribution-description {
margin: 0.8rem 0;
}

.section-title .fas, .section-title .fab {
font-size: 26px;
.fas,
.fab {
font-size: 1.5rem;
}

.pdf {
display: None;
}

@media (min-width: 768px) {

.personal-info {
align-items: center;
display: flex;
Expand All @@ -159,57 +149,31 @@ a {

.pdf {
color: white;
background: #2A3F76;
background: #2a3f76;
border-radius: 8px;
display: block;
font-size: 16px;
font-weight: 600;
padding: .6rem 1.2rem;
padding: 0.6rem 1.2rem;
line-height: 25px;
float: right;
}
}

@media (min-width: 992px) {

.resume {
padding: 4rem 4rem;
max-width: 950px;
width: 60%;
}

}


@media (max-width: 768px) {

.section-title .fas, .section-title .fab {
font-size: 20px;
}

.section-title i {
margin-right: 0.4rem;
}

h2 {
font-size: 1.6rem;
}

.resume {
padding: 1.5rem;
}

.social-links img {
margin-top: 0.4rem;
width: 22px;
}

.photo {
width: 45%;
margin-bottom: 2rem;
}
}

.margin-0 {
margin-left: 0 !important;
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
{% load wagtailcore_tags %}

<h2 class="section-title">
{% if value.fa_icon %}<i class="{{ value.fa_icon }}"></i>{% endif %}
<h2 class="mt-4 mb-0">
{% if value.fa_icon %}<i class="{{ value.fa_icon }} mr-2"></i>{% endif %}
<span>{{ value.heading }}</span>
</h2>
<hr>
<hr />
<ul>
{% for contribution in value.contributions %}
<li>
<a class="contribution-title" href="{{ contribution.url }}"><b>{{ contribution.title }}</b></a>
<p class="contribution-description">{{ contribution.description }}</p>
</li>
<li>
<a href="{{ contribution.url }}">
<h3>{{ contribution.title }}</h3>
</a>
<p>{{ contribution.description }}</p>
</li>
{% endfor %}
</ul>
Loading

0 comments on commit b4cc9c7

Please sign in to comment.