The version of vichan running on lainchan.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

146 lines
5.4KB

  1. {% filter remove_whitespace %}
  2. {# Automatically removes unnecessary whitespace #}
  3. <div class="ban">
  4. <iframe width="420" height="315" src="https://www.youtube.com/embed/FXPKJUE86d0" frameborder="0" allowfullscreen></iframe>
  5. {% if ban.expires and time() >= ban.expires %}
  6. <h2>{% trans %}You were banned! ;_;{% endtrans %}</h2>
  7. {% else %}
  8. <h2>{% trans %}You are banned! ;_;{% endtrans %}</h2>
  9. {% endif %}
  10. <p>
  11. {% if ban.expires and time() >= ban.expires %}
  12. {% trans %}You were banned from{% endtrans %}
  13. {% else %}
  14. {% trans %}You have been banned from{% endtrans %}
  15. {% endif %}
  16. {% if ban.board %}
  17. <strong>{{ config.board_abbreviation|sprintf(ban.board) }}</strong>
  18. {% else %}
  19. {% trans %}all boards{% endtrans %}
  20. {% endif %}
  21. {% if ban.reason %}
  22. {% trans %}for the following reason:{% endtrans %}
  23. {% else %}
  24. {% trans %}for an unspecified reason.{% endtrans %}
  25. {% endif %}
  26. </p>
  27. {% if ban.reason %}
  28. <p class="reason">
  29. {{ ban.reason }}
  30. </p>
  31. {% endif %}
  32. <p>
  33. {% trans %}Your ban was filed on{% endtrans %}
  34. <strong>{{ ban.created|date(config.ban_date) }}</strong>
  35. {% if config.show_modname %}
  36. {% if ban.username %}
  37. {% trans %}by{% endtrans %} <strong> {{ ban.username }} </strong>
  38. {% else %}
  39. {% trans %}by{% endtrans %} <em> 'system' </em>
  40. {% endif %}
  41. {% endif %}
  42. {% trans %}and{% endtrans %} <span id="expires">
  43. {% if ban.expires and time() >= ban.expires %}
  44. {% trans %} has since expired. Refresh the page to continue.{% endtrans %}
  45. {% elseif ban.expires %}
  46. {% trans %}expires{% endtrans %} <span id="countdown">{{ ban.expires|until }}</span> {% trans %}from now, which is on{% endtrans %}
  47. <strong>
  48. {{ ban.expires|date(config.ban_date) }}
  49. </strong>
  50. <script>
  51. var secondsLeft = {{ ban.expires - time() }};
  52. var end = new Date().getTime() + secondsLeft*1000;
  53. function updateExpiresTime() {
  54. countdown.firstChild.nodeValue = until(end);
  55. }
  56. function until(end) {
  57. var now = new Date().getTime();
  58. var diff = Math.round((end - now) / 1000);
  59. if (diff < 0) {
  60. document.getElementById("expires").innerHTML = "{% trans %}has since expired. Refresh the page to continue.{% endtrans %}";
  61. clearInterval(int);
  62. return "";
  63. } else if (diff < 60) {
  64. return diff + " second" + (diff == 1 ? "" : "s");
  65. } else if (diff < 60*60) {
  66. return (num = Math.round(diff/(60))) + " minute" + (num == 1 ? "" : "s");
  67. } else if (diff < 60*60*24) {
  68. return (num = Math.round(diff/(60*60))) + " hour" + (num == 1 ? "" : "s");
  69. } else if (diff < 60*60*24*7) {
  70. return (num = Math.round(diff/(60*60*24))) + " day" + (num == 1 ? "" : "s");
  71. } else if (diff < 60*60*24*365) {
  72. return (num = Math.round(diff/(60*60*24*7))) + " week" + (num == 1 ? "" : "s");
  73. } else {
  74. return (num = Math.round(diff/(60*60*24*365))) + " year" + (num == 1 ? "" : "s");
  75. }
  76. }
  77. var countdown = document.getElementById("countdown");
  78. updateExpiresTime();
  79. var int = setInterval(updateExpiresTime, 1000);
  80. </script>
  81. {% else %}
  82. <em>{% trans %}will not expire{% endtrans %}</em>.
  83. {% endif %}
  84. </span>
  85. </p>
  86. <p>{% trans %}Your IP address is{% endtrans %} <strong>{{ ban.ip }}</strong>.</p>
  87. {% if config.ban_page_extra %}
  88. <p>{{ config.ban_page_extra }}</p>
  89. {% endif %}
  90. {% if post and config.ban_show_post %}
  91. <hr>
  92. <p>{% trans %}You were banned for the following post on{% endtrans %} {{ board.url }}:</p>
  93. {{ post }}
  94. <br>
  95. {% endif %}
  96. {% if config.ban_appeals and (not ban.expires or ban.expires - ban.created > config.ban_appeals_min_length )%}
  97. <hr>
  98. {% if pending_appeal %}
  99. <p>
  100. {% trans %}You submitted an appeal for this ban on{% endtrans %}
  101. <strong>{{ pending_appeal|date(config.ban_date) }}</strong>. {% trans %}It is still pending{% endtrans %}.
  102. </p>
  103. {% elseif denied_appeals|length >= config.ban_appeals_max %}
  104. {% if denied_appeals|length == 1 %}
  105. <p>
  106. {% trans %}You appealed this ban on{% endtrans %}
  107. <strong>{{ denied_appeals[0]|date(config.ban_date) }}</strong>
  108. {% trans %}and it was denied. You may not appeal this ban again.{% endtrans %}
  109. </p>
  110. {% else %}
  111. <p>{% trans %}You have submitted the maximum number of ban appeals allowed. You may not appeal this ban again.{% endtrans %}</p>
  112. {% endif %}
  113. {% else %}
  114. {% if denied_appeals|length %}
  115. {% if denied_appeals|length == 1 %}
  116. <p>
  117. {% trans %}You appealed this ban on{% endtrans %}
  118. <strong>{{ denied_appeals[0]|date(config.ban_date) }}</strong>
  119. {% trans %}and it was denied.{% endtrans %}
  120. </p>
  121. <p>{% trans %}You may appeal this ban again. Please enter your reasoning below.{% endtrans %}</p>
  122. {% else %}
  123. <p>
  124. {% trans %}You last appealed this ban on{% endtrans %}
  125. <strong>{{ denied_appeals[denied_appeals|length - 1]|date(config.ban_date) }}</strong>
  126. {% trans %}and it was denied.{% endtrans %}
  127. </p>
  128. <p>{% trans %}You may appeal this ban again. Please enter your reasoning below.{% endtrans %}</p>
  129. {% endif %}
  130. {% else %}
  131. <p>{% trans %}You may appeal this ban. Please enter your reasoning below.{% endtrans %}</p>
  132. {% endif %}
  133. <form class="ban-appeal" action="" method="post">
  134. <input type="hidden" name="ban_id" value="{{ ban.id }}">
  135. <textarea name="appeal" rows="4" cols="40"></textarea>
  136. <input type="submit" value="Submit">
  137. </form>
  138. {% endif %}
  139. {% endif %}
  140. </div>
  141. {% endfilter %}