Skip to content
Draft
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
19 changes: 19 additions & 0 deletions core/migrations/0038_contributor_title.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Generated by Django 2.2.10 on 2021-10-12 20:58

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('core', '0037_auto_20200326_1525'),
]

operations = [
migrations.AddField(
model_name='contributor',
name='title',
field=models.CharField(default='person', max_length=255),
preserve_default=False,
),
]
1 change: 1 addition & 0 deletions core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class StaticPage(Page):
@register_snippet
class Contributor(index.Indexed, models.Model):
name = models.CharField(max_length=255)
title = models.CharField(max_length=255)
rich_name = RichTextField(
features=["italic"], max_length=255, null=True, blank=True
)
Expand Down
4 changes: 2 additions & 2 deletions core/templates/core/article_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ <h4 class="article-subdeck mb-4">{{ page.subdeck|richtext_unwrapped }}</h4>
By {% for author in authors %}
{% if forloop.last and authors|length > 1 %} and {% endif %}
{% if author.staff_page %}
<a class="author-name" href="{% pageurl author.staff_page %}">{{ author.staff_page.name }}</a>{% if not forloop.last and authors|length > 2 %}, {% endif %}
<a class="author-name" href="{% pageurl author.staff_page %}">{{ author.staff_page.name }} ({{ author.title }})</a>{% if not forloop.last and authors|length > 2 %}, {% endif %}
{% else %}
<span class="author-name">{% firstof author.rich_name|richtext_unwrapped author.name %}</span>{% if not forloop.last and authors|length > 2 %}, {% endif %}
<span class="author-name">{% firstof author.rich_name|richtext_unwrapped author.name %} ({{ author.title }})</span>{% if not forloop.last and authors|length > 2 %}, {% endif %}
{% endif %}
{% endfor %}
</span>
Expand Down
21 changes: 21 additions & 0 deletions home/migrations/0005_auto_20211012_2058.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Generated by Django 2.2.10 on 2021-10-12 20:58

from django.db import migrations
import wagtail.core.blocks
import wagtail.core.fields
import wagtail.images.blocks


class Migration(migrations.Migration):

dependencies = [
('home', '0004_auto_20191106_0215'),
]

operations = [
migrations.AlterField(
model_name='homepage',
name='featured_articles',
field=wagtail.core.fields.StreamField([('one_column', wagtail.core.blocks.StructBlock([('column', wagtail.core.blocks.StructBlock([('article', wagtail.core.blocks.PageChooserBlock(page_type=['core.ArticlePage'])), ('headline', wagtail.core.blocks.RichTextBlock(help_text="Optional. Will override the article's headline.", required=False)), ('image', wagtail.images.blocks.ImageChooserBlock(help_text='Optional. Ovverides the image on the post.', required=False))]))])), ('one_ad_column', wagtail.core.blocks.StructBlock([('image', wagtail.images.blocks.ImageChooserBlock(help_text='Image should be 22:7')), ('link', wagtail.core.blocks.URLBlock(label='target', required=False))])), ('two_columns', wagtail.core.blocks.StructBlock([('left_column', wagtail.core.blocks.StructBlock([('article', wagtail.core.blocks.PageChooserBlock(page_type=['core.ArticlePage'])), ('headline', wagtail.core.blocks.RichTextBlock(help_text="Optional. Will override the article's headline.", required=False)), ('image', wagtail.images.blocks.ImageChooserBlock(help_text='Optional. Ovverides the image on the post.', required=False))])), ('right_column', wagtail.core.blocks.StructBlock([('article', wagtail.core.blocks.PageChooserBlock(page_type=['core.ArticlePage'])), ('headline', wagtail.core.blocks.RichTextBlock(help_text="Optional. Will override the article's headline.", required=False)), ('image', wagtail.images.blocks.ImageChooserBlock(help_text='Optional. Ovverides the image on the post.', required=False))])), ('emphasize_column', wagtail.core.blocks.ChoiceBlock(choices=[('left', 'Left'), ('right', 'Right')], help_text='Which article, if either, should appear larger.', required=False))])), ('three_columns', wagtail.core.blocks.StructBlock([('left_column', wagtail.core.blocks.StructBlock([('article', wagtail.core.blocks.PageChooserBlock(page_type=['core.ArticlePage'])), ('headline', wagtail.core.blocks.RichTextBlock(help_text="Optional. Will override the article's headline.", required=False)), ('image', wagtail.images.blocks.ImageChooserBlock(help_text='Optional. Ovverides the image on the post.', required=False))])), ('middle_column', wagtail.core.blocks.StructBlock([('article', wagtail.core.blocks.PageChooserBlock(page_type=['core.ArticlePage'])), ('headline', wagtail.core.blocks.RichTextBlock(help_text="Optional. Will override the article's headline.", required=False)), ('image', wagtail.images.blocks.ImageChooserBlock(help_text='Optional. Ovverides the image on the post.', required=False))])), ('right_column', wagtail.core.blocks.StructBlock([('article', wagtail.core.blocks.PageChooserBlock(page_type=['core.ArticlePage'])), ('headline', wagtail.core.blocks.RichTextBlock(help_text="Optional. Will override the article's headline.", required=False)), ('image', wagtail.images.blocks.ImageChooserBlock(help_text='Optional. Ovverides the image on the post.', required=False))]))])), ('recent_articles', wagtail.core.blocks.StructBlock([('num_articles', wagtail.core.blocks.IntegerBlock(help_text='Number of recent articles to display.', label='Number of articles'))])), ('marquee_banner', wagtail.core.blocks.StructBlock([('body', wagtail.core.blocks.RichTextBlock(required=True)), ('banner_type', wagtail.core.blocks.ChoiceBlock(choices=[('moves', 'Rotating')], help_text='Determines whether the marquee banner is stationary or rotating. Only rotating works right now.'))]))], null=True),
),
]