Нема описа

homeTemplate.html 9.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  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 "Has not got the 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" %}
  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 "Has got the seum" %} {{ counter.lastReset.formatted_delta }}.
  136. {% else %}
  137. {{ counter.lastReset.who.trigramme }} {% trans "threw him/her the seum" %} {{ counter.lastReset.formatted_delta }}.
  138. {% endif %}
  139. </strong><br />
  140. {% endif %}
  141. <p>{{ counter.lastReset.reason | hashtag }}</p>
  142. </div>
  143. </div>
  144. </div>
  145. {% endfor %}
  146. </div>
  147. {# Graphs #}
  148. <div class="row">
  149. <div class="col-sm-12">
  150. <div class="panel panel-info">
  151. <div class="panel-heading">
  152. <h2 class="panel-title">{% trans "Timeline of the 24h of the seum" %}{# Timeline des 24 heures du seum #}</h2>
  153. </div>
  154. <div class="panel-body timeline graphs">
  155. {% if noTimeline %}
  156. <div class="text-center text-muted">
  157. <p>{% trans "No seum in the last past 24h..." %}</p>
  158. </div>
  159. {% else %}
  160. {{ line_chart.as_html }}
  161. {% endif %}
  162. </div>
  163. </div>
  164. </div>
  165. </div>
  166. <div class="row">
  167. <div class="col-sm-12">
  168. <div class="panel panel-info">
  169. <div class="panel-heading">
  170. <h2 class="panel-title">{% trans "Best seumers" %}</h2>
  171. </div>
  172. <div class="panel-body graphs">
  173. {% if noBestSeum %}
  174. <div class="text-center text-muted">
  175. <p>{% trans "Nobody has got the seum..." %}</p>
  176. </div>
  177. {% else %}
  178. {{ best_chart.as_html }}
  179. {% endif %}
  180. </div>
  181. </div>
  182. </div>
  183. </div>
  184. <div class="row">
  185. <div class="col-sm-12">
  186. <div class="panel panel-info">
  187. <div class="panel-heading">
  188. <h2 class="panel-title">{% trans "Most liked seumers" %}</h2>
  189. </div>
  190. <div class="panel-body graphs">
  191. {% if noBestLikees %}
  192. <div class="text-center text-muted">
  193. <p>{% trans "Nobody liked..." %}</p>
  194. </div>
  195. {% else %}
  196. {{ likees_chart.as_html }}
  197. {% endif %}
  198. </div>
  199. </div>
  200. </div>
  201. </div>
  202. <div class="row">
  203. <div class="col-sm-12">
  204. <div class="panel panel-info">
  205. <div class="panel-heading">
  206. <h2 class="panel-title">{% trans "Most popular hashtags" %}</h2>
  207. </div>
  208. <div class="panel-body graphs">
  209. {% if noBestHashtags %}
  210. <div class="text-center text-muted">
  211. <p>{% trans "Nobody used any hashtag..." %}</p>
  212. </div>
  213. {% else %}
  214. {{ hashtags_chart.as_html }}
  215. {% endif %}
  216. </div>
  217. </div>
  218. </div>
  219. </div>
  220. <div class="row">
  221. <div class="col-sm-12">
  222. <div class="panel panel-info">
  223. <div class="panel-heading">
  224. <h2 class="panel-title">{% trans "Best likers of seum" %}</h2>
  225. </div>
  226. <div class="panel-body graphs">
  227. {% if noBestLikers %}
  228. <div class="text-center text-muted">
  229. <p>{% trans "Nobody liked..." %}</p>
  230. </div>
  231. {% else %}
  232. {{ likers_chart.as_html }}
  233. {% endif %}
  234. </div>
  235. </div>
  236. </div>
  237. </div>
  238. <div class="row">
  239. <div class="col-sm-12">
  240. <div class="panel panel-info">
  241. <div class="panel-heading">
  242. <h2 class="panel-title">{% trans "Seum activity" %}</h2>
  243. </div>
  244. <div class="panel-body graphs">
  245. {% if noSeumActivity %}
  246. <div class="text-center text-muted">
  247. <p>{% trans "Nobody has got the seum..." %}</p>
  248. </div>
  249. {% else %}
  250. {{ activity_chart.as_html }}
  251. {% endif %}
  252. </div>
  253. </div>
  254. </div>
  255. </div>
  256. </div>
  257. <div class="row text-center">
  258. <a href="{% url 'logout' %}" class="btn btn-danger">{% trans "Logout" %}</a>
  259. <a href="{% url 'password_change' %}" class="btn btn-warning">{% trans "Change password" %}</a>
  260. <a href="{% url 'toggle_email_notifications' %}" class="btn btn-info">
  261. {% if myCounter.email_notifications %}
  262. {% trans "Deactivate email notifications" %}
  263. {% else %}
  264. {% trans "Activate email notifications" %}
  265. {% endif %}
  266. </a>
  267. <a href="{% url 'toggle_sort_score' %}" class="btn btn-success">
  268. {% if myCounter.sort_by_score %}
  269. {% trans "Sort seums by date" %}
  270. {% else %}
  271. {% trans "Sort seums by score" %}
  272. {% endif %}
  273. </a>
  274. </div>
  275. <script>
  276. $(function () {
  277. $('[data-toggle="tooltip"]').tooltip()
  278. })
  279. </script>
  280. {% endblock %}