tombola-bde-2020/templates/tombola.html
Yohann D'ANELLO 78e18d6dc1 Backend ended
2020-02-29 12:32:24 +01:00

45 lines
1.2 KiB
HTML

{% extends "base.html" %}
{% load i18n static %}
{% block extracss %}
<meta name="turbolinks-cache-control" content="no-preview">
{% endblock %}
{% block content %}
Old:
{% for reward in old_rewards %}
{{ reward.name }} (won by {{ previous_reward.rewarded_by.note }}, ticket n°{{ previous_reward.rewarded_by.number }})<br />
{% endfor %}
Previous: {{ previous_reward.name }} (won by {{ previous_reward.rewarded_by.note }}, ticket n°{{ previous_reward.rewarded_by.number }})<br />
Current: {{ current_reward.name }}<br />
Next:
{% for reward in next_rewards %}
{{ reward.name }}<br />
{% endfor %}
{% endblock %}
{% block extrajavascript %}
<script>
var reloadWithTurbolinks = (function () {
var scrollPosition
function reload () {
scrollPosition = [window.scrollX, window.scrollY]
Turbolinks.visit(window.location.toString(), { action: 'replace' })
}
document.addEventListener('turbolinks:load', function () {
if (scrollPosition) {
window.scrollTo.apply(window, scrollPosition)
scrollPosition = null
}
})
return reload
})()
setTimeout(function(){ reloadWithTurbolinks(); }, 2000);
</script>
{% endblock %}