|
|
@@ -3,44 +3,101 @@
|
|
3
|
3
|
<h1>SeumBook™</h1>
|
|
4
|
4
|
</div>
|
|
5
|
5
|
<div class="container-fluid">
|
|
6
|
|
- <div class="row">
|
|
7
|
|
- {% for counter in counters %}
|
|
8
|
|
- <div class="col-md-4 col-sm-6 col-lg-3">
|
|
9
|
|
- <div class="panel panel-{{counter.CSSclass}}" style="opacity:{{counter.opacity}}">
|
|
|
6
|
+ {% if chooseCounter %}
|
|
|
7
|
+ <div class="row" id="my-counter">
|
|
|
8
|
+ <div class="col-sm-12">
|
|
|
9
|
+ <div class="panel panel-warning">
|
|
10
|
10
|
<div class="panel-heading">
|
|
11
|
|
- <a class="counter-link" href="{% url 'counter' id_counter=counter.id %}">
|
|
12
|
|
- <h2 class="panel-title">{{ counter.trigramme }} <small>{{ counter.name }}</small>
|
|
13
|
|
- {% if not counter.lastReset.noSeum %}<span class="pull-right badge">{{ counter.seumCount }}</span>{% endif %}
|
|
|
11
|
+ <h2 class="panel-title">Mon compteur</h2>
|
|
|
12
|
+ </div>
|
|
|
13
|
+ <div class="panel-body">
|
|
|
14
|
+ <p>Choisis ton compteur pour qu'il apparaisse en haut de la liste quand tu reviendras sur le site !</p>
|
|
|
15
|
+ <form action="{% url 'set-my-counter'%}" method="post">
|
|
|
16
|
+ {% csrf_token %}
|
|
|
17
|
+ <div class="form-group">
|
|
|
18
|
+ <label for="myCounterSelect">Mon trigramme:</label>
|
|
|
19
|
+ <select class="form-control" name="myCounter">
|
|
|
20
|
+ {% for counter in counters %}
|
|
|
21
|
+ <option value="{{ counter.id }}">{{ counter.trigramme }} ({{ counter.name }})</option>
|
|
|
22
|
+ {% endfor %}
|
|
|
23
|
+ </select>
|
|
|
24
|
+ </div>
|
|
|
25
|
+ <input type="hidden" name="redirect" value="{% url 'home' %}"></input>
|
|
|
26
|
+ <div class="text-center">
|
|
|
27
|
+ <button type="submit" class="btn btn-default btn-success">Définir mon compteur</button>
|
|
|
28
|
+ </div>
|
|
|
29
|
+ </form>
|
|
|
30
|
+ </div>
|
|
|
31
|
+ </div>
|
|
|
32
|
+ </div>
|
|
|
33
|
+ </div>
|
|
|
34
|
+ {% else %}
|
|
|
35
|
+ <div class="row" id="my-counter">
|
|
|
36
|
+ <div class="col-sm-12">
|
|
|
37
|
+ <div class="panel panel-warning">
|
|
|
38
|
+ <div class="panel-heading">
|
|
|
39
|
+ <a class="counter-link" href="{% url 'counter' id_counter=myCounter.id %}">
|
|
|
40
|
+ <h2 class="panel-title">{{ myCounter.trigramme }} <small>{{ myCounter.name }}</small>
|
|
|
41
|
+ {% if not myCounter.lastReset.noSeum %}<span class="pull-right badge">{{ myCounter.seumCount }}</span>{% endif %}
|
|
14
|
42
|
</h2>
|
|
15
|
43
|
</a>
|
|
16
|
44
|
</div>
|
|
17
|
|
- <div class="seum-counter panel-body">
|
|
18
|
|
- {% if counter.lastReset.noSeum %}
|
|
|
45
|
+ <div class="seum-counter panel-body" id="container{{myCounter.id}}" style="height:125px">
|
|
|
46
|
+ {% if myCounter.lastReset.noSeum %}
|
|
19
|
47
|
<strong>N'a pas encore eu le seum.</strong>
|
|
20
|
48
|
<br> {% else %}
|
|
21
|
|
- <strong>N'a pas eu le seum depuis {{ counter.lastReset.formatted_delta }}.</strong>
|
|
|
49
|
+ <strong>Je n'ai pas eu le seum depuis {{ myCounter.lastReset.formatted_delta }}.</strong>
|
|
22
|
50
|
<br> {% endif %}
|
|
23
|
51
|
|
|
24
|
|
- <p>{{ counter.lastReset.reason }}</p>
|
|
25
|
|
- <div class="text-center">
|
|
26
|
|
- <button id="button{{counter.id}}" class="btn btn-default btn-danger" type="button" onclick="getElementById('counter{{counter.id}}').style.display='inline';getElementById('button{{counter.id}}').style.display='none';">Remettre à zéro</button>
|
|
|
52
|
+ <p>{{ myCounter.lastReset.reason }}</p>
|
|
|
53
|
+ <div class="text-center" id="button{{myCounter.id}}">
|
|
|
54
|
+ <form action="{% url 'reset-my-counter' %}" method="post">
|
|
|
55
|
+ {% csrf_token %}
|
|
|
56
|
+ <button class="btn btn-default btn-danger" type="button" onclick="getElementById('counter{{myCounter.id}}').style.display='inline';getElementById('button{{myCounter.id}}').style.display='none';getElementById('container{{myCounter.id}}').style.height='225px';">Remettre à zéro</button>
|
|
|
57
|
+ <input type="hidden" name="redirect" value="{% url 'home' %}"></input>
|
|
|
58
|
+ <button type="submit" class="btn btn-default">Changer mon compteur</button>
|
|
|
59
|
+ </form>
|
|
27
|
60
|
</div>
|
|
28
|
|
- <form style="display:none" id="counter{{counter.id}}" action="{% url 'reset-counter' %}" method="post">
|
|
|
61
|
+ <form style="display:none" id="counter{{myCounter.id}}" action="{% url 'reset-counter' %}" method="post">
|
|
29
|
62
|
{% csrf_token %}
|
|
30
|
63
|
<div class="form-group">
|
|
31
|
64
|
<label for="reason">Motif du seum :</label>
|
|
32
|
65
|
<textarea class="form-control" name="reason"></textarea>
|
|
33
|
66
|
</div>
|
|
34
|
|
- <input type="hidden" name="counter" value="{{counter.id}}"></input>
|
|
|
67
|
+ <input type="hidden" name="counter" value="{{myCounter.id}}"></input>
|
|
35
|
68
|
<input type="hidden" name="redirect" value="{% url 'home' %}"></input>
|
|
36
|
69
|
<div class="text-center">
|
|
37
|
|
- <button type="submit" class="btn btn-default btn-success">Foutre le seum</button>
|
|
|
70
|
+ <button type="submit" class="btn btn-default btn-success">J'ai le seum</button>
|
|
38
|
71
|
</div>
|
|
39
|
72
|
</form>
|
|
40
|
73
|
</div>
|
|
41
|
74
|
</div>
|
|
42
|
75
|
</div>
|
|
43
|
|
- {% endfor %}
|
|
|
76
|
+ </div>
|
|
|
77
|
+ {% endif %}
|
|
|
78
|
+ <div class="row">
|
|
|
79
|
+ {% for counter in counters %} {% if chooseCounter or not counter.id == myCounter.id %}
|
|
|
80
|
+ <div class="col-md-4 col-sm-6 col-lg-3">
|
|
|
81
|
+ <div class="panel panel-{{counter.CSSclass}}" style="opacity:{{counter.opacity}}">
|
|
|
82
|
+ <div class="panel-heading">
|
|
|
83
|
+ <a class="counter-link" href="{% url 'counter' id_counter=counter.id %}">
|
|
|
84
|
+ <h2 class="panel-title">{{ counter.trigramme }} <small>{{ counter.name }}</small>
|
|
|
85
|
+ {% if not counter.lastReset.noSeum %}<span class="pull-right badge">{{ counter.seumCount }}</span>{% endif %}
|
|
|
86
|
+ </h2>
|
|
|
87
|
+ </a>
|
|
|
88
|
+ </div>
|
|
|
89
|
+ <div class="seum-counter panel-body">
|
|
|
90
|
+ {% if counter.lastReset.noSeum %}
|
|
|
91
|
+ <strong>N'a pas encore eu le seum.</strong>
|
|
|
92
|
+ <br> {% else %}
|
|
|
93
|
+ <strong>N'a pas eu le seum depuis {{ counter.lastReset.formatted_delta }}.</strong>
|
|
|
94
|
+ <br> {% endif %}
|
|
|
95
|
+
|
|
|
96
|
+ <p>{{ counter.lastReset.reason }}</p>
|
|
|
97
|
+ </div>
|
|
|
98
|
+ </div>
|
|
|
99
|
+ </div>
|
|
|
100
|
+ {% endif %} {% endfor %}
|
|
44
|
101
|
</div>
|
|
45
|
102
|
<div class="row">
|
|
46
|
103
|
<div class="col-sm-12">
|