forked from openlibhums/typesetting
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhooks.py
More file actions
28 lines (21 loc) · 711 Bytes
/
hooks.py
File metadata and controls
28 lines (21 loc) · 711 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from django.template.loader import render_to_string
from plugins.typesetting import models
def author_tasks(context):
request = context['request']
article = context['article']
author_proofing_tasks = models.GalleyProofing.objects.filter(
round__article=article,
round__article__authors=request.user,
proofreader=request.user,
completed__isnull=True,
cancelled=False,
)
if author_proofing_tasks.exists():
return render_to_string(
'typesetting/elements/author_tasks.html',
{
'article': article,
'author_proofing_tasks': author_proofing_tasks,
},
)
return ''