A copyright violation detector running on Wikimedia Cloud Services https://tools.wmflabs.org/copyvios/
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 
 
 

88 rindas
4.4 KiB

  1. <%include file="/support/header.mako" args="environ=environ, title='Settings'"/>\
  2. <%namespace module="toolserver.settings" import="main"/>\
  3. <%! from json import dumps, loads %>
  4. <% bot, cookies, status, langs, projects = main(environ, headers) %>
  5. % if status:
  6. <div class="green-box">${status}</div>
  7. % endif
  8. <h1>Settings</h1>
  9. <p>This page contains some configurable options for this Toolserver site. Settings are saved as cookies. You can view and delete all cookies generated by this site at the bottom of this page.</p>
  10. <form action="${environ['PATH_INFO']}" method="post">
  11. <input type="hidden" name="action" value="set">
  12. <table>
  13. <tr>
  14. <td>Default site:</td>
  15. <td>
  16. <tt>http://</tt>
  17. <select name="lang">
  18. <% selected_lang = cookies["EarwigDefaultLang"].value if "EarwigDefaultLang" in cookies else bot.wiki.get_site().lang %>
  19. % for code, name in langs:
  20. % if code == selected_lang:
  21. <option value="${code}" selected="selected">${name}</option>
  22. % else:
  23. <option value="${code}">${name}</option>
  24. % endif
  25. % endfor
  26. </select>
  27. <tt>.</tt>
  28. <select name="project">
  29. <% selected_project = cookies["EarwigDefaultProject"].value if "EarwigDefaultProject" in cookies else bot.wiki.get_site().project %>
  30. % for code, name in projects:
  31. % if code == selected_project:
  32. <option value="${code}" selected="selected">${name}</option>
  33. % else:
  34. <option value="${code}">${name}</option>
  35. % endif
  36. % endfor
  37. </select>
  38. <tt>.org</tt>
  39. </td>
  40. </tr>
  41. <tr>
  42. <td>Background:</td>
  43. </tr>
  44. <tr>
  45. <td><button type="submit">Save</button></td>
  46. </tr>
  47. </table>
  48. </form>
  49. <h2>Cookies</h2>
  50. % if cookies:
  51. <table>
  52. % for cookie in cookies.itervalues():
  53. <tr>
  54. <td><b><tt>${cookie.key | h}</tt></b></td>
  55. % try:
  56. <% lines = dumps(loads(cookie.value), indent=4).splitlines() %>
  57. <td>
  58. % for line in lines:
  59. <tt><div class="indentable">${line | h}</div></tt>
  60. % endfor
  61. </td>
  62. % except ValueError:
  63. <td><tt>${cookie.value | h}</tt></td>
  64. % endtry
  65. <td>
  66. <form action="${environ['PATH_INFO']}" method="post">
  67. <input type="hidden" name="action" value="delete">
  68. <input type="hidden" name="cookie" value="${cookie.key | h}">
  69. <button type="submit">Delete</button>
  70. </form>
  71. </td>
  72. </tr>
  73. % endfor
  74. <tr>
  75. <td>
  76. <form action="${environ['PATH_INFO']}" method="post">
  77. <input type="hidden" name="action" value="delete">
  78. <input type="hidden" name="all" value="1">
  79. <button type="submit">Delete all</button>
  80. </form>
  81. </td>
  82. </tr>
  83. </table>
  84. % else:
  85. <p>No cookies!</p>
  86. % endif
  87. <%include file="/support/footer.mako" args="environ=environ"/>