Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

  • Loading branch information...
commit b5908160bf6e8bc2968e62a65559323e2b8ec034 1 parent 2a77ec8
Ben Kurtovic authored July 25, 2012
21  pages/copyvios.mako
@@ -2,6 +2,15 @@
2 2
 <%namespace module="toolserver.copyvios" import="main, highlight_delta"/>\
3 3
 <%namespace module="toolserver.misc" import="urlstrip"/>\
4 4
 <% query, bot, all_langs, all_projects, page, result = main(environ) %>
  5
+            % if query.project and query.lang and query.title and not page:
  6
+                <div class="red-box">
  7
+                    <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>
  8
+                </div>
  9
+            % elif query.project and query.lang and query.title and page and not result:
  10
+                <div class="red-box">
  11
+                    <p>The given page doesn't seem to exist: <a href="${page.url}">${page.title | h}</a>.</p>
  12
+                </div>
  13
+            % endif
5 14
             <h1>Copyvio Detector</h1>
6 15
             <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>
7 16
             <form action="${environ['PATH_INFO']}" method="get">
@@ -67,17 +76,7 @@
67 76
                     </tr>
68 77
                 </table>
69 78
             </form>
70  
-            % if query.project and query.lang and query.title and not page:
71  
-                <div class="divider"></div>
72  
-                <div class="red-box">
73  
-                    <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>
74  
-                </div>
75  
-            % elif query.project and query.lang and query.title and page and not result:
76  
-                <div class="divider"></div>
77  
-                <div class="red-box">
78  
-                    <p>The given page doesn't seem to exist: <a href="${page.url}">${page.title | h}</a>.</p>
79  
-                </div>
80  
-            % elif page:
  79
+            % if page:
81 80
                 <div class="divider"></div>
82 81
                 <div id="cv-result-${'yes' if result.violation else 'no'}">
83 82
                     % if result.violation:
8  pages/settings.mako
@@ -69,9 +69,11 @@
69 69
             <h2>Cookies</h2>
70 70
             % if cookies:
71 71
                 <table>
72  
-                % for cookie in cookies.itervalues():
  72
+                <% cookie_order = ["EarwigDefaultProject", "EarwigDefaultLang", "EarwigBackground", "EarwigCVShowDetails", "EarwigBackgroundCache"] %>\
  73
+                % for key in [key for key in cookie_order if key in cookies]:
  74
+                    <% cookie = cookies[key] %>\
73 75
                     <tr>
74  
-                        <td><b><tt>${cookie.key | h}</tt></b></td>
  76
+                        <td><b><tt>${key | h}</tt></b></td>
75 77
                         % try:
76 78
                             <% lines = dumps(loads(cookie.value), indent=4).splitlines() %>
77 79
                             <td>
@@ -85,7 +87,7 @@
85 87
                         <td>
86 88
                             <form action="${environ['PATH_INFO']}" method="post">
87 89
                                 <input type="hidden" name="action" value="delete">
88  
-                                <input type="hidden" name="cookie" value="${cookie.key | h}">
  90
+                                <input type="hidden" name="cookie" value="${key | h}">
89 91
                                 <button type="submit">Delete</button>
90 92
                             </form>
91 93
                         </td>

0 notes on commit b590816

Please sign in to comment.
Something went wrong with that request. Please try again.