tombola-bde-2020/templates/tombola.html

83 lines
2.8 KiB
HTML
Raw Normal View History

2020-02-29 10:39:42 +00:00
{% extends "base.html" %}
{% load i18n static %}
2020-02-29 10:57:19 +00:00
{% block extracss %}
<meta name="turbolinks-cache-control" content="no-preview">
{% endblock %}
2020-02-29 10:39:42 +00:00
2020-03-02 19:33:24 +00:00
{% block contenttitle %}
<h1>
<img style="width: 200px;" src="https://perso.crans.org/ynerant/Saperlistpopette.jpeg" />
Tombola Saper[list]popette <span style="color: red;"></span>️♠️<span style="color: red;"></span>️♣
</h1>
{% endblock %}
2020-02-29 10:39:42 +00:00
{% block content %}
2020-03-02 19:43:17 +00:00
<div style="width: 100%;">
<div class="alert alert-danger" style="width: 17%; float: left; margin: 0.5%;">
<h3>Lots déjà offerts :</h3>
2020-02-29 12:04:03 +00:00
<ul>
{% for reward in old_rewards %}
<li><strong>{{ reward.name }} :</strong> remporté par {{ reward.rewarded_by.note }} (ticket n° {{ reward.rewarded_by.number }})</li>
{% endfor %}
</ul>
</div>
2020-03-02 19:43:17 +00:00
<div class="alert alert-warning" style="width: 31%; float: left; margin: 0.5%;">
<h3>Lot précédent :</h3><br />
{% if previous_reward %}
<strong>&bullet; {{ previous_reward.name }} :</strong> remporté par {{ previous_reward.rewarded_by.note }}
(ticket n° {{ previous_reward.rewarded_by.number }})<br />
{% else %}
<h5>&bullet; <img src="https://cdn.pixabay.com/photo/2012/04/16/13/51/triangle-36068_960_720.png" style="height: 24px;" /> Aucun lot n'a encore été remporté.</h5>
{% endif %}
2020-02-29 12:04:03 +00:00
<img src="{{ previous_reward.image.url }}" alt="{{ previous_reward.name }}" style="width: 100%;" />
</div>
2020-03-02 19:43:17 +00:00
<div class="alert alert-info" style="width: 31%; float: left; margin: 0.5%;">
<h3>Lot suivant :</h3><br />
{% if current_reward %}
<h5>&bullet; {{ current_reward.name }}</h5><br />
<img src="{{ current_reward.image.url }}" alt="{{ previous_reward.name }}" style="width: 100%;" />
{% else %}
<h5>&bullet; <img src="https://cdn.pixabay.com/photo/2012/04/16/13/51/triangle-36068_960_720.png" style="height: 24px;" /> Tous les lots ont déjà été distribués !</h5>
{% endif %}
2020-02-29 12:04:03 +00:00
</div>
2020-03-02 19:43:17 +00:00
<div class="alert alert-success" style="width: 17%; float: left; margin: 0.5%;">
<h3>Lots à venir :</h3>
2020-02-29 12:04:03 +00:00
<ul>
{% for reward in next_rewards %}
<li><strong>{{ reward.name }}</strong></li>
{% endfor %}
</ul>
</div>
</div>
2020-02-29 10:39:42 +00:00
{% endblock %}
2020-02-29 10:57:19 +00:00
{% 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 %}