瀏覽代碼

Move copyvio error message to top. Order cookies in an interesting way.

pull/24/head
Ben Kurtovic 12 年之前
父節點
當前提交
b5908160bf
共有 2 個檔案被更改,包括 15 行新增14 行删除
  1. +10
    -11
      pages/copyvios.mako
  2. +5
    -3
      pages/settings.mako

+ 10
- 11
pages/copyvios.mako 查看文件

@@ -2,6 +2,15 @@
<%namespace module="toolserver.copyvios" import="main, highlight_delta"/>\
<%namespace module="toolserver.misc" import="urlstrip"/>\
<% 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}</tt></b>, language=<b><tt>${query.lang}</tt></b>) doesn't seem to exist. It may also be closed or private. <a href="//${query.lang}.${query.project}.org/">Confirm its URL.</a></p>
</div>
% elif query.project and query.lang and query.title and page and not result:
<div class="red-box">
<p>The given page doesn't seem to exist: <a href="${page.url}">${page.title | h}</a>.</p>
</div>
% endif
<h1>Copyvio Detector</h1>
<p>This tool attempts to detect <a href="//en.wikipedia.org/wiki/WP:COPYVIO">copyright violations</a> in articles. Simply give the title of the page you want to check and hit Submit. The tool will then search for its content elsewhere on the web and display a report if a similar webpage is found. If you also provide a URL, it will not query any search engines and instead display a report comparing the article to that particular webpage, like the <a href="//toolserver.org/~dcoetzee/duplicationdetector/">Duplication Detector</a>. Check out the <a href="//en.wikipedia.org/wiki/User:EarwigBot/Copyvios/FAQ">FAQ</a> for more information and technical details.</p>
<form action="${environ['PATH_INFO']}" method="get">
@@ -67,17 +76,7 @@
</tr>
</table>
</form>
% if query.project and query.lang and query.title and not page:
<div class="divider"></div>
<div class="red-box">
<p>The given site (project=<b><tt>${query.project}</tt></b>, language=<b><tt>${query.lang}</tt></b>) doesn't seem to exist. It may also be closed or private. <a href="//${query.lang}.${query.project}.org/">Confirm its URL.</a></p>
</div>
% elif query.project and query.lang and query.title and page and not result:
<div class="divider"></div>
<div class="red-box">
<p>The given page doesn't seem to exist: <a href="${page.url}">${page.title | h}</a>.</p>
</div>
% elif page:
% if page:
<div class="divider"></div>
<div id="cv-result-${'yes' if result.violation else 'no'}">
% if result.violation:


+ 5
- 3
pages/settings.mako 查看文件

@@ -69,9 +69,11 @@
<h2>Cookies</h2>
% if cookies:
<table>
% for cookie in cookies.itervalues():
<% cookie_order = ["EarwigDefaultProject", "EarwigDefaultLang", "EarwigBackground", "EarwigCVShowDetails", "EarwigBackgroundCache"] %>\
% for key in [key for key in cookie_order if key in cookies]:
<% cookie = cookies[key] %>\
<tr>
<td><b><tt>${cookie.key | h}</tt></b></td>
<td><b><tt>${key | h}</tt></b></td>
% try:
<% lines = dumps(loads(cookie.value), indent=4).splitlines() %>
<td>
@@ -85,7 +87,7 @@
<td>
<form action="${environ['PATH_INFO']}" method="post">
<input type="hidden" name="action" value="delete">
<input type="hidden" name="cookie" value="${cookie.key | h}">
<input type="hidden" name="cookie" value="${key | h}">
<button type="submit">Delete</button>
</form>
</td>


Loading…
取消
儲存