A copyright violation detector running on Wikimedia Cloud Services https://tools.wmflabs.org/copyvios/
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.

settings.mako 4.4 KiB

12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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">
  7. <p>${status}</p>
  8. </div>
  9. % endif
  10. <h1>Settings</h1>
  11. <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>
  12. <form action="${environ['PATH_INFO']}" method="post">
  13. <input type="hidden" name="action" value="set">
  14. <table>
  15. <tr>
  16. <td>Default site:</td>
  17. <td>
  18. <tt>http://</tt>
  19. <select name="lang">
  20. <% selected_lang = cookies["EarwigDefaultLang"].value if "EarwigDefaultLang" in cookies else bot.wiki.get_site().lang %>
  21. % for code, name in langs:
  22. % if code == selected_lang:
  23. <option value="${code}" selected="selected">${name}</option>
  24. % else:
  25. <option value="${code}">${name}</option>
  26. % endif
  27. % endfor
  28. </select>
  29. <tt>.</tt>
  30. <select name="project">
  31. <% selected_project = cookies["EarwigDefaultProject"].value if "EarwigDefaultProject" in cookies else bot.wiki.get_site().project %>
  32. % for code, name in projects:
  33. % if code == selected_project:
  34. <option value="${code}" selected="selected">${name}</option>
  35. % else:
  36. <option value="${code}">${name}</option>
  37. % endif
  38. % endfor
  39. </select>
  40. <tt>.org</tt>
  41. </td>
  42. </tr>
  43. <tr>
  44. <td>Background:</td>
  45. </tr>
  46. <tr>
  47. <td><button type="submit">Save</button></td>
  48. </tr>
  49. </table>
  50. </form>
  51. <h2>Cookies</h2>
  52. % if cookies:
  53. <table>
  54. % for cookie in cookies.itervalues():
  55. <tr>
  56. <td><b><tt>${cookie.key | h}</tt></b></td>
  57. % try:
  58. <% lines = dumps(loads(cookie.value), indent=4).splitlines() %>
  59. <td>
  60. % for line in lines:
  61. <tt><div class="indentable">${line | h}</div></tt>
  62. % endfor
  63. </td>
  64. % except ValueError:
  65. <td><tt>${cookie.value | h}</tt></td>
  66. % endtry
  67. <td>
  68. <form action="${environ['PATH_INFO']}" method="post">
  69. <input type="hidden" name="action" value="delete">
  70. <input type="hidden" name="cookie" value="${cookie.key | h}">
  71. <button type="submit">Delete</button>
  72. </form>
  73. </td>
  74. </tr>
  75. % endfor
  76. <tr>
  77. <td>
  78. <form action="${environ['PATH_INFO']}" method="post">
  79. <input type="hidden" name="action" value="delete">
  80. <input type="hidden" name="all" value="1">
  81. <button type="submit">Delete all</button>
  82. </form>
  83. </td>
  84. </tr>
  85. </table>
  86. % else:
  87. <p>No cookies!</p>
  88. % endif
  89. <%include file="/support/footer.mako" args="environ=environ"/>