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.

admin-form.twig 5.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <form class="edit_form" name="contest" id="contestform" action="{{ action }}" method="post">
  2. {% if contest.hasBonusPool %}
  3. <div class="box pad">
  4. <table>
  5. <tr><th>Payout</th><th>Value</th></tr>
  6. <tr>
  7. <td>Enabled users</td>
  8. <td>{{ user_count|number_format }}</td>
  9. </tr>
  10. <tr>
  11. <td>Enabled user bonus</td>
  12. <td>{{ contest.bonusPerUser|number_format(2) }}</td>
  13. </tr>
  14. <tr>
  15. <td>Contest participation</td>
  16. <td>{{ contest.bonusPerContest|number_format(2) }}</td>
  17. </tr>
  18. <tr>
  19. <td>Per entry added</td>
  20. <td>{{ contest.bonusPerEntry|number_format(2) }}</td>
  21. </tr>
  22. <tr>
  23. <td>Status of payout</td>
  24. <td>{{ contest.bonusStatus }}</td>
  25. </tr>
  26. {% if contest.paymentRead %}
  27. <tr>
  28. <td>Payout is ready</td>
  29. <td><input type="submit" name="payment" value="Initiate payment"/></td>
  30. </tr>
  31. {% endif %}
  32. </table>
  33. </div>
  34. {% endif %}
  35. <table>
  36. <tr>
  37. <td class="label">Contest name:</td>
  38. <td>
  39. <p>Edit the name of the contest</p>
  40. <input type="text" size="80" name="name" value="{{ create ? '' : contest.name }}"/>
  41. </td>
  42. </tr>
  43. <tr>
  44. <td class="label">Contest type:</td>
  45. <td>
  46. <p>Edit the type of the contest</p>
  47. <select name="type">
  48. {% for t in type %}
  49. <option value="{{ t.id }}"{{ t.name == contest.contestType ? ' selected' : '' }}>{{ t.name }}</option>
  50. {% endfor %}
  51. </select>
  52. </td>
  53. </tr>
  54. <tr>
  55. <td class="label">Bonus Point pool:</td>
  56. <td>
  57. <p>Members can contribute their Bonus Points to an award pool</p>
  58. <input type="checkbox" name="pool" value="{{ create ? 0 : contest.hasBonusPool }}"{{ contest.hasBonusPool ? ' checked' : '' }}/>
  59. </td>
  60. </tr>
  61. {% if create or has_pool %}
  62. <tr>
  63. <td class="label">Bonus Point distribution:</td>
  64. <td>
  65. <p>The bonus pool is divided into three parts. Adjust the values according to specifiy the proportions. Their sum
  66. does not need to add up to anything in particular: they will be scaled to the interval [0, 1] and the sum == 1.</p>
  67. <input type="number" min="0" max="10000" id="pool-user" name="pool-user" value="{{ create ? 5 : contest.bonusPerUserValue }}"
  68. />&nbsp;<label for="pool-user">This proportion of the pool will be shared between all enabled users. The number of users may vary
  69. over time; the exact value will be known only at the end of the contest.<br />
  70. <input type="number" min="0" max="10000" id="pool-contest" name="pool-contest" value="{{ create ? 15 : contest.bonusPerContestValue }}"
  71. />&nbsp;<label for="pool-contest">This proportion of the pool will be shared between all users who
  72. participate in the contest (i.e. at least one entry).<br />
  73. <input type="number" min="0" max="10000" id="pool-entry" name="pool-entry" value="{{ create ? 80 : contest.bonusPerEntryValue }}"
  74. />&nbsp;<label for="pool-entry">This proportion of the pool will be shared between every entry in the contest.
  75. </td>
  76. </tr>
  77. {% endif %}
  78. <tr>
  79. <td class="label">Begin date:</td>
  80. <td>
  81. <p>Uploaded torrents/completed requests are counted from this date (yyyy/mm/dd hh:mm:ss)</p>
  82. <input type="text" size="20" name="date_begin" value="{{ create ? '' : contest.dateBegin }}"/>
  83. </td>
  84. </tr>
  85. <tr>
  86. <td class="label">End date:</td>
  87. <td>
  88. <p>Uploaded torrents/completed requests are counted up until this date (yyyy/mm/dd hh:mm:ss)</p>
  89. <input type="text" size="20" name="date_end" value="{{ create ? '' : contest.dateEnd }}"/>
  90. </td>
  91. </tr>
  92. <tr>
  93. <td class="label">Displayed:</td>
  94. <td>
  95. <p>This many people will be displayed on the ladderboard</p>
  96. <input type="text" size="20" name="display" value="{{ create ? 100 : contest.display }}"/>
  97. </td>
  98. </tr>
  99. <tr>
  100. <td class="label">Banner:</td>
  101. <td>
  102. <p>This is the image displayed at the top of the page (optional).
  103. May be a local asset, or a URL.</p>
  104. <input type="text" size="60" name="banner" value="{{ create ? '' : contest.banner }}"/>
  105. </td>
  106. </tr>
  107. <tr>
  108. <td class="label">Introduction:</td>
  109. <td>
  110. <p>This is the introduction / guide of the contest.</p>
  111. {{ intro.emit|raw }}
  112. </td>
  113. </tr>
  114. </table>
  115. <input type="hidden" name="userid" value="{{ user_id }}"/>
  116. <input type="hidden" name="auth" value="{{ auth }}"/>
  117. {% if create %}
  118. <input type="hidden" name="new" value="1"/>
  119. <input type="submit" id="submit" value="Create contest"/>
  120. {% else %}
  121. <input type="hidden" name="cid" value="{{ contest.id }}"/>
  122. <input type="submit" id="submit" value="Save contest"/>
  123. {% endif %}
  124. </form>