feat: add Score model
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
ca3ca52ab2
commit
5df8a8b29b
|
@ -0,0 +1,34 @@
|
|||
# Generated by Django 4.2.8 on 2024-02-14 00:36
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("submission", "0072_alter_reviewscore_label"),
|
||||
("pretalx_musicrate", "0008_assignee"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name="Score",
|
||||
fields=[
|
||||
(
|
||||
"id",
|
||||
models.AutoField(
|
||||
auto_created=True, primary_key=True, serialize=False
|
||||
),
|
||||
),
|
||||
("value", models.FloatField()),
|
||||
(
|
||||
"submission",
|
||||
models.OneToOneField(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
to="submission.submission",
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
]
|
|
@ -112,3 +112,8 @@ class Assignee(models.Model):
|
|||
user = models.ForeignKey(
|
||||
"person.User", on_delete=models.CASCADE, related_name="assigned_submissions"
|
||||
)
|
||||
|
||||
|
||||
class Score(models.Model):
|
||||
submission = models.OneToOneField("submission.Submission", on_delete=models.CASCADE)
|
||||
value = models.FloatField()
|
||||
|
|
|
@ -65,8 +65,8 @@
|
|||
<tr>
|
||||
<th>
|
||||
{% translate "Rating" %}
|
||||
<a href="?{% url_replace request 'sort' 'rating' %}"><i class="fa fa-caret-down" title="{% translate "Sort by rating (10-0)" %}"></i></a>
|
||||
<a href="?{% url_replace request 'sort' '-rating' %}"><i class="fa fa-caret-up" title="{% translate "Sort by rating (0-10)" %}"></i></a>
|
||||
<a href="?{% url_replace request 'sort' 'score' %}"><i class="fa fa-caret-down" title="{% translate "Sort by rating (10-0)" %}"></i></a>
|
||||
<a href="?{% url_replace request 'sort' '-score' %}"><i class="fa fa-caret-up" title="{% translate "Sort by rating (0-10)" %}"></i></a>
|
||||
</th>
|
||||
<th>
|
||||
{% translate "Title" %}
|
||||
|
@ -97,8 +97,8 @@
|
|||
{% for submission in submissions %}
|
||||
<tr>
|
||||
<td>
|
||||
{% if submission.rating %}
|
||||
{{ submission.rating.value }}
|
||||
{% if submission.score %}
|
||||
{{ submission.score.value }}
|
||||
{% else %}
|
||||
–
|
||||
{% endif %}
|
||||
|
|
|
@ -479,7 +479,7 @@ class AssigneeView(EventPermissionRequired, FormView, SingleObjectMixin):
|
|||
|
||||
|
||||
class EnhancedSubmissionList(SubmissionList):
|
||||
sortable_fields = ("code", "rating", "title", "state", "assignee")
|
||||
sortable_fields = ("code", "score", "title", "state", "assignee")
|
||||
template_name = "pretalx_musicrate/enhanced_list.html"
|
||||
|
||||
def get_filter_form(self):
|
||||
|
|
Loading…
Reference in New Issue