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.

bonus-history.twig 3.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <div class="header">
  2. <h2>{{ header|raw }}</h2>
  3. </div>
  4. <div class="linkbox">
  5. <a href="wiki.php?action=article&amp;name=bonuspoints" class="brackets">About Bonus Points</a>
  6. <a href="bonus.php" class="brackets">Bonus Point Shop</a>
  7. <a href="bonus.php?action=bprates{% if is_admin and not self %}&amp;userid={{ user_id }}{% endif %}" class="brackets">Bonus Point Rates</a>
  8. </div>
  9. <div class="thin">
  10. {% if paginator.offset == 0 %}
  11. <div class="pad box">
  12. {% if pool_total %}
  13. {% for p in pool_summary %}
  14. <p>{{ who_spent|raw }} {{ p.total|number_format }} bonus points to donate to the {{ p.name }}
  15. {% if now > p.until_date|date('U') %}ended{% else %}ending in{% endif %}
  16. {{ p.until_date|time_diff }}.</p>
  17. {% endfor %}
  18. {% endif %}
  19. {% if summary.total %}
  20. <p>{{ who_spent|raw }}{% if pool_total %} a further{% endif %} {{ summary.total|number_format }} bonus points to purchase {{
  21. summary.nr|number_format }} item{% if summary.nr > 1 %}s{% endif %}.</p>
  22. {% endif %}
  23. {% if pool_total and summary.total %}
  24. <p>That makes a grand total of {{ (pool_total + summary.total)|number_format }} points, {{ adjective }}well done!</p>
  25. {% endif %}
  26. </div>
  27. {% endif %}
  28. {% if not history %}
  29. <h3>No purchase history</h3>
  30. {% else %}
  31. {% if paginator.offset == 0 %}
  32. <br />
  33. <h3>Item summary</h3>
  34. <table>
  35. <tr class="colhead">
  36. <td>Item</td>
  37. <td style="text-align: right; width: 100px">Total</td>
  38. <td style="text-align: right; width: 100px">Cost</td>
  39. </tr>
  40. {% set total_item = 0 %}
  41. {% set total_cost = 0 %}
  42. {% for i in item %}
  43. <tr class="row{{ cycle(['a', 'b'], loop.index0) }}">
  44. {% set total_item = total_item + i.total %}
  45. {% set total_cost = total_cost + i.cost %}
  46. <td>{{ i.title }}</td>
  47. <td style="text-align: right;">{{ i.total|number_format }}</td>
  48. <td style="text-align: right;">{{ i.cost|number_format }}</td>
  49. </tr>
  50. {% endfor %}
  51. <tr style="border-top: #333333 solid 1px;">
  52. <td><i>Total</i></td>
  53. <td style="text-align: right;">{{ total_item|number_format }}</td>
  54. <td style="text-align: right;">{{ total_cost|number_format }}</td>
  55. </tr>
  56. </table>
  57. <br />
  58. {% endif %}
  59. <h3>Purchase Details</h3>
  60. {{ paginator.linkbox|raw }}
  61. <table>
  62. <tr class="colhead">
  63. <td>Item</td>
  64. <td style="text-align: right; width: 50px">Price</td>
  65. <td width="180px">Purchase Date</td>
  66. <td>For</td>
  67. </tr>
  68. {% for h in history %}
  69. <tr class="row{{ cycle(['a', 'b'], loop.index0) }}">
  70. <td>{{ h.Title }}</td>
  71. <td style="text-align: right;">{{ h.Price|number_format }}</td>
  72. <td>{{ h.PurchaseDate|time_diff }}</td>
  73. <td>{% if h.OtherUserID > 0 %}{{ h.OtherUserID|user_url }}{% else %}&nbsp;{% endif %}</td>
  74. </tr>
  75. {% endfor %}
  76. </table>
  77. {{ paginator.linkbox|raw }}
  78. {% endif %}
  79. </div>