From ad9a71a8ef4090de030f2fa721a57510611ef2f1 Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Fri, 6 Sep 2013 01:15:46 -0400 Subject: [PATCH] Refactor more. --- pages/index.mako | 8 ++++---- pages/settings.mako | 3 +-- static/style.css | 22 +++++++--------------- 3 files changed, 12 insertions(+), 21 deletions(-) diff --git a/pages/index.mako b/pages/index.mako index 565fbd3..c2c7ebf 100644 --- a/pages/index.mako +++ b/pages/index.mako @@ -3,16 +3,16 @@ <%namespace module="copyvios.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: -
+

The given site (project=${query.project | h}, language=${query.lang | h}) doesn't seem to exist. It may also be closed or private. Confirm its URL.

% elif query.project and query.lang and query.title and page and not result: -
+

The given page doesn't seem to exist: ${page.title | h}.

% elif query.project and query.lang and query.title and query.url and page and result == "bad URI": <% result = None %> -
+

Unsupported URI scheme: ${query.url | h}.

% endif @@ -100,7 +100,7 @@ % if page and result: <% show_details = "CopyviosShowDetails" in cookies and cookies["CopyviosShowDetails"].value == "True" %>
-
+
% if result.violation:

${page.title | h} is a suspected violation of ${result.url | urlstrip, h}.

% else: diff --git a/pages/settings.mako b/pages/settings.mako index 5c3a81a..ec0fc38 100644 --- a/pages/settings.mako +++ b/pages/settings.mako @@ -3,11 +3,10 @@ <%include file="/support/header.mako" args="environ=environ, cookies=cookies, title='Settings - Earwig\'s Copyvio Detector'"/>\ <%! from json import dumps, loads %>\ % if status: -
+

${status}

% endif -

Settings

This page contains some configurable options for the copyvio detector. Settings are saved as cookies. You can view and delete all cookies generated by this site at the bottom of this page.

diff --git a/static/style.css b/static/style.css index 42442da..41c18df 100644 --- a/static/style.css +++ b/static/style.css @@ -11,9 +11,8 @@ ul, ol { line-height: 1.5; } -h1, h2, h3, h4, h5, h6 { - margin-top: 0.20em; - margin-bottom: 0.20em; +h2 { + margin-bottom: 0.2em; } div#header { @@ -44,18 +43,14 @@ div#footer { background: #DDDDDD; } -div#cv-result-yes { - padding: 5px 10px 0 10px; - margin: 0 5px 10px 5px; - background-color: #FEE; - border: 1px solid #F77; +div#info-box { + padding: 0 10px 0 10px; + margin: 10px 5px 10px 5px; } -div#cv-result-no { +div#cv-result { padding: 5px 10px 0 10px; margin: 0 5px 10px 5px; - background-color: #EFE; - border: 1px solid #7F7; } div#cv-result-detail { @@ -100,6 +95,7 @@ td#cv-col4 { } h2#cv-result-header { + margin-top: 0.2em; margin-bottom: 0; } @@ -135,15 +131,11 @@ div.divider { } div.green-box { - padding: 0 10px 0 10px; - margin: 0 5px 10px 5px; background-color: #EFE; border: 1px solid #7F7; } div.red-box { - padding: 0 10px 0 10px; - margin: 0 5px 10px 5px; background-color: #FEE; border: 1px solid #F77; }