BioTorrents.de’s version of Gazelle
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.

ratio-watch.twig 2.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <div class="header">
  2. <h2>Ratio Watch</h2>
  3. </div>
  4. {% if users is empty %}
  5. <h2 align="center">There are no users currently on ratio watch ({{ total_disabled|number_format }} are already disabled).</h2>
  6. {% else %}
  7. <div class="box pad thin">
  8. <p>There are currently {{ total|number_format }} enabled users on Ratio Watch and {{ total_disabled|number_format }} already disabled.</p>
  9. </div>
  10. <div class="linkbox">
  11. {{ pages|raw }}
  12. </div>
  13. <table width="100%">
  14. <tr class="colhead">
  15. <td>User</td>
  16. <td class="number_column">Uploaded</td>
  17. <td class="number_column">Downloaded</td>
  18. <td class="number_column">Ratio</td>
  19. <td class="number_column">Required Ratio</td>
  20. <td class="number_column tooltip" title="How much the user needs to upload to meet their required ratio">Deficit</td>
  21. <td class="number_column tooltip" title="How much the user has downloaded on Ratio Watch">Gamble</td>
  22. <td>Registration Date</td>
  23. <td class="tooltip" title="If the time shown here ends in &quot;ago&quot;, it represents how long the user has been on ratio watch and/or below their required ratio. Otherwise, it represents the time until the two week Ratio Watch period expires.">Ratio Watch Ended/Ends</td>
  24. </tr>
  25. {% for u in users %}
  26. <tr class="row{{ cycle(['a', 'b'], loop.index0) }}">
  27. <td>{{ u.user_id|user_full }}</td>
  28. <td class="number_column">{{ u.uploaded|octet_size }}</td>
  29. <td class="number_column">{{ u.downloaded|octet_size }}</td>
  30. <td class="number_column">{{ ratio(u.uploaded, u.downloaded)|raw }}</td>
  31. <td class="number_column">{{ u.required_ration|number_format(2) }}</td>
  32. <td class="number_column">
  33. {%- if u.downloaded * u.required_ratio > u.uploaded -%}
  34. {{ (u.downloaded * u.required_ratio - u.uploaded)|octet_size }}
  35. {%- else -%}
  36. &nbsp;
  37. {%- endif -%}
  38. </td>
  39. <td class="number_column">{{ (u.downloaded - u.ratio_watch_downloaded)|octet_size }}</td>
  40. <td>{{ u.join_date|time_diff }}</td>
  41. <td>{{ u.ratio_watch_ends|time_diff }}</td>
  42. </tr>
  43. {% endfor %}
  44. </table>
  45. <div class="linkbox">
  46. {{ pages|raw }}
  47. </div>
  48. {% endif %}