Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
9b629cb80b | |||
9a06cd81a1 | |||
16534bf41f | |||
11a5738731 |
|
@ -86,7 +86,7 @@ class TalkForm(forms.ModelForm):
|
|||
|
||||
class Meta:
|
||||
model = Talk
|
||||
fields = ('category', 'title', 'description', 'notes', 'materials',)
|
||||
fields = ('category', 'title', 'language', 'description', 'notes', 'materials',)
|
||||
|
||||
|
||||
class TalkStaffForm(forms.ModelForm):
|
||||
|
|
19
cfp/migrations/0028_alter_volunteer_phone_number.py
Normal file
19
cfp/migrations/0028_alter_volunteer_phone_number.py
Normal file
|
@ -0,0 +1,19 @@
|
|||
# Generated by Django 4.1.7 on 2024-02-22 12:43
|
||||
|
||||
import cfp.models
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('cfp', '0027_auto_20200809_1530'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='volunteer',
|
||||
name='phone_number',
|
||||
field=models.CharField(blank=True, default='', max_length=64, validators=[cfp.models.validate_phone_number], verbose_name='Phone number'),
|
||||
),
|
||||
]
|
18
cfp/migrations/0029_talk_language.py
Normal file
18
cfp/migrations/0029_talk_language.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 4.1.7 on 2024-02-22 12:45
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('cfp', '0028_alter_volunteer_phone_number'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='talk',
|
||||
name='language',
|
||||
field=models.CharField(blank=True, max_length=10),
|
||||
),
|
||||
]
|
|
@ -364,6 +364,7 @@ class Talk(PonyConfModel):
|
|||
video = models.URLField(max_length=1000, blank=True, default='', verbose_name='Video URL')
|
||||
token = models.UUIDField(default=uuid.uuid4, editable=False, unique=True)
|
||||
conversation = models.OneToOneField(MessageThread, on_delete=models.PROTECT)
|
||||
language = models.CharField(max_length=10, blank=True)
|
||||
|
||||
objects = TalkManager()
|
||||
|
||||
|
@ -393,7 +394,7 @@ class Talk(PonyConfModel):
|
|||
elif self.accepted is False:
|
||||
return _('Refused')
|
||||
else:
|
||||
return _('Pending decision, score: %(score).1f') % {'score': self.score}
|
||||
return _('Pending decision')
|
||||
|
||||
def get_status_color(self):
|
||||
if self.accepted is True:
|
||||
|
@ -429,6 +430,7 @@ class Talk(PonyConfModel):
|
|||
1 if self.plenary else 0,
|
||||
self.materials,
|
||||
self.video,
|
||||
self.score,
|
||||
]
|
||||
|
||||
@property
|
||||
|
|
|
@ -95,7 +95,20 @@
|
|||
<a class="btn {% if vote == 2 %} active {% endif %}btn-success" href="{% url 'talk-vote' talk.pk 2 %}">+2</a>
|
||||
</div>
|
||||
</p>
|
||||
<p>{{ talk.vote_set.count }} {% trans "vote" %}{{ talk.vote_set.count|pluralize }}, {% trans "average:" %} {{ talk.score|floatformat:1 }}</p>
|
||||
|
||||
<p><button class="btn btn-info" onclick="toggle_votes()">{% trans "Toggle actual votes" %}</button> <span id="actual_votes" class="invisible">{{ talk.vote_set.count }} {% trans "vote" %}{{ talk.vote_set.count|pluralize }}, {% trans "average:" %} {{ talk.score|floatformat:1 }}</span></p>
|
||||
<script>
|
||||
function toggle_votes(){
|
||||
let votes = document.getElementById('actual_votes');
|
||||
if (votes != null) {
|
||||
if (votes.className == "invisible") {
|
||||
votes.className = "visible";
|
||||
} else {
|
||||
votes.className = "invisible";
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<a href="{% url 'talk-accept' talk.pk %}" class="btn btn-success">{% trans "Accept" %}</a>
|
||||
<a href="{% url 'talk-decline' talk.pk %}" class="btn btn-danger">{% trans "Decline" %}</a>
|
||||
|
|
|
@ -55,9 +55,11 @@
|
|||
<th class="text-center">{% trans "Title" %} <a href="?{{ sort_urls.title }}"><span class="glyphicon glyphicon-{{ sort_glyphicons.title }} pull-right"></span></a></th>
|
||||
<th class="text-center">{% trans "Intervention kind" %} <a href="?{{ sort_urls.category }}"><span class="glyphicon glyphicon-{{ sort_glyphicons.category }} pull-right"></span></a></th>
|
||||
<th class="text-center">{% trans "Speakers" %}</th>
|
||||
<th class="text-center">{% trans "Language" %}</th>
|
||||
<th class="text-center">{% trans "Track" %}</th>
|
||||
<th class="text-center">{% trans "Tags" %}</th>
|
||||
<th class="text-center">{% trans "Status" %} <a href="?{{ sort_urls.status }}"><span class="glyphicon glyphicon-{{ sort_glyphicons.status }} pull-right"></span></a></th>
|
||||
<th class="text-center">{% trans "Score" %} <a href="?{{ sort_urls.score }}"><span class="glyphicon glyphicon-{{ sort_glyphicons.score }} pull-right"></span></a></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tfoot>
|
||||
|
@ -82,11 +84,11 @@
|
|||
{% empty %}–
|
||||
{% endfor %}
|
||||
</td>
|
||||
<td>{{ talk.language }}</td>
|
||||
<td>{{ talk.track|default:"–" }}</td>
|
||||
<td>{{ talk.get_tags_html }}</td>
|
||||
<td>
|
||||
{{ talk.get_status_str }}
|
||||
</td>
|
||||
<td>{{ talk.get_status_str }}</td>
|
||||
<td>{{ talk.score }}</td>
|
||||
</tr>
|
||||
{% if forloop.last%}
|
||||
</tbody>
|
||||
|
|
|
@ -730,6 +730,7 @@ def talk_list(request):
|
|||
'title': 'title',
|
||||
'category': 'category',
|
||||
'status': 'accepted',
|
||||
'score': 'score',
|
||||
}
|
||||
sort = request.GET.get('sort')
|
||||
if sort in SORT_MAPPING.keys():
|
||||
|
|
Loading…
Reference in New Issue
Block a user