Browse Source

Use cookies to store default site.

pull/24/head
Ben Kurtovic 12 years ago
parent
commit
066dc9504f
2 changed files with 3 additions and 3 deletions
  1. +2
    -2
      pages/copyvios.mako
  2. +1
    -1
      pages/settings.mako

+ 2
- 2
pages/copyvios.mako View File

@@ -12,7 +12,7 @@
<td> <td>
<tt>http://</tt> <tt>http://</tt>
<select name="lang"> <select name="lang">
<% selected_lang = query.orig_lang if query.orig_lang else bot.wiki.get_site().lang %>
<% selected_lang = query.orig_lang if query.orig_lang else cookies["EarwigDefaultLang"].value if "EarwigDefaultLang" in cookies else bot.wiki.get_site().lang %>
% for code, name in all_langs: % for code, name in all_langs:
% if code == selected_lang: % if code == selected_lang:
<option value="${code}" selected="selected">${name}</option> <option value="${code}" selected="selected">${name}</option>
@@ -23,7 +23,7 @@
</select> </select>
<tt>.</tt> <tt>.</tt>
<select name="project"> <select name="project">
<% selected_project = query.project if query.project else bot.wiki.get_site().project %>
<% selected_project = query.project if query.project else cookies["EarwigDefaultProject"].value if "EarwigDefaultProject" in cookies else bot.wiki.get_site().project %>
% for code, name in all_projects: % for code, name in all_projects:
% if code == selected_project: % if code == selected_project:
<option value="${code}" selected="selected">${name}</option> <option value="${code}" selected="selected">${name}</option>


+ 1
- 1
pages/settings.mako View File

@@ -49,7 +49,7 @@
<tt>${cookie.key | h}</tt>: <tt>${cookie.value | h}</tt> <tt>${cookie.key | h}</tt>: <tt>${cookie.value | h}</tt>
<form action="${environ['PATH_INFO']}" method="post"> <form action="${environ['PATH_INFO']}" method="post">
<input type="hidden" name="action" value="deleteCookie"> <input type="hidden" name="action" value="deleteCookie">
<input type="hidden" name="cookie" value="${cookie.name | h}">
<input type="hidden" name="cookie" value="${cookie.key | h}">
<button type="submit">Delete</button> <button type="submit">Delete</button>
</form> </form>
</li> </li>


Loading…
Cancel
Save