Nenhuma descrição

homeTemplate.html 9.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  1. {% extends 'baseTemplate.html' %}
  2. {% load i18n %}
  3. {% load hashtags %}
  4. {% block title %}{% trans "Counters" %}{% endblock %}
  5. {% block content %}
  6. <div class="text-center">
  7. <h1><a class="counter-link" href="{% url 'home' %}">SeumBook™</a></h1>
  8. </div>
  9. <div class="container-fluid">
  10. <div class="row" id="my-counter">
  11. {# my counter #}
  12. <div class="col-sm-6">
  13. <div class="panel panel-primary">
  14. <div class="panel-heading">
  15. <h2 class="panel-title">
  16. <a class="counter-link panel-title" href="{% url 'counter' id_counter=myCounter.id %}">
  17. <b>{{ myCounter.trigramme }}</b> <small>{{ myCounter.name }}</small>
  18. </a>
  19. {% if not myCounter.lastReset.noSeum %}
  20. <span class="pull-right badge" {% if myCounter.likeCount %} data-toggle="tooltip" data-placement="top" title="{{ myCounter.likersString }}" {% endif %}>
  21. <span class="glyphicon glyphicon-heart"></span>&emsp;{{ myCounter.likeCount }}
  22. </span>
  23. {% endif %}
  24. </h2>
  25. </div>
  26. <div class="primary-counter panel-body" id="container{{myCounter.id}}">
  27. <div style="width:100%;">
  28. {% if myCounter.lastReset.noSeum %}
  29. <strong>{% trans "No seum yet" %}.</strong><br />
  30. {% else %}
  31. <strong>
  32. {% if myCounter.lastReset.selfSeum %}
  33. {% trans "I got the seum" %} {{ myCounter.lastReset.formatted_delta }}.
  34. {% else %}
  35. {{ myCounter.lastReset.who.trigramme }} {% trans "threw me the seum"} {{ myCounter.lastReset.formatted_delta }}.
  36. {% endif %}
  37. </strong><br />
  38. {% endif %}
  39. <p>{{ myCounter.lastReset.reason | hashtag }}</p>
  40. <div class="text-center" id="button{{myCounter.id}}">
  41. <button class="btn btn-default btn-danger" type="button" onclick="revealSeumForm({{myCounter.id}})">
  42. {% trans "Reset the counter" %}
  43. </button>
  44. </div>
  45. {# reset form for my counter #}
  46. <form style="display:none" id="counter{{myCounter.id}}" action="{% url 'reset-counter' %}" method="post">
  47. {% csrf_token %}
  48. <div class="form-group">
  49. <label for="reason">{% trans "Motive of the seum" %}</label>
  50. <input id="reason{{myCounter.id}}" type="text" class="form-control" name="reason"></input>
  51. </div>
  52. <input type="hidden" name="counter" value="{{myCounter.id}}"></input>
  53. <input type="hidden" name="redirect" value="{% url 'home' %}"></input>
  54. <input type="hidden" name="who" value="{{myCounter.id}}"></input>
  55. <div class="text-center">
  56. <button type="submit" class="btn btn-default btn-success">{% trans "I've got the seum" %}</button>
  57. </div>
  58. </form>
  59. </div>
  60. </div>
  61. </div>
  62. </div>
  63. {# QuickSeum #}
  64. <div class="col-sm-6">
  65. <div class="panel panel-primary">
  66. <div class="panel-heading">
  67. <h2 class="panel-title"><b>QuickSeum™</b> <small>{% trans "Break the seum wall" %}</small></h2>
  68. </div>
  69. <div class="primary-counter panel-body">
  70. <form class="form-horizontal" action="{% url 'reset-counter'%}" method="POST" style="width:100%;">
  71. {% csrf_token %}
  72. <div class="form-group">
  73. <label for="id_quicktrigramme" class="col-sm-3 control-label">{% trans "Trigram" %}</label>
  74. <div class="col-sm-9">
  75. <input id="id_quicktrigramme" maxlength="3" type="text" class="form-control text-uppercase" name="trigramme" onkeyup="this.value=this.value.toUpperCase();" required />
  76. </div>
  77. </div>
  78. <div class="form-group">
  79. <label for="id_quickreason" class="col-sm-3 control-label">{% trans "Motive" %}</label>
  80. <div class="col-sm-9">
  81. <input type="text" class="form-control" id="id_quickreason" name="reason" />
  82. </div>
  83. </div>
  84. <div class="form-group">
  85. <div class="col-sm-offset-3 col-sm-9">
  86. <button type="submit" class="btn btn-danger">{% trans "Throw the seum" %}</button>
  87. </div>
  88. </div>
  89. <input type="hidden" name="who" value="{{myCounter.id}}"></input>
  90. <input type="hidden" name="redirect" value="{% url 'home' %}"></input>
  91. </form>
  92. </div>
  93. </div>
  94. </div>
  95. </div>
  96. {# Counters panel #}
  97. <div class="row">
  98. {% for counter in counters %}
  99. <div class="col-md-4 col-sm-6 col-lg-3">
  100. <div class="panel panel-{{counter.CSSclass}}">
  101. <div class="panel-heading">
  102. <form action="{% url 'like' %}" method="POST" name="like{{counter.id}}">
  103. {% csrf_token %}
  104. <input type="hidden" name="liker" value="{{myCounter.id}}" />
  105. <input type="hidden" name="redirect" value="{% url 'home' %}" />
  106. <input type="hidden" name="reset" value="{{counter.lastReset.id}}" />
  107. <h2 class="panel-title">
  108. <a class="counter-link panel-title" href="{% url 'counter' id_counter=counter.id %}">
  109. <b>{{ counter.trigramme }}</b> <small>{{ counter.name }}</small>
  110. </a>
  111. {% if not counter.lastReset.noSeum %}
  112. {% if counter.alreadyLiked %}
  113. <span class="pull-right badge" {% if counter.likeCount > 0 %} data-toggle="tooltip" data-placement="top" title="{{ counter.likersString }}" {% endif %}>
  114. <span class="glyphicon glyphicon-ok"></span>&emsp;{{ counter.likeCount }}
  115. </span>
  116. {% elif counter.id == myCounter.id or counter.lastReset.who.id == myCounter.id %}
  117. <span class="pull-right badge" {% if counter.likeCount > 0 %} data-toggle="tooltip" data-placement="top" title="{{ counter.likersString }}" {% endif %}>
  118. <span class="glyphicon glyphicon-heart"></span>&emsp;{{ counter.likeCount }}
  119. </span>
  120. {% else %}
  121. <a class="pull-right badge" onclick="document.forms['like{{counter.id}}'].submit();">
  122. <span class="glyphicon glyphicon-heart"></span>&emsp;{{ counter.likeCount }}
  123. </a>
  124. {% endif %}
  125. {% endif %}
  126. </h2>
  127. </form>
  128. </div>
  129. <div class="seum-counter panel-body">
  130. {% if counter.lastReset.noSeum %}
  131. <strong>{% trans "Has not got the seum yet" %}</strong><br />
  132. {% else %}
  133. <strong>
  134. {% if counter.lastReset.selfSeum %}
  135. {% trans "Got the seum" %} {{ counter.lastReset.formatted_delta }}.
  136. {% else %}{% blocktrans with trigram=counter.lastReset.who.trigramme time_ago=counter.lastReset.formatted_delta %}Seum thrown by {{ trigram }} {{ time_ago }}.{% endblocktrans %}
  137. {% endif %}
  138. </strong><br />
  139. {% endif %}
  140. <p>{{ counter.lastReset.reason | hashtag }}</p>
  141. </div>
  142. </div>
  143. </div>
  144. {% endfor %}
  145. </div>
  146. {# Graphs #}
  147. <div class="row">
  148. <div class="col-sm-12">
  149. <div class="panel panel-info">
  150. <div class="panel-heading">
  151. <h2 class="panel-title">{% trans "Timeline of the 24h of the seum" %}{# Timeline des 24 heures du seum #}</h2>
  152. </div>
  153. <div class="panel-body timeline graphs">
  154. {% if noTimeline %}
  155. <div class="text-center text-muted">
  156. <p>{% trans "No seum in the last past 24h..." %}</p>
  157. </div>
  158. {% else %}
  159. {{ line_chart.as_html }}
  160. {% endif %}
  161. </div>
  162. </div>
  163. </div>
  164. </div>
  165. <div class="row">
  166. <div class="col-sm-12">
  167. <div class="panel panel-info">
  168. <div class="panel-heading">
  169. <h2 class="panel-title">{% trans "Best seumers" %}</h2>
  170. </div>
  171. <div class="panel-body graphs">
  172. {% if noBestSeum %}
  173. <div class="text-center text-muted">
  174. <p>{% trans "Nobody got the seum..." %}</p>
  175. </div>
  176. {% else %}
  177. {{ best_chart.as_html }}
  178. {% endif %}
  179. </div>
  180. </div>
  181. </div>
  182. </div>
  183. <div class="row">
  184. <div class="col-sm-12">
  185. <div class="panel panel-info">
  186. <div class="panel-heading">
  187. <h2 class="panel-title">{% trans "Most liked seumers" %}</h2>
  188. </div>
  189. <div class="panel-body graphs">
  190. {% if noBestLikees %}
  191. <div class="text-center text-muted">
  192. <p>{% trans "Nobody liked..." %}</p>
  193. </div>
  194. {% else %}
  195. {{ likees_chart.as_html }}
  196. {% endif %}
  197. </div>
  198. </div>
  199. </div>
  200. </div>
  201. <div class="row">
  202. <div class="col-sm-12">
  203. <div class="panel panel-info">
  204. <div class="panel-heading">
  205. <h2 class="panel-title">{% trans "Most popular hashtags" %}</h2>
  206. </div>
  207. <div class="panel-body graphs">
  208. {% if noBestHashtags %}
  209. <div class="text-center text-muted">
  210. <p>{% trans "Nobody used any hashtag..." %}</p>
  211. </div>
  212. {% else %}
  213. {{ hashtags_chart.as_html }}
  214. {% endif %}
  215. </div>
  216. </div>
  217. </div>
  218. </div>
  219. <div class="row">
  220. <div class="col-sm-12">
  221. <div class="panel panel-info">
  222. <div class="panel-heading">
  223. <h2 class="panel-title">{% trans "Best likers of seum" %}</h2>
  224. </div>
  225. <div class="panel-body graphs">
  226. {% if noBestLikers %}
  227. <div class="text-center text-muted">
  228. <p>{% trans "Nobody liked..." %}</p>
  229. </div>
  230. {% else %}
  231. {{ likers_chart.as_html }}
  232. {% endif %}
  233. </div>
  234. </div>
  235. </div>
  236. </div>
  237. <div class="row">
  238. <div class="col-sm-12">
  239. <div class="panel panel-info">
  240. <div class="panel-heading">
  241. <h2 class="panel-title">{% trans "Seum activity" %}</h2>
  242. </div>
  243. <div class="panel-body graphs">
  244. {% if noSeumActivity %}
  245. <div class="text-center text-muted">
  246. <p>{% trans "Nobody got the seum..." %}</p>
  247. </div>
  248. {% else %}
  249. {{ activity_chart.as_html }}
  250. {% endif %}
  251. </div>
  252. </div>
  253. </div>
  254. </div>
  255. </div>
  256. <div class="row text-center">
  257. <a href="{% url 'logout' %}" class="btn btn-danger">{% trans "Logout" %}</a>
  258. <a href="{% url 'password_change' %}" class="btn btn-warning">{% trans "Change password" %}</a>
  259. <a href="{% url 'toggle_email_notifications' %}" class="btn btn-info">
  260. {% if myCounter.email_notifications %}
  261. {% trans "Deactivate email notifications" %}
  262. {% else %}
  263. {% trans "Activate email notifications" %}
  264. {% endif %}
  265. </a>
  266. <a href="{% url 'toggle_sort_score' %}" class="btn btn-success">
  267. {% if myCounter.sort_by_score %}
  268. {% trans "Sort seums by date" %}
  269. {% else %}
  270. {% trans "Sort seums by score" %}
  271. {% endif %}
  272. </a>
  273. </div>
  274. <script>
  275. $(function () {
  276. $('[data-toggle="tooltip"]').tooltip()
  277. })
  278. </script>
  279. {% endblock %}