A copyright violation detector running on Wikimedia Cloud Services https://tools.wmflabs.org/copyvios/
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

settings.mako 2.8 KiB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <%!
  2. from json import dumps, loads
  3. from flask import g, request
  4. from copyvios.misc import cache
  5. %>\
  6. <%include file="/includes/header.mako" args="title='Settings - Earwig\'s Copyvio Detector', splash=True"/>
  7. <%namespace name="ooui" file="/includes/ooui.mako"/>
  8. % if status:
  9. <div id="info-box" class="green-box">
  10. <p>${status}</p>
  11. </div>
  12. % endif
  13. <h2>Settings</h2>
  14. <p>This page contains some configurable options for the copyvio detector. Settings are saved as cookies.</p>
  15. <form action="${request.script_root}/settings" method="post">
  16. <h3>Default site</h3>
  17. <%ooui:field_layout>
  18. <%ooui:widget>
  19. <%ooui:horizontal_layout>
  20. <%include file="/includes/site.mako"/>
  21. </%ooui:horizontal_layout>
  22. </%ooui:widget>
  23. </%ooui:field_layout>
  24. <h3>Background</h3>
  25. <%
  26. background_options = [
  27. ("list", 'Randomly select from <a href="https://commons.wikimedia.org/wiki/User:The_Earwig/POTD">a subset</a> of previous <a href="https://commons.wikimedia.org/">Wikimedia Commons</a> <a href="https://commons.wikimedia.org/wiki/Commons:Picture_of_the_day">Pictures of the Day</a> that work well as widescreen backgrounds, refreshed daily (default).'),
  28. ("potd", 'Use the current Commons Picture of the Day, unfiltered. Certain POTDs may be unsuitable as backgrounds due to their aspect ratio or subject matter.'),
  29. ("plain", "Use a plain background."),
  30. ]
  31. selected = g.cookies["CopyviosBackground"].value if "CopyviosBackground" in g.cookies else "list"
  32. %>
  33. <%ooui:field_layout>
  34. <%ooui:radio_select>
  35. % for value, desc in background_options:
  36. <%ooui:field_layout align="inline">
  37. <%ooui:radio>
  38. <input id="background-${value}" class="oo-ui-inputWidget-input" type="radio" name="background" value="${value}" ${'checked="checked"' if value == selected else ''}><span></span>
  39. </%ooui:radio>
  40. <%ooui:field_layout_header>
  41. <label for="background-${value}" class="oo-ui-labelElement-label">${desc}</label>
  42. </%ooui:field_layout_header>
  43. </%ooui:field_layout>
  44. % endfor
  45. </%ooui:radio_select>
  46. </%ooui:field_layout>
  47. <h3>Highlight colors</h3>
  48. <p><em>This is not currently configurable, but it will be soon.</em></p>
  49. <div>
  50. Default:
  51. % for i in range(1, 9):
  52. <span class="highlight-demo cv-hl cv-hl-${i}">${i}</span>
  53. % endfor
  54. <span class="highlight-demo cv-hl">9+</span>
  55. </div>
  56. <input type="hidden" name="action" value="set"/>
  57. <%ooui:field_layout align="left">
  58. ${ooui.submit_button(label="Save")}
  59. </%ooui:field_layout>
  60. </form>
  61. <%include file="/includes/footer.mako"/>