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.

advanced-user-search.twig 20KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452
  1. {% from 'macro/form.twig' import checked, selected %}
  2. <div class="thin">
  3. <form class="search_form" name="users" action="user.php" method="get">
  4. <input type="hidden" name="action" value="search" />
  5. <table class="layout"><tr>
  6. <td style="vertical-align:top;"><table class="layout">
  7. <tr>
  8. <td class="label nobr">Username:</td>
  9. <td>
  10. <input type="text" name="username" size="20" value="{{ username }}" />
  11. </td>
  12. </tr>
  13. <tr>
  14. <td class="label nobr">Email address:</td>
  15. <td>
  16. <input type="text" name="email" size="20" value="{{ email }}" />
  17. </td>
  18. </tr>
  19. <tr>
  20. <td class="label tooltip nobr" title="To fuzzy search (default) for a block of addresses
  21. (e.g. 55.66.77.*), enter &quot;55.66.77.&quot; withou'] ?? '')?>t the quotes">Site IP:</td>
  22. <td>
  23. <input type="text" name="ip" size="20" value="{{ ip }}" />
  24. </td>
  25. </tr>
  26. <tr>
  27. <td class="label nobr">Tracker IP:<br />
  28. <div style="padding-left: 20px; text-align: left;">
  29. <input type="radio" name="tracker-src" id="tracker-src-live" value="live"{{ checked(tracker_live_source) }} />
  30. <label class="tooltip" for="tracker-src" title="Search for client ip addresses currently connecting to the tracker" for="tracker-src-live">Live</label><br />
  31. <input type="radio" name="tracker-src" id="tracker-src-hist" value="hist"{{ checked(not tracker_live_source) }} />
  32. <label class="tooltip" for="tracker-src" title="Search for ip addresses that have been seen by the tracker (but may be not connected at this time)" for="tracker-src-hist">Historical</label>
  33. </div>
  34. </td>
  35. <td>
  36. <input type="text" name="tracker_ip" size="20" value="{{ tracker_ip }}" />
  37. </td>
  38. </tr>
  39. <tr>
  40. <td class="label nobr">Staff notes:</td>
  41. <td>
  42. <input type="text" name="comment" size="20" value="{{ comment }}" />
  43. </td>
  44. </tr>
  45. <tr>
  46. <td class="label nobr">Passkey:</td>
  47. <td>
  48. <input type="text" name="passkey" size="20" value="{{ passkey }}" />
  49. </td>
  50. </tr>
  51. <tr>
  52. <td class="label tooltip nobr" title="Supports partial URL matching, e.g. entering
  53. &quot;&#124;https://ptpimg.me&quot; will search for avatars hosted on https://phpimg.me">Avatar URL:</td>
  54. <td>
  55. <input type="text" name="avatar" size="20" value="{{ avatar }}" />
  56. </td>
  57. </tr>
  58. <tr>
  59. <td class="label nobr">Last.fm username:</td>
  60. <td>
  61. <input type="text" name="lastfm" size="20" value="{{ lastfm }}" />
  62. </td>
  63. </tr>
  64. </table></td>
  65. {# new column #}
  66. <td style="vertical-align:top;"><table class="layout">
  67. <tr>
  68. <td class="label nobr">Joined:</td>
  69. <td style="white-space: nowrap;">
  70. <select name="joined">
  71. <option value="on"{{ selected(joined_op == 'on') }}>On</option>
  72. <option value="before"{{ selected(joined_op == 'before') }}>Before</option>
  73. <option value="after"{{ selected(joined_op == 'after') }}>After</option>
  74. <option value="between"{{ selected(joined_op == 'between') }}>Between</option>
  75. </select>
  76. <input type="text" name="join1" size="10" value="{{ joined_min }}" placeholder="YYYY-MM-DD" />
  77. <input type="text" name="join2" size="10" value="{{ joined_max }}" placeholder="YYYY-MM-DD" />
  78. </td>
  79. </tr>
  80. <tr>
  81. <td class="label nobr">Last active:</td>
  82. <td style="white-space: nowrap;">
  83. <select name="lastactive">
  84. <option value="on"{{ selected(last_active_op == 'on') }}>On</option>
  85. <option value="before"{{ selected(last_active_op == 'before') }}>Before</option>
  86. <option value="after"{{ selected(last_active_op == 'after') }}>After</option>
  87. <option value="between"{{ selected(last_active_op == 'between') }}>Between</option>
  88. </select>
  89. <input type="text" name="lastactive1" size="10" value="{{ last_active_min }}" placeholder="YYYY-MM-DD" />
  90. <input type="text" name="lastactive2" size="10" value="{{ last_active_max }}" placeholder="YYYY-MM-DD" />
  91. </td>
  92. </tr>
  93. <tr>
  94. <td class="label nobr" title="The number of releases downloaded (may be greater than snatched">Downloads:</td>
  95. <td width="30%">
  96. <select name="downloads">
  97. <option value="off"{{ selected(downloads_op == 'off') }}>Off</option>
  98. <option value="equal"{{ selected(downloads_op == 'equal') }}>Equal</option>
  99. <option value="above"{{ selected(downloads_op == 'above') }}>Above</option>
  100. <option value="below"{{ selected(downloads_op == 'below') }}>Below</option>
  101. <option value="between"{{ selected(downloads_op == 'between') }}>Between</option>
  102. </select>
  103. <input type="text" name="downloads1" size="6" value="{{ downloads_min }}" />
  104. <input type="text" name="downloads2" size="6" value="{{ downloads_max }}" />
  105. </td>
  106. </tr>
  107. <tr>
  108. <td class="label nobr">Snatched:</td>
  109. <td width="30%">
  110. <select name="snatched">
  111. <option value="off"{{ selected(snatched_op == 'off') }}>Off</option>
  112. <option value="equal"{{ selected(snatched_op == 'equal') }}>Equal</option>
  113. <option value="above"{{ selected(snatched_op == 'above') }}>Above</option>
  114. <option value="below"{{ selected(snatched_op == 'below') }}>Below</option>
  115. <option value="between"{{ selected(snatched_op == 'between') }}>Between</option>
  116. </select>
  117. <input type="text" name="snatched1" size="6" value="{{ snatched_min }}" />
  118. <input type="text" name="snatched2" size="6" value="{{ snatched_max }}" />
  119. </td>
  120. </tr>
  121. <tr>
  122. <td class="label nobr">Seeding:</td>
  123. <td width="30%">
  124. <select name="seeding">
  125. <option value="off"{{ selected(seeding_op == 'off') }}>Off</option>
  126. <option value="equal"{{ selected(seeding_op == 'equal') }}>Equal</option>
  127. <option value="above"{{ selected(seeding_op == 'above') }}>Above</option>
  128. <option value="below"{{ selected(seeding_op == 'below') }}>Below</option>
  129. <option value="between"{{ selected(seeding_op == 'between') }}>Between</option>
  130. </select>
  131. <input type="text" name="seeding1" size="6" value="{{ seeding_min }}" />
  132. <input type="text" name="seeding2" size="6" value="{{ seeding_max }}" />
  133. </td>
  134. </tr>
  135. <tr>
  136. <td class="label tooltip nobr" title="Units are GiB">Data Uploaded:</td>
  137. <td width="30%">
  138. <select name="uploaded">
  139. <option value="equal"{{ selected(downloaded_op == 'equal') }}>Equal</option>
  140. <option value="above"{{ selected(downloaded_op == 'above') }}>Above</option>
  141. <option value="below"{{ selected(downloaded_op == 'below') }}>Below</option>
  142. <option value="between"{{ selected(downloaded_op == 'between') }}>Between</option>
  143. <option value="buffer"{{ selected(downloaded_op == 'buffer') }}>buffer</option>
  144. </select>
  145. <input type="text" name="uploaded1" size="6" value="{{ uploaded_min }}" />
  146. <input type="text" name="uploaded2" size="6" value="{{ uploaded_max }}" />
  147. </td>
  148. </tr>
  149. <tr>
  150. <td class="label tooltip nobr" title="Units are GiB">Data Downloaded:</td>
  151. <td width="30%">
  152. <select name="downloaded">
  153. <option value="equal"{{ selected(downloaded_op == 'equal') }}>Equal</option>
  154. <option value="above"{{ selected(downloaded_op == 'above') }}>Above</option>
  155. <option value="below"{{ selected(downloaded_op == 'below') }}>Below</option>
  156. <option value="between"{{ selected(downloaded_op == 'between') }}>Between</option>
  157. </select>
  158. <input type="text" name="downloaded1" size="6" value="{{ downloaded_min }}" />
  159. <input type="text" name="downloaded2" size="6" value="{{ downloaded_max }}" />
  160. </td>
  161. </tr>
  162. <tr>
  163. <td class="label tooltip nobr" title="Units are GiB">Request Bounty:</td>
  164. <td width="30%">
  165. <select name="bounty">
  166. <option value="equal"{{ selected(bounty_op == 'equal') }}>Equal</option>
  167. <option value="above"{{ selected(bounty_op == 'above') }}>Above</option>
  168. <option value="below"{{ selected(bounty_op == 'below') }}>Below</option>
  169. <option value="between"{{ selected(bounty_op == 'between') }}>Between</option>
  170. </select>
  171. <input type="text" name="bounty1" size="6" value="{{ bounty_min }}" />
  172. <input type="text" name="bounty2" size="6" value="{{ bounty_max }}" />
  173. </td>
  174. </tr>
  175. <tr>
  176. <td class="label nobr">Ratio:</td>
  177. <td width="30%">
  178. <select name="ratio">
  179. <option value="equal"{{ selected(ratio_op == 'equal') }}>Equal</option>
  180. <option value="above"{{ selected(ratio_op == 'above') }}>Above</option>
  181. <option value="below"{{ selected(ratio_op == 'below') }}>Below</option>
  182. <option value="between"{{ selected(ratio_op == 'between') }}>Between</option>
  183. </select>
  184. <input type="text" name="ratio1" size="6" value="{{ ratio_min }}" />
  185. <input type="text" name="ratio2" size="6" value="{{ ratio_max }}" />
  186. </td>
  187. </tr>
  188. <tr>
  189. <td class="label nobr"># of invites:</td>
  190. <td>
  191. <select name="invites">
  192. <option value="equal"{{ selected(invites_op == 'equal') }}>Equal</option>
  193. <option value="above"{{ selected(invites_op == 'above') }}>Above</option>
  194. <option value="below"{{ selected(invites_op == 'below') }}>Below</option>
  195. <option value="between"{{ selected(invites_op == 'between') }}>Between</option>
  196. </select>
  197. <input type="text" name="invites1" size="6" value="{{ invites_min }}" />
  198. <input type="text" name="invites2" size="6" value="{{ invites_max }}" />
  199. </td>
  200. </tr>
  201. <tr>
  202. <td width="30%" class="label nobr"># invited:</td>
  203. <td>
  204. <select name="invited">
  205. <option value="off"{{ selected(invited_op == 'off') }}>Off</option>
  206. <option value="equal"{{ selected(invited_op == 'equal') }}>Equal</option>
  207. <option value="above"{{ selected(invited_op == 'above') }}>Above</option>
  208. <option value="below"{{ selected(invited_op == 'below') }}>Below</option>
  209. <option value="between"{{ selected(invited_op == 'between') }}>Between</option>
  210. </select>
  211. <input type="text" name="invited1" size="6" value="{{ invited_min }}" />
  212. <input type="text" name="invited2" size="6" value="{{ invited_max }}" />
  213. </td>
  214. </tr>
  215. <tr>
  216. <td class="label nobr"># of emails:</td>
  217. <td>
  218. <select name="emails_opt">
  219. <option value="equal"{{ selected(email_op == 'any') }}>Equal</option>
  220. <option value="above"{{ selected(email_op == 'locked') }}>Above</option>
  221. <option value="below"{{ selected(email_op == 'unlocked') }}>Below</option>
  222. </select>
  223. <input type="text" name="email_cnt" size="6" value="{{ email_value }}" />
  224. </td>
  225. </tr>
  226. </table></td>
  227. {# new column #}
  228. <td style="vertical-align:top;"><table class="layout">
  229. <tr>
  230. <td class="label nobr">Primary class:</td>
  231. <td>
  232. <select name="class[]" size="3" multiple="multiple">
  233. {% for c in primary_class %}
  234. <option value="{{ c.ID }}"{{ selected(c.ID in primary_current) }}>{{ c.Name|shorten(12) }} ({{ c.Level }})</option>
  235. {% endfor %}
  236. </select>
  237. </td>
  238. </tr>
  239. <tr>
  240. <td class="label nobr">Secondary class:</td>
  241. <td>
  242. <select name="secclass">
  243. <option value=""{{ selected(sec_current == '') }}>Don't Care</option>
  244. {% for c in secondary_class %}
  245. <option value="{{ c.ID }}"{{ selected(sec_current == c.ID) }}>{{ c.Name|shorten(20) }}</option>
  246. {% endfor %}
  247. </select>
  248. </td>
  249. </tr>
  250. <tr>
  251. <td class="label nobr">Enabled:</td>
  252. <td>
  253. <select name="enabled">
  254. <option value=""{{ selected(enabled == '') }}>Don't Care</option>
  255. <option value="0"{{ selected(enabled == '0') }}>Unconfirmed</option>
  256. <option value="1"{{ selected(enabled == '1') }}>Enabled</option>
  257. <option value="2"{{ selected(enabled == '2') }}>Disabled</option>
  258. </select>
  259. </td>
  260. </tr>
  261. <tr>
  262. <td class="label nobr">Donor:</td>
  263. <td>
  264. <select name="donor">
  265. <option value=""{{ selected(donor == '') }}>Don't Care</option>
  266. <option value="yes"{{ selected(donor == 'yes') }}>Yes</option>
  267. <option value="no"{{ selected(donor == 'no') }}>No</option>
  268. </select>
  269. </td>
  270. </tr>
  271. <tr>
  272. <td class="label nobr">Warned:</td>
  273. <td>
  274. <select name="warned">
  275. <option value=""{{ selected(warned == '') }}>Don't Care</option>
  276. <option value="isnotnull"{{ selected(warned == 'isnotnull') }}>Yes</option>
  277. <option value="isnull"{{ selected(warned == 'isnull') }}>No</option>
  278. </select>
  279. </td>
  280. </tr>
  281. <tr>
  282. <td class="label nobr">Locked Account:</td>
  283. <td>
  284. <select name="lockedaccount">
  285. <option value="any"{{ selected(locked_account == 'any') }}>Don't Care</option>
  286. <option value="locked"{{ selected(locked_account == 'locked') }}>Locked</option>
  287. <option value="unlocked"{{ selected(locked_account == 'unlocked') }}>Unlocked</option>
  288. </select>
  289. </td>
  290. </tr>
  291. <tr>
  292. <td class="label nobr">Disabled invites:</td>
  293. <td>
  294. <select name="disabled_invites">
  295. <option value=""{{ selected(disabled_invites == '') }}>Don't Care</option>
  296. <option value="yes"{{ selected(disabled_invites == 'yes') }}>Yes</option>
  297. <option value="no"{{ selected(disabled_invites == 'no') }}>No</option>
  298. </select>
  299. </td>
  300. </tr>
  301. <tr>
  302. <td class="label nobr">Disabled uploads:</td>
  303. <td>
  304. <select name="disabled_uploads">
  305. <option value=""{{ selected(disabled_uploads == '') }}>Don't Care</option>
  306. <option value="yes"{{ selected(disabled_uploads == 'yes') }}>Yes</option>
  307. <option value="no"{{ selected(disabled_uploads == 'no') }}>No</option>
  308. </select>
  309. </td>
  310. </tr>
  311. <tr>
  312. <td class="label nobr">Stylesheet:</td>
  313. <td>
  314. <select name="stylesheet" id="stylesheet">
  315. <option value="">Don't Care</option>
  316. {% for s in stylesheet %}
  317. <option value="{{ s.ID }} "{{ selected(style_current == s.ID) }}>{{ s.ProperName }}</option>
  318. {% endfor %}
  319. </select>
  320. </td>
  321. </tr>
  322. <tr>
  323. <td class="label tooltip nobr" title="Two-letter codes as defined in ISO 3166-1 alpha-2">Country code:</td>
  324. <td width="30%">
  325. <select name="cc_op">
  326. <option value="equal"{{ selected(ccode_op == 'equal') }}>Equals</option>
  327. <option value="not_equal"{{ selected(ccode_op == 'not_equal') }}>Not equal</option>
  328. </select>
  329. <input type="text" name="cc" size="2" value="{{ ccode }}" />
  330. </td>
  331. </tr>
  332. <tr>
  333. <td class="label nobr">Search type:</td>
  334. <td>
  335. <ul class="options_list nobullet">
  336. <li>
  337. <input type="radio" name="matchtype" id="strict_match_type" value="strict"{{ checked(match_mode == 'strict') }} />
  338. <label class="tooltip" title="A &quot;strict&quot; search uses no wildcards in search fields,
  339. and it is analogous to &#96;grep -E &quot;&circ;SEARCHTERM&#36;&quot;&#96;" for="strict_match_type">Strict</label>
  340. </li>
  341. <li>
  342. <input type="radio" name="matchtype" id="fuzzy_match_type" value="fuzzy"{{ checked(match_mode == 'fuzzy') }} />
  343. <label class="tooltip" title="A &quot;fuzzy&quot; search automatically prepends and appends wildcards to
  344. search strings, except for IP address searches, unless the search string begins or ends with a
  345. &quot;&#124;&quot; (pipe). It is analogous to a vanilla grep search (except for the pipe stuff)." for="fuzzy_match_type">Fuzzy</label>
  346. </li>
  347. <li>
  348. <input type="radio" name="matchtype" id="regexp_match_type" value="regexp"{{ checked(match_mode == 'regexp') }} />
  349. <label class="tooltip" title="A &quot;regexp&quot; search uses MySQL's regular expression syntax." for="regexp_match_type">Regexp</label>
  350. </li>
  351. </ul>
  352. </td>
  353. </tr>
  354. </table></td>
  355. </tr>
  356. </table>
  357. {# end last column #}
  358. Results ordered <select name="order">
  359. {% for field in field_by %}
  360. <option value="{{ field }}"{{ selected(field == field_current)}}>{{ field }}</option>
  361. {% endfor %}
  362. </select>
  363. <select name="way">
  364. {% for dir in order_by %}
  365. <option value="{{ dir }}"{{ selected(dir == order_current) }}>{{ dir }}</option>
  366. {% endfor %}
  367. </select>
  368. <input type="submit" value=" Search " />
  369. </form>
  370. </div>
  371. {{ paginator.linkbox|raw }}
  372. <div class="box pad center">
  373. <h2>{{ total|number_format }} result{{ total|plural }}</h2>
  374. <table width="100%">
  375. <tr class="colhead">
  376. <td>Username</td>
  377. <td>Email</td>
  378. <td>Joined</td>
  379. <td>Last seen</td>
  380. <td>Upload</td>
  381. <td>Download</td>
  382. <td>Ratio</td>
  383. <td>Bounty</td>
  384. <td>Downloads</td>
  385. <td>Snatched</td>
  386. <td>Seeding</td>
  387. <td>Invites</td>
  388. {% if show_invited %}
  389. <td>Invited</td>
  390. {% endif %}
  391. </tr>
  392. {% for u in page %}
  393. <tr class="row{{ cycle(['a', 'b'], loop.index0) }}">
  394. <td>{{ u.user_id|user_full }}</td>
  395. <td>{{ u.email }}</td>
  396. <td>{{ u.join_date|time_diff }}</td>
  397. <td>{{ u.last_access|time_diff }}</td>
  398. <td>{{ u.uploaded|octet_size }}</td>
  399. <td>{{ u.downloaded|octet_size }}</td>
  400. <td>{{ ratio(u.uploaded, u.downloaded) }}</td>
  401. <td>{{ u.bounty|octet_size }}</td>
  402. <td>{{ u.downloads|number_format }}</td>
  403. <td>{% if u.snatches is numeric %}{{ u.snatches|number_format }}{% else %}{{ u.snatches }}{% endif %}</td>
  404. <td>{% if u.seeding is numeric %}{{ u.seeding|number_format }}{% else %}{{ u.seeding }}{% endif %}</td>
  405. <td>{{ u.invites|number_format }}{% if u.disable_invites %}<span title="Invites are disabled">&nbsp;&nbsp;&#x1F6AB;</span>{% endif %}</td>
  406. {% if show_invited %}
  407. <td>{{ u.invited|number_format }}</td>
  408. {% endif %}
  409. </tr>
  410. {% endfor %}
  411. </table>
  412. </div>
  413. {{ paginator.linkbox|raw }}