| @@ -1,7 +1,7 @@ | |||
| <%include file="/support/header.mako" args="environ=environ, cookies=cookies, title='Copyvio Detector', add_css=('copyvios.css',), add_js=('copyvios.js',)"/>\ | |||
| <%namespace module="toolserver.copyvios" import="main, highlight_delta"/>\ | |||
| <%namespace module="toolserver.misc" import="urlstrip"/>\ | |||
| <% query, bot, all_langs, all_projects, page, result = main(environ) %> | |||
| <% query, bot, all_langs, all_projects, page, result = main(environ) %>\ | |||
| % if query.project and query.lang and query.title and not page: | |||
| <div class="red-box"> | |||
| <p>The given site (project=<b><tt>${query.project | h}</tt></b>, language=<b><tt>${query.lang | h}</tt></b>) doesn't seem to exist. It may also be closed or private. <a href="//${query.lang | h}.${query.project | h}.org/">Confirm its URL.</a></p> | |||
| @@ -20,7 +20,7 @@ | |||
| <td> | |||
| <tt>http://</tt> | |||
| <select name="lang"> | |||
| <% selected_lang = query.orig_lang if query.orig_lang else cookies["EarwigDefaultLang"].value if "EarwigDefaultLang" in cookies 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: | |||
| % if code == selected_lang: | |||
| <option value="${code | h}" selected="selected">${name}</option> | |||
| @@ -31,7 +31,7 @@ | |||
| </select> | |||
| <tt>.</tt> | |||
| <select name="project"> | |||
| <% selected_project = query.project if query.project else cookies["EarwigDefaultProject"].value if "EarwigDefaultProject" in cookies 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: | |||
| % if code == selected_project: | |||
| <option value="${code | h}" selected="selected">${name}</option> | |||
| @@ -1,7 +1,7 @@ | |||
| <% bot, status, langs, projects = main(environ, headers, cookies) %>\ | |||
| <%include file="/support/header.mako" args="environ=environ, cookies=cookies, title='Settings'"/>\ | |||
| <%namespace module="toolserver.settings" import="main"/>\ | |||
| <%! from json import dumps, loads %> | |||
| <%! from json import dumps, loads %>\ | |||
| % if status: | |||
| <div class="green-box"> | |||
| <p>${status}</p> | |||
| @@ -17,7 +17,7 @@ | |||
| <td> | |||
| <tt>http://</tt> | |||
| <select name="lang"> | |||
| <% selected_lang = cookies["EarwigDefaultLang"].value if "EarwigDefaultLang" in cookies else bot.wiki.get_site().lang %> | |||
| <% selected_lang = cookies["EarwigDefaultLang"].value if "EarwigDefaultLang" in cookies else bot.wiki.get_site().lang %>\ | |||
| % for code, name in langs: | |||
| % if code == selected_lang: | |||
| <option value="${code | h}" selected="selected">${name}</option> | |||
| @@ -28,7 +28,7 @@ | |||
| </select> | |||
| <tt>.</tt> | |||
| <select name="project"> | |||
| <% selected_project = cookies["EarwigDefaultProject"].value if "EarwigDefaultProject" in cookies else bot.wiki.get_site().project %> | |||
| <% selected_project = cookies["EarwigDefaultProject"].value if "EarwigDefaultProject" in cookies else bot.wiki.get_site().project %>\ | |||
| % for code, name in projects: | |||
| % if code == selected_project: | |||
| <option value="${code | h}" selected="selected">${name}</option> | |||
| @@ -48,7 +48,7 @@ | |||
| ("list", 'Randomly select from <a href="http://commons.wikimedia.org/wiki/User:The_Earwig/POTD">a subset of previous Commons Pictures of the Day</a> that work well as widescreen backgrounds, refreshed daily (default).'), | |||
| ] | |||
| selected = cookies["EarwigBackground"].value if "EarwigBackground" in cookies else "list" | |||
| %> | |||
| %>\ | |||
| % for i, (value, desc) in enumerate(background_options): | |||
| <tr> | |||
| % if i == 0: | |||
| @@ -75,7 +75,7 @@ | |||
| <tr> | |||
| <td><b><tt>${key | h}</tt></b></td> | |||
| % try: | |||
| <% lines = dumps(loads(cookie.value), indent=4).splitlines() %> | |||
| <% lines = dumps(loads(cookie.value), indent=4).splitlines() %>\ | |||
| <td> | |||
| % for line in lines: | |||
| <tt><div class="indentable">${line | h}</div></tt> | |||
| @@ -41,7 +41,7 @@ | |||
| <p id="links"><span class="light">></span> | |||
| % for num, tool in enumerate(tools, 1): | |||
| % if tool != "DIVIDER": | |||
| <% name, tool, link, complete, desc = tool %> | |||
| <% name, tool, link, complete, desc = tool %>\ | |||
| <abbr title="${name}${' (incomplete)' if not complete else ''}"><a class="${'dark' if complete else 'mid'}" href="${pretty}/${link}">${tool}</a></abbr> | |||
| % endif | |||
| % if num < len(tools): | |||