A copyright violation detector running on Wikimedia Cloud Services https://tools.wmflabs.org/copyvios/
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 
 
 

101 líneas
5.8 KiB

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