Si vous constatez la perte de tickets, de commentaires ou de projets, veuillez consulter la page https://status.framasoft.org/incident/626.

...
 
Commits (3)
......@@ -39,6 +39,7 @@ INSTALLED_APPS = [
'wagtail.admin',
'wagtail.core',
'wagtail.contrib.routable_page',
'wagtail.contrib.modeladmin',
'modelcluster',
'taggit',
......
Django>=2.2,<2.3
wagtail>=2.6,<2.7
wagtailperson>=0.9.7
Django>=2.2,<=3.0
wagtail>=2.6,<=2.8.1
wagtailperson>=0.9.8
# Generated by Django 3.0 on 2020-04-15 15:07
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('wagtailperson', '0006_auto_20200415_1507'),
('wagtailpress', '0008_auto_20191001_1317'),
]
operations = [
migrations.RemoveField(
model_name='blogarticleauthor',
name='person',
),
migrations.AddField(
model_name='blogarticleauthor',
name='author',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='article_authors', to='wagtailperson.Person', verbose_name='Author'),
),
]
......@@ -117,21 +117,22 @@ class BlogArticlePage(Page):
class BlogArticleAuthor(Orderable):
"""A Blog article author, linked to a person page"""
"""A Blog article author, linked to a person"""
page = ParentalKey(
BlogArticlePage,
on_delete=models.CASCADE,
related_name='authors',
)
person = models.ForeignKey(
'wagtailcore.Page',
author = models.ForeignKey(
'wagtailperson.Person',
on_delete=models.CASCADE,
related_name='article_authors',
verbose_name=_('Person page'),
verbose_name=_('Author'),
null=True,
)
panels = [
PageChooserPanel('person', 'wagtailperson.PersonPage'),
FieldPanel('author', 'wagtailperson.Person'),
]
class Meta:
......@@ -139,7 +140,7 @@ class BlogArticleAuthor(Orderable):
verbose_name_plural = _("Blog article authors")
def __str__(self):
return self.person.specific.name
return self.person.name
class BlogIndexPage(RoutablePageMixin, Page):
......@@ -192,7 +193,7 @@ class BlogIndexPage(RoutablePageMixin, Page):
"""Get articles as feed"""
feed = BlogIndexFeed(self)
return feed(request)
@route(r'^tagged/(\w+)/$', name='articles_tagged_as')
def articles_tagged_as_view(self, request, tag=None):
"""View method for the articles tagged as given tag"""
......@@ -219,5 +220,3 @@ class BlogIndexPage(RoutablePageMixin, Page):
context['articles'] = articles
context['tag'] = tag
return context
......@@ -27,7 +27,7 @@
<div>{% blocktrans %}By{% endblocktrans %}</div>
<ul>
{% for article_author in page.authors.all %}
{% with author=article_author.person.specific %}
{% with author=article_author.author %}
<li>{{ author.name }}</li>
{% endwith %}
{% endfor %}
......@@ -66,7 +66,7 @@
</h2>
<ul>
{% for article_author in page.authors.all %}
{% with author=article_author.person.specific %}
{% with author=article_author.author %}
<li>
{% if author.picture %}
<div class="picture">
......
......@@ -67,12 +67,29 @@
<div>{% blocktrans %}By{% endblocktrans %}</div>
<ul>
{% for article_author in article.authors.all %}
{% with author=article_author.person.specific %}
{% with author=article_author.author %}
<li>{{ author.name }}</li>
{% endwith %}
{% endfor %}
</ul>
</div>
<div class="tags">
<div class="tags_label">
{% blocktrans %}Tags{% endblocktrans %}:
</div>
<ul>
{% for tag in article.tags.all %}
<li>
<a class="tag" href="{% routablepageurl page "articles_tagged_as" tag %}">
{{ tag }}
</a>
</li>
{% endfor %}
{% if not article.tags.all %}
<li>{% blocktrans %}No tags{% endblocktrans %}</li>
{% endif %}
</ul>
</div>
</div>
</div>
</div>
......