Hi everyone,
I've put together a small webui patch which addresses the following things:
1. Moved the Version listing to underneath of the dspam logo.
2. Completely removed the #footer.
3. Fixed the navigation list to display correctly (correct use of css
(floats and clears)).
4. Moved the history page numbers ([ 1 2 3 4 5 6 7 8 > ])
into their own thingy ($HISTORYPAGES$).
5. Moved the "Sort by:" links in the Quarantine tab into the table
headers ($SORT_QUARANTINE$).
I have tested this in Firefox 2.0 on Linux and it all works. If anyone
sees a problem with my patch, or doesn't like the changes, let me know!
--Kyle
diff -ru dspam.orig/webui/cgi-bin/dspam.cgi dspam.cust/webui/cgi-bin/dspam.cgi
--- dspam.orig/webui/cgi-bin/dspam.cgi 2008-02-05 11:11:30.000000000 -0500
+++ dspam.cust/webui/cgi-bin/dspam.cgi 2008-02-05 14:55:18.000000000 -0500
@@ -460,24 +460,24 @@
while($line = pop(@history)) { $DATA{'HISTORY'} .= $line; }
if ($CONFIG{'HISTORY_PER_PAGE'} > 0) {
- $DATA{'HISTORY'} .= "<center>[";
+ $DATA{'HISTORYPAGES'} = "<div class=\"historypages\">[";
if (($history_pages > 1) && ($history_page > 1)) {
my $i = $history_page-1;
- $DATA{'HISTORY'} .= "<a href=\"$MYURL&show=$show&history_page=$i\"> < </a>";
+ $DATA{'HISTORYPAGES'} = "<a href=\"$MYURL&show=$show&history_page=$i\"> < </a>";
}
for(my $i = 1; $i <= $history_pages; $i++) {
if ($i == $history_page) {
- $DATA{'HISTORY'} .= "<a href=\"$MYURL&show=$show&history_page=$i\"><big><strong> $i </strong></big></a>";
+ $DATA{'HISTORYPAGES'} .= "<a href=\"$MYURL&show=$show&history_page=$i\"><big><strong> $i </strong></big></a>";
} else {
- $DATA{'HISTORY'} .= "<a href=\"$MYURL&show=$show&history_page=$i\"> $i </a>";
+ $DATA{'HISTORYPAGES'} .= "<a href=\"$MYURL&show=$show&history_page=$i\"> $i </a>";
}
}
if (($history_pages > 1) && ($history_page < $history_pages)) {
my $i = $history_page+1;
- $DATA{'HISTORY'} .= "<a href=\"$MYURL&show=$show&history_page=$i\"> > </a>";
+ $DATA{'HISTORYPAGES'} .= "<a href=\"$MYURL&show=$show&history_page=$i\"> > </a>";
}
- $DATA{'HISTORY'} .= "]</center><BR>";
+ $DATA{'HISTORYPAGES'} .= "]</div>";
}
$DATA{'SHOW'} = $show;
@@ -1136,31 +1136,31 @@
}
$DATA{'SORTBY'} = $sortBy;
- $DATA{'SORT_SELECTOR'} .= "Sort by: <a href=\"$CONFIG{'ME'}?user=$FORM{'user'}&template=quarantine&sortby=Rating&user=$FORM{'user'}\">";
+ $DATA{'SORT_QUARANTINE'} .= "<th><a href=\"$CONFIG{'ME'}?user=$FORM{'user'}&template=quarantine&sortby=Rating&user=$FORM{'user'}\">";
if ($sortBy eq "Rating") {
- $DATA{'SORT_SELECTOR'} .= "<strong>Rating</strong>";
+ $DATA{'SORT_QUARANTINE'} .= "<strong>Rating</strong>";
} else {
- $DATA{'SORT_SELECTOR'} .= "Rating";
+ $DATA{'SORT_QUARANTINE'} .= "Rating";
}
- $DATA{'SORT_SELECTOR'} .= "</a> | <a href=\"$CONFIG{'ME'}?user=$FORM{'user'}&template=quarantine&sortby=Date&user=$FORM{'user'}\">";
+ $DATA{'SORT_QUARANTINE'} .= "</a></th>\n\t<th><a href=\"$CONFIG{'ME'}?user=$FORM{'user'}&template=quarantine&sortby=Date&user=$FORM{'user'}\">";
if ($sortBy eq "Date") {
- $DATA{'SORT_SELECTOR'} .= "<strong>Date</strong>";
+ $DATA{'SORT_QUARANTINE'} .= "<strong>Date</strong>";
} else {
- $DATA{'SORT_SELECTOR'} .= "Date";
+ $DATA{'SORT_QUARANTINE'} .= "Date";
}
- $DATA{'SORT_SELECTOR'} .= "</a> | <a href=\"$CONFIG{'ME'}?user=$FORM{'user'}&template=quarantine&sortby=Subject&user=$FORM{'user'}\">";
- if ($sortBy eq "Subject") {
- $DATA{'SORT_SELECTOR'} .= "<strong>Subject</strong>";
+ $DATA{'SORT_QUARANTINE'} .= "</a></th>\n\t<th><a href=\"$CONFIG{'ME'}?user=$FORM{'user'}&template=quarantine&sortby=From&user=$FORM{'user'}\">";
+ if ($sortBy eq "From") {
+ $DATA{'SORT_QUARANTINE'} .= "<strong>From</strong>";
} else {
- $DATA{'SORT_SELECTOR'} .= "Subject";
+ $DATA{'SORT_QUARANTINE'} .= "From";
}
- $DATA{'SORT_SELECTOR'} .= "</a> | <a href=\"$CONFIG{'ME'}?user=$FORM{'user'}&template=quarantine&sortby=From&user=$FORM{'user'}\">";
- if ($sortBy eq "From") {
- $DATA{'SORT_SELECTOR'} .= "<strong>From</strong>";
+ $DATA{'SORT_QUARANTINE'} .= "</a></th>\n\t<th><a href=\"$CONFIG{'ME'}?user=$FORM{'user'}&template=quarantine&sortby=Subject&user=$FORM{'user'}\">";
+ if ($sortBy eq "Subject") {
+ $DATA{'SORT_QUARANTINE'} .= "<strong>Subject</strong>";
} else {
- $DATA{'SORT_SELECTOR'} .= "From";
+ $DATA{'SORT_QUARANTINE'} .= "Subject";
}
- $DATA{'SORT_SELECTOR'} .= "</a>";
+ $DATA{'SORT_QUARANTINE'} .= "</a></th>";
my($row, $rowclass, $counter);
diff -ru dspam.orig/webui/cgi-bin/templates/nav_admin_error.html dspam.cust/webui/cgi-bin/templates/nav_admin_error.html
--- dspam.orig/webui/cgi-bin/templates/nav_admin_error.html 2007-12-13 19:14:32.000000000 -0500
+++ dspam.cust/webui/cgi-bin/templates/nav_admin_error.html 2008-02-05 13:06:44.000000000 -0500
@@ -6,6 +6,7 @@
<div id="header">
<div id="logo">
<a href="$CGI$" title="Home"><img src="$WEB_ROOT$/dspam-logo-small.gif" alt="DSPAM Logo" /></a>
+ <p>$DSPAMVERSION$</p>
</div>
<div id="userinfo">
Statistical SPAM Protection for <strong>Administrator ($REMOTE_USER$)</strong>
@@ -30,9 +31,7 @@
</div>
-<div id="footer">
-$DSPAMVERSION$
-</div>
+
</body>
</html>
diff -ru dspam.orig/webui/cgi-bin/templates/nav_admin_preferences.html dspam.cust/webui/cgi-bin/templates/nav_admin_preferences.html
--- dspam.orig/webui/cgi-bin/templates/nav_admin_preferences.html 2007-12-20 21:00:02.000000000 -0500
+++ dspam.cust/webui/cgi-bin/templates/nav_admin_preferences.html 2008-02-05 13:10:47.000000000 -0500
@@ -6,6 +6,7 @@
<div id="header">
<div id="logo">
<a href="$CGI$" title="Home"><img src="$WEB_ROOT$/dspam-logo-small.gif" alt="DSPAM Logo" /></a>
+ <p>$DSPAMVERSION$</p>
</div>
<div id="userinfo">
Statistical SPAM Protection for <strong>Administrator ($REMOTE_USER$)</strong>
@@ -43,7 +44,7 @@
<INPUT TYPE=HIDDEN NAME="template" VALUE="preferences">
-<div id="content">
+<div class="content">
<h3><strong>Training</strong> - Configure how the filter learns as it processes messages</h3>
<table class="hollow">
<tr><td>
@@ -85,7 +86,7 @@
</div>
-<div id="content">
+<div class="content">
<h3><strong>Message Handling</strong> - Configure how SPAM is handled</h3>
<p>
When a SPAM message is identified:<br><br>
@@ -96,7 +97,7 @@
</div>
-<div id="content">
+<div class="content">
<h3><strong>Features</strong> - Tuning SPAM filtering</h3>
<p>
<INPUT TYPE=CHECKBOX NAME=enableBNR $C_BNR$>
@@ -119,9 +120,7 @@
</div>
-<div id="footer">
-$DSPAMVERSION$
-</div>
+
</BODY>
</HTML>
diff -ru dspam.orig/webui/cgi-bin/templates/nav_admin_status.html dspam.cust/webui/cgi-bin/templates/nav_admin_status.html
--- dspam.orig/webui/cgi-bin/templates/nav_admin_status.html 2007-12-13 19:14:32.000000000 -0500
+++ dspam.cust/webui/cgi-bin/templates/nav_admin_status.html 2008-02-05 13:10:46.000000000 -0500
@@ -6,6 +6,7 @@
<div id="header">
<div id="logo">
<a href="$CGI$" title="Home"><img src="$WEB_ROOT$/dspam-logo-small.gif" alt="DSPAM Logo" /></a>
+ <p>$DSPAMVERSION$</p>
</div>
<div id="userinfo">
Statistical SPAM Protection for <strong>Administrator ($REMOTE_USER$)</strong>
@@ -29,7 +30,7 @@
The following graphs and tables summarize the processing done by the filter.
</p>
-<div id="content">
+<div class="content">
<h3><strong>Overview</strong></h3>
<table border="0" cellspacing="0" cellpadding="4">
@@ -98,21 +99,19 @@
</table>
</div>
-<div id="content">
+<div class="content">
<h3><strong>24 Hour Activity</strong> - $TS_DAILY$ SPAM, $TI_DAILY$ Good, $SM_DAILY$ Spam Misses, $FP_DAILY$ False Positives, $INOC_DAILY$ Inoculations</h3>
<img src="./admingraph.cgi?data=$DATA_DAILY$&x_label=Hour+of+the+day" />
</div>
-<div id="content">
+<div class="content">
<h3><strong>Daily Activity</strong> - $TS_WEEKLY$ SPAM, $TI_WEEKLY$ Good, $SM_WEEKLY$ Spam Misses, $FP_WEEKLY$ False Positives, $INOC_WEEKLY$ Inoculations</h3>
<img src="./admingraph.cgi?data=$DATA_WEEKLY$&graph=period&x_label=Date" />
</div>
</div>
-<div id="footer">
-$DSPAMVERSION$
-</div>
+
</body>
</html>
diff -ru dspam.orig/webui/cgi-bin/templates/nav_admin_user.html dspam.cust/webui/cgi-bin/templates/nav_admin_user.html
--- dspam.orig/webui/cgi-bin/templates/nav_admin_user.html 2007-12-13 19:14:32.000000000 -0500
+++ dspam.cust/webui/cgi-bin/templates/nav_admin_user.html 2008-02-05 13:06:49.000000000 -0500
@@ -6,6 +6,7 @@
<div id="header">
<div id="logo">
<a href="$CGI$" title="Home"><img src="$WEB_ROOT$/dspam-logo-small.gif" alt="DSPAM Logo" /></a>
+ <p>$DSPAMVERSION$</p>
</div>
<div id="userinfo">
Statistical SPAM Protection for <strong>Administrator ($REMOTE_USER$)</strong>
@@ -51,9 +52,7 @@
</div>
-<div id="footer">
-$DSPAMVERSION$
-</div>
+
</body>
</html>
diff -ru dspam.orig/webui/cgi-bin/templates/nav_alerts.html dspam.cust/webui/cgi-bin/templates/nav_alerts.html
--- dspam.orig/webui/cgi-bin/templates/nav_alerts.html 2007-12-13 19:14:32.000000000 -0500
+++ dspam.cust/webui/cgi-bin/templates/nav_alerts.html 2008-02-05 13:06:50.000000000 -0500
@@ -6,6 +6,7 @@
<div id="header">
<div id="logo">
<a href="$CGI$" title="Home"><img src="$WEB_ROOT$/dspam-logo-small.gif" alt="DSPAM Logo" /></a>
+ <p>$DSPAMVERSION$</p>
</div>
<div id="userinfo">
$FORM_USER$
@@ -45,9 +46,7 @@
</div>
-<div id="footer">
-$DSPAMVERSION$
-</div>
+
</BODY>
</HTML>
diff -ru dspam.orig/webui/cgi-bin/templates/nav_analysis.html dspam.cust/webui/cgi-bin/templates/nav_analysis.html
--- dspam.orig/webui/cgi-bin/templates/nav_analysis.html 2007-12-13 19:14:32.000000000 -0500
+++ dspam.cust/webui/cgi-bin/templates/nav_analysis.html 2008-02-05 13:10:44.000000000 -0500
@@ -6,6 +6,7 @@
<div id="header">
<div id="logo">
<a href="$CGI$" title="Home"><img src="$WEB_ROOT$/dspam-logo-small.gif" alt="DSPAM Logo" /></a>
+ <p>$DSPAMVERSION$</p>
</div>
<div id="userinfo">
$FORM_USER$
@@ -32,22 +33,20 @@
Graphs showing the number of messages that have been processed are shown below.
</p>
-<div id="content">
+<div class="content">
<h3><strong>24 Hour Activity</strong> - $TS_DAILY$ SPAM, $TI_DAILY$ Good</h3>
<img src="./graph.cgi?data=$DATA_DAILY$&x_label=Hour+of+the+day" />
</div>
-<div id="content">
+<div class="content">
<h3><strong>14 Day Activity</strong> - $TS_WEEKLY$ SPAM, $TI_WEEKLY$ Good</h3>
<img src="./graph.cgi?data=$DATA_WEEKLY$&graph=period&x_label=Date" />
</div>
</div>
-<div id="footer">
-$DSPAMVERSION$
-</div>
+
</BODY>
</HTML>
diff -ru dspam.orig/webui/cgi-bin/templates/nav_error.html dspam.cust/webui/cgi-bin/templates/nav_error.html
--- dspam.orig/webui/cgi-bin/templates/nav_error.html 2007-12-13 19:14:32.000000000 -0500
+++ dspam.cust/webui/cgi-bin/templates/nav_error.html 2008-02-05 13:06:53.000000000 -0500
@@ -6,6 +6,7 @@
<div id="header">
<div id="logo">
<a href="$CGI$" title="Home"><img src="$WEB_ROOT$/dspam-logo-small.gif" alt="DSPAM Logo" /></a>
+ <p>$DSPAMVERSION$</p>
</div>
<div id="userinfo">
Statistical SPAM Protection for <strong>$REMOTE_USER$</strong>
@@ -33,9 +34,7 @@
</div>
-<div id="footer">
-$DSPAMVERSION$
-</div>
+
</BODY>
</HTML>
diff -ru dspam.orig/webui/cgi-bin/templates/nav_history.html dspam.cust/webui/cgi-bin/templates/nav_history.html
--- dspam.orig/webui/cgi-bin/templates/nav_history.html 2008-02-05 13:29:10.000000000 -0500
+++ dspam.cust/webui/cgi-bin/templates/nav_history.html 2008-02-05 13:30:04.000000000 -0500
@@ -7,6 +7,7 @@
<div id="header">
<div id="logo">
<a href="$CGI$" title="Home"><img src="$WEB_ROOT$/dspam-logo-small.gif" alt="DSPAM Logo" /></a>
+ <p>$DSPAMVERSION$</p>
</div>
<div id="userinfo">
$FORM_USER$
@@ -56,14 +57,15 @@
</tr>
$HISTORY$
</table>
+
+$HISTORYPAGES$
+
<input type="submit" value="Retrain Checked">
</form>
</div>
-<div id="footer">
-$DSPAMVERSION$
-</div>
+
<script language="javascript">
<!--
diff -ru dspam.orig/webui/cgi-bin/templates/nav_performance.html dspam.cust/webui/cgi-bin/templates/nav_performance.html
--- dspam.orig/webui/cgi-bin/templates/nav_performance.html 2007-12-13 19:14:32.000000000 -0500
+++ dspam.cust/webui/cgi-bin/templates/nav_performance.html 2008-02-05 13:10:41.000000000 -0500
@@ -6,6 +6,7 @@
<div id="header">
<div id="logo">
<a href="$CGI$" title="Home"><img src="$WEB_ROOT$/dspam-logo-small.gif" alt="DSPAM Logo" /></a>
+ <p>$DSPAMVERSION$</p>
</div>
<div id="userinfo">
$FORM_USER$
@@ -35,7 +36,7 @@
so that it can be analyzed and learned as SPAM. This will improve the filter's accuracy in the future.
</p>
-<div id="content">
+<div class="content">
<h3><strong>Performance Statistics</strong> - $TIME$</h3>
<table border="0" cellspacing="0" cellpadding="4">
@@ -102,9 +103,7 @@
</div>
-<div id="footer">
-$DSPAMVERSION$
-</div>
+
</body>
</html>
diff -ru dspam.orig/webui/cgi-bin/templates/nav_preferences.html dspam.cust/webui/cgi-bin/templates/nav_preferences.html
--- dspam.orig/webui/cgi-bin/templates/nav_preferences.html 2007-12-20 21:00:02.000000000 -0500
+++ dspam.cust/webui/cgi-bin/templates/nav_preferences.html 2008-02-05 13:10:43.000000000 -0500
@@ -6,6 +6,7 @@
<div id="header">
<div id="logo">
<a href="$CGI$" title="Home"><img src="$WEB_ROOT$/dspam-logo-small.gif" alt="DSPAM Logo" /></a>
+ <p>$DSPAMVERSION$</p>
</div>
<div id="userinfo">
$FORM_USER$
@@ -36,7 +37,7 @@
<INPUT TYPE=HIDDEN NAME="template" VALUE="preferences">
<INPUT TYPE=HIDDEN NAME="user" VALUE="$REMOTE_USER$">
-<div id="content">
+<div class="content">
<h3><strong>Training</strong> - Configure how the filter learns as it processes messages</h3>
<p>
<table class="hollow">
@@ -78,7 +79,7 @@
</div>
-<div id="content">
+<div class="content">
<h3><strong>Message Handling</strong> - Configure how SPAM is handled</h3>
<p>
When a SPAM message is identified:<br><br>
@@ -89,7 +90,7 @@
</div>
-<div id="content">
+<div class="content">
<h3><strong>Features</strong> - Tuning SPAM filtering</h3>
<p>
$OPTION$
@@ -113,9 +114,7 @@
</div>
-<div id="footer">
-$DSPAMVERSION$
-</div>
+
</BODY>
</HTML>
diff -ru dspam.orig/webui/cgi-bin/templates/nav_quarantine.html dspam.cust/webui/cgi-bin/templates/nav_quarantine.html
--- dspam.orig/webui/cgi-bin/templates/nav_quarantine.html 2008-02-05 11:11:30.000000000 -0500
+++ dspam.cust/webui/cgi-bin/templates/nav_quarantine.html 2008-02-05 14:00:20.000000000 -0500
@@ -7,6 +7,7 @@
<div id="header">
<div id="logo">
<a href="$CGI$" title="Home"><img src="$WEB_ROOT$/dspam-logo-small.gif" alt="DSPAM Logo" /></a>
+ <p>$DSPAMVERSION$</p>
</div>
<div id="userinfo">
$FORM_USER$
@@ -50,16 +51,11 @@
<input type="submit" value="Delete All" name="deleteAll" onClick="if (confirm('Are you sure you want to delete ALL messages in quarantine?')==false) { return false; }" >
- $SORT_SELECTOR$
-
</p>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr>
<th> </th>
- <th>Rating</th>
- <th>Date</th>
- <th>From</th>
- <th>Subject</th>
+ $SORT_QUARANTINE$
</tr>
$QUARANTINE$
</table>
@@ -82,9 +78,7 @@
</div>
-<div id="footer">
-$DSPAMVERSION$
-</div>
+
</BODY>
</HTML>
diff -ru dspam.orig/webui/cgi-bin/templates/nav_viewmessage.html dspam.cust/webui/cgi-bin/templates/nav_viewmessage.html
--- dspam.orig/webui/cgi-bin/templates/nav_viewmessage.html 2007-12-13 19:14:32.000000000 -0500
+++ dspam.cust/webui/cgi-bin/templates/nav_viewmessage.html 2008-02-05 13:06:58.000000000 -0500
@@ -6,6 +6,7 @@
<div id="header">
<div id="logo">
<a href="$CGI$" title="Home"><img src="$WEB_ROOT$/dspam-logo-small.gif" alt="DSPAM Logo" /></a>
+ <p>$DSPAMVERSION$</p>
</div>
<div id="userinfo">
Statistical SPAM Protection for <strong>$REMOTE_USER$</strong>
@@ -47,9 +48,7 @@
</div>
-<div id="footer">
-$DSPAMVERSION$
-</div>
+
</BODY>
</HTML>
diff -ru dspam.orig/webui/htdocs/base.css dspam.cust/webui/htdocs/base.css
--- dspam.orig/webui/htdocs/base.css 2007-12-13 19:14:32.000000000 -0500
+++ dspam.cust/webui/htdocs/base.css 2008-02-05 14:01:25.000000000 -0500
@@ -15,6 +15,12 @@
font-weight: bold;
text-align: left;
}
+th a{
+ color:white;
+ background-color:black;
+ display:block;
+ text-align:center;
+}
td {
font-size: 11px;
}
@@ -55,24 +61,22 @@
margin: 0;
height: 25px;
}
+#logo *{margin:0; padding:0;}
#logo {
text-align: right;
float: right;
}
-#logo img {
- padding: 0;
- margin: 0;
- border: none;
+#logo img {border: none;}
+#logo p{
+ text-align:center;
+ clear:left;
+ font-size:80%;
}
#userinfo {
}
-#navcontainer ul {
- display: block;
- list-style: none outside;
- padding: 0;
- margin: 24px 0 0 0;
-}
+#navcontainer *{margin:0; padding:0;}
+#navcontainer ul {list-style: none;}
#navcontainer li {
margin: 0 4px 0 0;
background-color: lightgray;
@@ -81,8 +85,11 @@
/* the next 4 lines are magic: moves box up to handle link elements */
display: block;
float: left;
- position: relative;
- top: -1.55em;
+}
+#navcontainer li a{
+ display:block;
+ float:left;
+ width:100%;
}
#navcontainer a:link, #navcontainer a:visited {
background-color: lightgray;
@@ -110,42 +117,42 @@
background-color: #f7f7f7;
border: 2px solid black;
padding: 8px;
+ clear:left;
}
-#content {
+.content {
text-align: left;
display: table;
width: 100%;
background-color: #dddddd;
margin-bottom: 8px;
}
-#content h3 {
+.content h3 {
font-size: 11px;
font-weight: normal;
background-color: #bbbbbb;
margin: 0;
padding: 2px;
}
-#content h3 strong {
+.content h3 strong {
font-weight: bold;
}
-#content table,img {
+.content table,img {
margin: 8px;
display: block;
float: left;
}
-#content img {
+.content img {
padding: 4px;
background-color:#ddd;
}
-#content p {
+.content p {
padding: 8px;
padding-top: 0px;
clear: left;
float: none;
}
-
-#footer a {
- text-align;center;
- font-size:80%;
+.historypages{
+ text-align:center;
+ font-size:95%;
}