Skip to content

Commit

Permalink
Merge pull request #74 from adinhodovic/multiple-improvements
Browse files Browse the repository at this point in the history
feat: Made icons for blocks not required
  • Loading branch information
adinhodovic committed Sep 12, 2023
2 parents d0b6a79 + 1aeea13 commit 15329ed
Show file tree
Hide file tree
Showing 11 changed files with 393 additions and 38 deletions.
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "wagtail-resume"
authors = ["Adin Hodovic <hodovicadin@gmail.com>"]
license = "MIT"
version = "2.2.0"
version = "2.3.0"
readme = "README.md"
homepage = "https://github.com/adinhodovic/wagtail-resume"
repository = "https://github.com/adinhodovic/wagtail-resume"
Expand Down Expand Up @@ -62,8 +62,8 @@ pylint = "^2.17.5"
pylint-django = "^2.5.3"

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

[tool.isort]
skip_glob = "**/migrations/*.py,**/fixtures/*.py"
Expand Down
2 changes: 1 addition & 1 deletion tests/test_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def test_template(client):
template_name = soup.find("h2", {"class": "name"}).string
assert template_name == full_name

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

template_about = soup.find("p", {"class": "about"})
Expand Down
8 changes: 4 additions & 4 deletions wagtail_resume/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Meta:
icon = "doc-full-inverse"

heading = blocks.CharBlock(default="Work experience")
fa_icon = blocks.CharBlock(default="fas fa-tools")
fa_icon = blocks.CharBlock(default="fas fa-tools", required=False)
experiences = blocks.ListBlock(
blocks.StructBlock(
[
Expand Down Expand Up @@ -39,7 +39,7 @@ class Meta:
icon = "edit"

heading = blocks.CharBlock(default="Writing")
fa_icon = blocks.CharBlock(default="fas fa-pencil-alt")
fa_icon = blocks.CharBlock(default="fas fa-pencil-alt", required=False)
posts = blocks.StreamBlock(
[
(
Expand Down Expand Up @@ -70,7 +70,7 @@ class Meta:
icon = "code"

heading = blocks.CharBlock(default="Contributions")
fa_icon = blocks.CharBlock(default="fas fa-code-branch")
fa_icon = blocks.CharBlock(default="fas fa-code-branch", required=False)
contributions = blocks.ListBlock(
blocks.StructBlock(
[
Expand All @@ -89,7 +89,7 @@ class Meta:
icon = "doc-full-inverse"

heading = blocks.CharBlock(default="Education")
fa_icon = blocks.CharBlock(default="fas fa-graduation-cap")
fa_icon = blocks.CharBlock(default="fas fa-graduation-cap", required=False)
educations = blocks.StreamBlock(
[
(
Expand Down
313 changes: 313 additions & 0 deletions wagtail_resume/migrations/0011_baseresumepage_about_icon_and_more.py

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions wagtail_resume/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ class BaseResumePage(MetadataMixin, Page):

role = models.CharField(max_length=100, null=True, blank=True)
about = MarkdownField(max_length=2500, null=True, blank=True)
about_icon = models.CharField(
max_length=50, default="fas fa-tools", null=True, blank=True
)
photo = models.ForeignKey(
Image, null=True, blank=True, on_delete=models.SET_NULL, related_name="+"
)
Expand Down Expand Up @@ -93,6 +96,7 @@ class BaseResumePage(MetadataMixin, Page):
FieldPanel("full_name"),
FieldPanel("role"),
MarkdownPanel("about"),
FieldPanel("about_icon"),
FieldPanel("photo"),
FieldPanel("social_links"),
],
Expand Down
44 changes: 28 additions & 16 deletions wagtail_resume/static/wagtail_resume/css/resume_page.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,36 @@ body {
}

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

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

h4 {
font-size: 1.4rem;
font-weight: 400;
hr {
border-color: #fdfcfc;
border-width: 0.1px;
margin-top: 1rem;
margin-bottom: 1rem;
}

.role {
margin-top: 0;
margin-bottom: 0.5rem;
.mt-0 {
margin-top: 0rem;
}

.mb-0 {
margin-bottom: 0rem;
}

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

.mb-1 {
margin-bottom: 0.25rem;
}

.name {
Expand All @@ -37,7 +50,7 @@ h4 {
}

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

.resume {
Expand All @@ -53,7 +66,7 @@ img {
}

a {
color: #007bff;
color: #4652F6;
text-decoration: none;
background-color: transparent;
}
Expand Down Expand Up @@ -89,17 +102,16 @@ a {
}

.date {
color: grey;
font-size: 0.8rem;
color: #5b5b55;
}

.text {
margin: 2rem 1rem;
}

.section-title {
padding-bottom: 1rem;
border-bottom: 1px solid #B0B0B0;
margin-top: 2rem;
margin-bottom: 0rem;
align-items: center;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{% load wagtailcore_tags %}

<h2 class="section-title"><i class="{{ value.fa_icon }}"></i><span>{{ value.heading }}</span></h2>
<h2 class="section-title">
{% if value.fa_icon %}<i class="{{ value.fa_icon }}"></i>{% endif %}
<span>{{ value.heading }}</span>
</h2>
<hr>
<ul>
{% for contribution in value.contributions %}
<li>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{% load i18n %}
{% load wagtailcore_tags %}

<h2 class="section-title"><i class="{{ value.fa_icon }} mr-3"></i><span>{{ value.heading }}</span></h2>
<h2 class="section-title">
{% if value.fa_icon %}<i class="{{ value.fa_icon }}"></i>{% endif %}
<span>{{ value.heading }}</span>
</h2>
<hr>
{% for education in value.educations %}
{% if education.block_type == "degree" %}
{% with education.value as degree %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
{% load i18n %}
{% load wagtailmarkdown %}

<h2 class="section-title"><i class="{{ value.fa_icon }} mr-3"></i><span>{{ value.heading }}</span></h2>
<h2 class="section-title">
{% if value.fa_icon %}<i class="{{ value.fa_icon }}"></i>{% endif %}
<span>{{ value.heading }}</span>
</h2>
<hr>
{% for experience in value.experiences %}
<span class="work-experience-heading"><b>{{ experience.role }}</b> - <a href="{{ experience.url }}">{{ experience.company }}</a></span>
<a href="{{ experience.url }}">{{ role.experience }}</a>
<p class="date">
{% if experience.location %}
<b>{{ experience.location }},&nbsp;</b>
{% endif %}
<p class="work-experience-heading mb-0"><b>{{ experience.role }} · <a href="{{ experience.url }}">{{ experience.company }}</a></b></p>
{% if experience.location %}
<p class="mt-0 mb-0">
{{ experience.location }}
</p>
{% endif %}
<p class="date mt-0">
{{ experience.from_date }} - {% if experience.currently_working_here %}<b>{% trans "Present" %}</b>{% else %}{{ experience.to_date }}{% endif %}
</p>
<p>
<div style="margin-top: 1.5rem;">
{{ experience.text | markdown }}
</p>
</div>
{% if not forloop.last %}
<hr>
{% endif %}
{% endfor %}
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{% load wagtailcore_tags %}

<h2 class="section-title"><i class="{{ value.fa_icon }} mr-3"></i><span>{{ value.heading }}</span></h2>
<h2 class="section-title">
{% if value.fa_icon %}<i class="{{ value.fa_icon }}"></i>{% endif %}
<span>{{ value.heading }}</span>
</h2>
<hr>
{% for post in value.posts %}
<ul>
<li>
Expand Down
10 changes: 8 additions & 2 deletions wagtail_resume/templates/wagtail_resume/resume_page_body.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<h2 class="name">{{ page.full_name }}</h2>

{% if page.role %}
<h4 class="role">{{ page.role }}</h4>
<h2 class="mt-0 role">{{ page.role }}</h2>
{% endif %}

<div class="social-links">
Expand All @@ -55,7 +55,13 @@ <h4 class="role">{{ page.role }}</h4>
</div>

<div>
<h2 class="section-title"><i class="fas fa-info-circle mr-3"></i><span>{% trans "About" %}</span></h2>
<h2 class="section-title">
{% if page.about_icon %}
<i class="{{ page.about_icon }}"></i>
{% endif %}
<span>{% trans "About" %}</span>
</h2>
<hr>
<p class="about">
{{ page.about | markdown }}
</p>
Expand Down

0 comments on commit 15329ed

Please sign in to comment.