Нема описа

counterTemplate.html 5.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. {% extends 'baseTemplate.html' %}
  2. {% block title %}{{counter.trigramme}}{% endblock %}
  3. {% block content %}
  4. {% load i18n %}
  5. {% load hashtags %}
  6. <div class="text-center">
  7. <h1>
  8. <a class="counter-link" href="{% url 'home' %}"><b>{{ counter.trigramme }}</b> <small>{{ counter.name }}</small></a>
  9. </h1>
  10. </div>
  11. <div class="container-fluid">
  12. <div class="row">
  13. <div class="col-md-3">
  14. <div class="panel panel-primary">
  15. <div class="panel-heading">
  16. <form action="{% url 'like' %}" method="POST" name="like{{counter.id}}">
  17. {% csrf_token %}
  18. <input type="hidden" name="liker" value="{{myCounter.id}}" />
  19. <input type="hidden" name="reset" value="{{counter.lastReset.id}}" <h2 class="panel-title" />
  20. <input type="hidden" name="redirect" value="{% url 'counter' id_counter=counter.id %}" />
  21. <a class="counter-link" href="{% url 'counter' id_counter=counter.id %}">
  22. <b>{{ counter.trigramme }}</b> <small>{{ counter.name }}</small>
  23. </a>
  24. {% if not counter.lastReset.noSeum %}
  25. {% if counter.alreadyLiked %}
  26. <span class="pull-right badge" {% if counter.likes_count > 0 %} data-toggle="tooltip" data-placement="top" title="{{ counter.likersString }}" {% endif %}>
  27. <span class="glyphicon glyphicon-ok"></span>&emsp;{{ counter.likes_count }}
  28. </span>
  29. {% elif counter.id == myCounter.id or counter.lastReset.who.id == myCounter.id %}
  30. <span class="pull-right badge" {% if counter.likes_count > 0 %} data-toggle="tooltip" data-placement="top" title="{{ counter.likersString }}" {% endif %}>
  31. <span class="glyphicon glyphicon-heart"></span>&emsp;{{ counter.likes_count }}
  32. </span>
  33. {% else %}
  34. <a class="pull-right badge" onclick="document.forms['like{{counter.id}}'].submit();">
  35. <span class="glyphicon glyphicon-heart"></span>&emsp;{{ counter.likes_count }}
  36. </a>
  37. {% endif %}
  38. {% endif %}
  39. </h2>
  40. </form>
  41. </div>
  42. <div class="seum-counter panel-body" style="height:125px" id="container{{counter.id}}">
  43. {% if counter.lastReset.noSeum %}
  44. <strong>{% trans "No seum yet" %}.</strong><br />
  45. {% else %}
  46. <strong>
  47. {% if counter.lastReset.selfSeum %}
  48. {% trans "Got the seum" %} {{ counter.lastReset.formatted_delta }}.
  49. {% else %}{% blocktrans with trigram=counter.lastReset.who.trigramme time_ago=counter.lastReset.formatted_delta %}Seum thrown by {{ trigram }} {{ time_ago }}.{% endblocktrans %}
  50. {% endif %}
  51. </strong><br />
  52. {% endif %}
  53. <p>{{ counter.lastReset.reason | hashtag }}</p>
  54. <div class="text-center">
  55. <button id="button{{counter.id}}" class="btn btn-default btn-danger" type="button" onclick="revealSeumForm({{counter.id}})">
  56. {% trans "Reset the counter" %}
  57. </button>
  58. </div>
  59. <form style="display:none" id="counter{{counter.id}}" action="{% url 'reset-counter' %}" method="post">
  60. {% csrf_token %}
  61. <div class="form-group">
  62. <label for="reason">{% trans "Motive for the seum:" %}</label>
  63. <input id="reason{{counter.id}}" type="text" class="form-control" name="reason"></input>
  64. </div>
  65. <input type="hidden" name="counter" value="{{counter.id}}"></input>
  66. <input type="hidden" name="redirect" value="{% url 'counter' id_counter=counter.id %}"></input>
  67. <input type="hidden" name="who" value="{{myCounter.id}}"></input>
  68. <div class="text-center">
  69. <button type="submit" class="btn btn-default btn-success">{% trans "Throw the seum" %}</button>
  70. </div>
  71. </form>
  72. </div>
  73. </div>
  74. </div>
  75. <div class="col-md-9">
  76. <div class="panel panel-info">
  77. <div class="panel-heading">
  78. <h2 class="panel-title">{% trans "Timeline of the seum" %}</h2>
  79. </div>
  80. <div class="graphs timeline panel-body">
  81. {% if counter.lastReset.noSeum %}
  82. <div class="text-center text-muted">
  83. <p>{% trans "No timeline of the seum yet..." %}</p>
  84. </div>
  85. {% else %}
  86. {{ chart.as_html }}
  87. {% endif %}
  88. </div>
  89. </div>
  90. </div>
  91. </div>
  92. <div class="row">
  93. <div class="col-sm-12">
  94. <div class="panel panel-default">
  95. <div class="panel-heading">
  96. <h2 class="panel-title">
  97. {% trans "Seum history" %}
  98. <small class="badge pull-right">{{ seumFrequency }}/seum</small>
  99. </h2>
  100. </div>
  101. <div class="panel-body">
  102. <table class="table table-striped">
  103. <thead>
  104. <tr>
  105. <th>{% trans "Date" %}</th>
  106. <th>{% trans "Motive" %}</th>
  107. <th>{% trans "Seum thrower" %}</th>
  108. <th>{% trans "Number of likes" %}</th>
  109. </tr>
  110. </thead>
  111. <tbody>
  112. {% for reset in resets %}
  113. <tr>
  114. <td><b>{{ reset.date | date:"SHORT_DATETIME_FORMAT" }}</b></td>
  115. <td>{{ reset.reason | hashtag }}</td>
  116. <td>
  117. {% if not reset.selfSeum %}
  118. {{ reset.who.trigramme }}
  119. {% endif %}
  120. </td>
  121. <td>{{ reset.likes_count }}</td>
  122. </tr>
  123. {% endfor %}
  124. </tbody>
  125. </table>
  126. </div>
  127. </div>
  128. </div>
  129. </div>
  130. </div>
  131. <div class="row">
  132. <div class="text-center">
  133. <a class="btn btn-success" href="{% url 'home' %}">{% trans "Back to counters list" %}</a>
  134. </div>
  135. </div>
  136. </div>
  137. {% endblock %}