forked from rc/aircox
remove Schedule.end property + fix templates + add accessibility info
This commit is contained in:
parent
9ce2fd228b
commit
9b284c34b3
|
@ -578,10 +578,6 @@ class Schedule(models.Model):
|
||||||
}
|
}
|
||||||
return before == now
|
return before == now
|
||||||
|
|
||||||
@property
|
|
||||||
def end(self):
|
|
||||||
return self.time + utils.to_timedelta(self.duration)
|
|
||||||
|
|
||||||
def match(self, date = None, check_time = True):
|
def match(self, date = None, check_time = True):
|
||||||
"""
|
"""
|
||||||
Return True if the given datetime matches the schedule
|
Return True if the given datetime matches the schedule
|
||||||
|
|
|
@ -12,18 +12,25 @@
|
||||||
<h2>{% trans "Schedule" %}</h2>
|
<h2>{% trans "Schedule" %}</h2>
|
||||||
<ul>
|
<ul>
|
||||||
{% for schedule in page.program.schedule_set.all %}
|
{% for schedule in page.program.schedule_set.all %}
|
||||||
<li>
|
|
||||||
{% with frequency=schedule.get_frequency_display day=schedule.date|date:'l' %}
|
{% with frequency=schedule.get_frequency_display day=schedule.date|date:'l' %}
|
||||||
{% with start=schedule.date|date:"H:i" end=schedule.end|date:"H:i" %}
|
|
||||||
|
{% with start_hour=schedule.time.hour start_minute=schedule.time.minute %}
|
||||||
|
{% with duration_hour=schedule.duration.hour duration_minute=schedule.duration.minute %}
|
||||||
|
<li aria-label="{% blocktrans trimmed %}Diffusion on {{ day }} at {{ start_hour }} hours {{ start_minute }}, on the {{ frequency }}, and last for {{ duration_hour }} hours and {{ duration_minute }} minutes {% endblocktrans %}">
|
||||||
|
{% endwith %}
|
||||||
|
{% endwith %}
|
||||||
|
|
||||||
|
{% with start=schedule.time|date:"H:i" duration=schedule.duration|time:"H\"i" %}
|
||||||
{% blocktrans trimmed %}
|
{% blocktrans trimmed %}
|
||||||
{{ day }} at {{ start }} until {{ end }}, <span class="info">{{ frequency }}</span>
|
{{ day }} at {{ start }} ({{ duration }}), <span class="info">{{ frequency }}</span>
|
||||||
{% endblocktrans %}
|
{% endblocktrans %}
|
||||||
{% endwith %}
|
|
||||||
{% endwith %}
|
|
||||||
{% if schedule.initial %}
|
{% if schedule.initial %}
|
||||||
<span class="info">{% trans "Rerun" %}</span>
|
<span class="info">{% trans "Rerun" %}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% endwith %}
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
{% endwith %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user