A copyright violation detector running on Wikimedia Cloud Services https://tools.wmflabs.org/copyvios/
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 
 
 

97 рядки
5.7 KiB

  1. <%!
  2. from json import dumps, loads
  3. from flask import g, request
  4. from copyvios.misc import cache
  5. %>\
  6. <%include file="/support/header.mako" args="title='Settings | Earwig\'s Copyvio Detector', splash=True"/>
  7. % if status:
  8. <div id="info-box" class="green-box">
  9. <p>${status}</p>
  10. </div>
  11. % endif
  12. <h2>Settings</h2>
  13. <p>This page contains some configurable options for the copyvio detector. Settings are saved as cookies.</p>
  14. <form action="${request.script_root}/settings" method="post">
  15. <h3>Default site</h2>
  16. <div class="oo-ui-layout oo-ui-labelElement oo-ui-fieldLayout oo-ui-fieldLayout-align-top">
  17. <div class="oo-ui-fieldLayout-body">
  18. <div class="oo-ui-fieldLayout-field">
  19. <div class="oo-ui-widget oo-ui-widget-enabled">
  20. <div class="oo-ui-layout oo-ui-horizontalLayout">
  21. <div class="oo-ui-widget oo-ui-widget-enabled oo-ui-inputWidget oo-ui-dropdownInputWidget oo-ui-dropdownInputWidget-php">
  22. <select name="lang" required="" class="oo-ui-inputWidget-input oo-ui-indicator-down">
  23. <% selected_lang = g.cookies["CopyviosDefaultLang"].value if "CopyviosDefaultLang" in g.cookies else default_lang %>\
  24. % for code, name in cache.langs:
  25. % if code == selected_lang:
  26. <option value="${code | h}" selected="selected">${name}</option>
  27. % else:
  28. <option value="${code | h}">${name}</option>
  29. % endif
  30. % endfor
  31. </select>
  32. </div>
  33. <div class="oo-ui-widget oo-ui-widget-enabled oo-ui-inputWidget oo-ui-dropdownInputWidget oo-ui-dropdownInputWidget-php">
  34. <select name="project" required="" class="oo-ui-inputWidget-input oo-ui-indicator-down">
  35. <% selected_project = g.cookies["CopyviosDefaultProject"].value if "CopyviosDefaultProject" in g.cookies else default_project %>\
  36. % for code, name in cache.projects:
  37. % if code == selected_project:
  38. <option value="${code | h}" selected="selected">${name}</option>
  39. % else:
  40. <option value="${code | h}">${name}</option>
  41. % endif
  42. % endfor
  43. </select>
  44. </div>
  45. </div>
  46. </div>
  47. </div>
  48. </div>
  49. </div>
  50. <h3>Background</h2>
  51. <%
  52. background_options = [
  53. ("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).'),
  54. ("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.'),
  55. ("plain", "Use a plain background."),
  56. ]
  57. selected = g.cookies["CopyviosBackground"].value if "CopyviosBackground" in g.cookies else "list"
  58. %>\
  59. <div class="oo-ui-layout oo-ui-labelElement oo-ui-fieldLayout oo-ui-fieldLayout-align-top">
  60. <div class="oo-ui-fieldLayout-body">
  61. <div class="oo-ui-fieldLayout-field">
  62. <div class="oo-ui-widget oo-ui-widget-enabled oo-ui-inputWidget oo-ui-radioSelectInputWidget">
  63. % for value, desc in background_options:
  64. <div class="oo-ui-layout oo-ui-labelElement oo-ui-fieldLayout oo-ui-fieldLayout-align-inline">
  65. <div class="oo-ui-fieldLayout-body">
  66. <span class="oo-ui-fieldLayout-field">
  67. <span class="oo-ui-widget oo-ui-widget-enabled oo-ui-inputWidget oo-ui-radioInputWidget">
  68. <input id="background-${value}" class="oo-ui-inputWidget-input" type="radio" name="background" value="${value}" ${'checked="checked"' if value == selected else ''}><span></span>
  69. </span>
  70. </span>
  71. <span class="oo-ui-fieldLayout-header">
  72. <label for="background-${value}" class="oo-ui-labelElement-label">${desc}</label>
  73. </span>
  74. </div>
  75. </div>
  76. % endfor
  77. </div>
  78. </div>
  79. </div>
  80. </div>
  81. <input type="hidden" name="action" value="set"/>
  82. <div class="oo-ui-layout oo-ui-fieldLayout oo-ui-fieldLayout-align-left">
  83. <div class="oo-ui-fieldLayout-body">
  84. <span class="oo-ui-fieldLayout-field">
  85. <span class="oo-ui-widget oo-ui-widget-enabled oo-ui-inputWidget oo-ui-buttonElement oo-ui-buttonElement-framed oo-ui-labelElement oo-ui-flaggedElement-primary oo-ui-flaggedElement-progressive oo-ui-labelElement oo-ui-buttonInputWidget">
  86. <button type="submit" class="oo-ui-inputWidget-input oo-ui-buttonElement-button">
  87. <span class="oo-ui-labelElement-label">Save</span>
  88. </button>
  89. </span>
  90. </span>
  91. </div>
  92. </div>
  93. </form>
  94. <%include file="/support/footer.mako"/>