Added project owner

This commit is contained in:
Tris 2020-10-03 19:39:45 +10:00
parent 404590766a
commit ad0db64f3c
3 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,18 @@
# Generated by Django 3.1.1 on 2020-10-03 09:28
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('interface', '0018_auto_20200914_1009'),
]
operations = [
migrations.AddField(
model_name='project',
name='owner',
field=models.CharField(blank=True, max_length=255),
),
]

View File

@ -46,6 +46,7 @@ class Project(models.Model):
ensemble = models.ForeignKey(Ensemble, related_name='projects', on_delete=models.CASCADE, null=True)
active = models.BooleanField(default=True)
deadline =models.DateField(null=True, blank=True)
owner = models.CharField(max_length=255, blank=True)
@property
def submissions(self):

View File

@ -3,6 +3,9 @@
{% block page %}
<div class="narrow">
<h3 class="text-center">Due in {{ project.deadline|timeuntil }}!</h3>
{% if project.owner %}
<p>Project email: <a href="mailto:{{ project.owner }}">{{ project.owner }}</a></p>
{% endif %}
{% with sub_count=project.submissions.count %}
<p>There have been {{ sub_count }} submission{{ sub_count|pluralize }} so far...</p>
{% if sub_count %}