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 3.6 KiB

12 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <%include file="/support/header.mako" args="environ=environ, title='Settings'"/>\
  2. <%namespace module="toolserver.settings" import="main"/>\
  3. <% bot, cookies, langs, projects = main(environ, headers) %>
  4. <h1>Settings</h1>
  5. <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>
  6. <h2>Options</h2>
  7. <form action="${environ['PATH_INFO']}" method="post">
  8. <input type="hidden" name="action" value="set">
  9. <table>
  10. <tr>
  11. <td>Default site:</td>
  12. <td>
  13. <tt>http://</tt>
  14. <select name="lang">
  15. <% selected_lang = cookies["EarwigDefaultLang"].value if "EarwigDefaultLang" in cookies else bot.wiki.get_site().lang %>
  16. % for code, name in langs:
  17. % if code == selected_lang:
  18. <option value="${code}" selected="selected">${name}</option>
  19. % else:
  20. <option value="${code}">${name}</option>
  21. % endif
  22. % endfor
  23. </select>
  24. <tt>.</tt>
  25. <select name="project">
  26. <% selected_project = cookies["EarwigDefaultProject"].value if "EarwigDefaultProject" in cookies else bot.wiki.get_site().lang %>
  27. % for code, name in projects:
  28. % if code == selected_project:
  29. <option value="${code}" selected="selected">${name}</option>
  30. % else:
  31. <option value="${code}">${name}</option>
  32. % endif
  33. % endfor
  34. </select>
  35. <tt>.org</tt>
  36. </td>
  37. </tr>
  38. <tr>
  39. <td>Background:</td>
  40. </tr>
  41. <tr>
  42. <td><button type="submit">Save</button></td>
  43. </tr>
  44. </table>
  45. </form>
  46. <h2>Cookies</h2>
  47. % if cookies:
  48. <ul>
  49. % for cookie in cookies.itervalues():
  50. <li>
  51. <tt>${cookie.key | h}</tt>: <tt>${cookie.value | h}</tt> (<tt>${cookie["path"] | h}</tt>)
  52. <form action="${environ['PATH_INFO']}" method="post">
  53. <input type="hidden" name="action" value="delete">
  54. <input type="hidden" name="cookie" value="${cookie.key | h}">
  55. <button type="submit">Delete</button>
  56. </form>
  57. </li>
  58. % endfor
  59. </ul>
  60. <form action="${environ['PATH_INFO']}" method="post">
  61. <input type="hidden" name="action" value="delete">
  62. <input type="hidden" name="all" value="1">
  63. <button type="submit">Delete all</button>
  64. </form>
  65. % else:
  66. <p>No cookies!</p>
  67. % endif
  68. <%include file="/support/footer.mako" args="environ=environ"/>