A copyright violation detector running on Wikimedia Cloud Services https://tools.wmflabs.org/copyvios/
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 
 

89 linhas
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. % except ValueError:
  58. <td><tt>${cookie.value | h}</tt></td>
  59. % else:
  60. <td>
  61. % for line in lines:
  62. <tt><div class="indentable">${line | h}</div></tt>
  63. % endfor
  64. </td>
  65. % endtry
  66. <td>
  67. <form action="${environ['PATH_INFO']}" method="post">
  68. <input type="hidden" name="action" value="delete">
  69. <input type="hidden" name="cookie" value="${cookie.key | h}">
  70. <button type="submit">Delete</button>
  71. </form>
  72. </td>
  73. </tr>
  74. % endfor
  75. <tr>
  76. <td>
  77. <form action="${environ['PATH_INFO']}" method="post">
  78. <input type="hidden" name="action" value="delete">
  79. <input type="hidden" name="all" value="1">
  80. <button type="submit">Delete all</button>
  81. </form>
  82. </td>
  83. </tr>
  84. </table>
  85. % else:
  86. <p>No cookies!</p>
  87. % endif
  88. <%include file="/support/footer.mako" args="environ=environ"/>