Sen descrición

homeTemplate.html 9.8KB

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