Added project owner
This commit is contained in:
parent
404590766a
commit
ad0db64f3c
18
interface/migrations/0019_project_owner.py
Normal file
18
interface/migrations/0019_project_owner.py
Normal 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),
|
||||
),
|
||||
]
|
||||
@ -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):
|
||||
|
||||
@ -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 %}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user