Skip to content
This repository has been archived by the owner on Jun 4, 2024. It is now read-only.

Commit

Permalink
Add comment and original_name fields to competition
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenvanerk committed Apr 23, 2021
1 parent b29e72b commit fde8325
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lifesaving_rankings/templates/rankings/competition_overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ <h1 class="ui header">{{ competition.name }} results</h1>
<div class="column">
<table class="ui definition compact table">
<tbody>
{% if competition.original_name %}
<tr>
<td>Original name</td>
<td>{{ competition.original_name }}</td>
</tr>
{% endif %}
<tr>
<td>Location</td>
<td>{{ competition.location }}</td>
Expand Down Expand Up @@ -109,6 +115,12 @@ <h1 class="ui header">{{ competition.name }} results</h1>
<td>{{ competition.credit|safe }}</td>
</tr>
{% endif %}
{% if competition.comment %}
<tr>
<td>Comment</td>
<td>{{ competition.comment|safe }}</td>
</tr>
{% endif %}
</tbody>
</table>
</div>
Expand Down
23 changes: 23 additions & 0 deletions rankings/migrations/0061_auto_20210423_1119.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 3.2 on 2021-04-23 09:19

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('rankings', '0060_auto_20210407_2115'),
]

operations = [
migrations.AddField(
model_name='competition',
name='comment',
field=models.CharField(blank=True, max_length=512, null=True),
),
migrations.AddField(
model_name='competition',
name='original_name',
field=models.CharField(blank=True, max_length=256, null=True),
),
]
2 changes: 2 additions & 0 deletions rankings/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ class Meta:
(EXTRA_TIME, 'Extra time competition')
)
name = models.CharField(max_length=100, unique=True, null=True)
original_name = models.CharField(max_length=256, null=True, blank=True)
slug = models.SlugField(null=True, max_length=80)
date = models.DateField()
end_date = models.DateField(null=True, blank=True)
Expand All @@ -254,6 +255,7 @@ class Meta:
status = models.IntegerField(default=IMPORTED, choices=STATUS_OPTIONS)
file_name = models.CharField(max_length=100, null=True, blank=True)
credit = models.CharField(max_length=512, null=True, blank=True)
comment = models.CharField(max_length=512, null=True, blank=True)
participants = models.ManyToManyField(Athlete, through='Participation')

created_at = models.DateTimeField(auto_now_add=True, blank=True, null=True)
Expand Down

0 comments on commit fde8325

Please sign in to comment.