Преглед на файлове

Refactor more.

pull/24/head
Ben Kurtovic преди 11 години
родител
ревизия
ad9a71a8ef
променени са 3 файла, в които са добавени 12 реда и са изтрити 21 реда
  1. +4
    -4
      pages/index.mako
  2. +1
    -2
      pages/settings.mako
  3. +7
    -15
      static/style.css

+ 4
- 4
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:
<div class="red-box">
<div id="info-box" class="red-box">
<p>The given site (project=<b><span class="mono">${query.project | h}</span></b>, language=<b><span class="mono">${query.lang | h}</span></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>
</div>
% elif query.project and query.lang and query.title and page and not result:
<div class="red-box">
<div id="info-box" class="red-box">
<p>The given page doesn't seem to exist: <a href="${page.url}">${page.title | h}</a>.</p>
</div>
% elif query.project and query.lang and query.title and query.url and page and result == "bad URI":
<% result = None %>
<div class="red-box">
<div id="info-box" class="red-box">
<p>Unsupported URI scheme: <a href="${query.url | h}">${query.url | h}</a>.</p>
</div>
% endif
@@ -100,7 +100,7 @@
% if page and result:
<% show_details = "CopyviosShowDetails" in cookies and cookies["CopyviosShowDetails"].value == "True" %>
<div class="divider"></div>
<div id="cv-result-${'yes' if result.violation else 'no'}">
<div id="cv-result" class="${'red' if result.violation else 'green'}-box">
% if result.violation:
<h2 id="cv-result-header"><a href="${page.url}">${page.title | h}</a> is a suspected violation of <a href="${result.url | h}">${result.url | urlstrip, h}</a>.</h2>
% else:


+ 1
- 2
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:
<div class="green-box">
<div id="info-box" class="green-box">
<p>${status}</p>
</div>
% endif
<h1>Settings</h1>
<p>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.</p>
<form action="${environ['SCRIPT_URL']}" method="post">
<table>


+ 7
- 15
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;
}


Зареждане…
Отказ
Запис