Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions home/migrations/0056_articlepage.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Generated by Django 3.2.25 on 2025-04-04 09:30

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('wagtailcore', '0069_log_entry_jsonfield'),
('wagtailimages', '0024_index_image_file_hash'),
('home', '0055_enable_use_json_field'),
]

operations = [
migrations.CreateModel(
name='ArticlePage',
fields=[
('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.page')),
('icon', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.image')),
],
options={
'abstract': False,
},
bases=('wagtailcore.page',),
),
]
2 changes: 1 addition & 1 deletion home/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1244,4 +1244,4 @@ def clean(self):
raise ValidationError(_('There is already a main language for this site'))

def __str__(self):
return f'{self.locale}'
return f'{self.locale}'
10 changes: 10 additions & 0 deletions home/templates/home/article.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
{% get_current_language as LANGUAGE_CODE %}

{% block content %}

{% render_image page.image_icon img_class='circular-icon' %}
<article class='article'>
{% render_image page.lead_image img_class='article__lead-img-featured' %}
{% if user_progress %}
Expand Down Expand Up @@ -91,5 +93,13 @@ <h3>{% translate "Related Articles" %}</h3>
h4:focus{
outline: 2px solid black;
}

.circular-icon {
border-radius: 50%;
width: 3rem;
height: 3rem;
object-fit: cover;
margin-bottom: 10px;
}
</style>
{% endblock content %}