changeset 10:17f656035775

Import the web/scoring/ files.
author John "Elwin" Edwards <elwin@sdf.org>
date Wed, 05 Sep 2012 22:34:00 -0700
parents 84c8e2c0b7f3
children 6846ee1b335b
files web/scoring/index.html web/scoring/players/index.cgi web/scoring/scores.css
diffstat 3 files changed, 95 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/web/scoring/index.html	Wed Sep 05 22:34:00 2012 -0700
@@ -0,0 +1,19 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<title>Scoring</title>
+<link rel="stylesheet" type="text/css" href="/main.css">
+</head>
+
+<body>
+<h1>Yendor Guild</h1>
+<div class="nav"><a href="/">rlgallery.org</a> -&gt; Scoring</div>
+<div class="content">
+<p>The Guild keeps a record of all brave Rogues who venture into the Dungeons of Doom.</p>
+<ul>
+<li><a href="./highscores.html">High Scores</a></li>
+<li><a href="./players/">Explorers</a></li>
+</ul>
+</div>
+</body>
+</html> 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/web/scoring/players/index.cgi	Wed Sep 05 22:34:00 2012 -0700
@@ -0,0 +1,32 @@
+#!/usr/bin/python
+
+import os
+import sys
+import rlgall
+
+playerdir = "/var/www/lighttpd/scoring/players/"
+linkstr = '<li><a href="./{0}.html">{0}</a></li>\n'
+
+filelist = os.listdir(playerdir)
+namelist = []
+
+for filename in filelist:
+  if filename.endswith(".html"):
+    namelist.append(filename.rsplit(".html", 1)[0])
+namelist.sort()
+
+sys.stdout.write("Content-type: text/html\r\n\r\n")
+sys.stdout.write(rlgall.phead.format("Players"))
+sys.stdout.write(rlgall.ptop)
+sys.stdout.write(rlgall.navscore.format("Players"))
+sys.stdout.write(rlgall.pti.format("Players"))
+
+if not namelist:
+  sys.stdout.write("<p>No one is here.</p>\n")
+else:
+  sys.stdout.write("<ul>\n")
+  for name in namelist:
+    sys.stdout.write(linkstr.format(name))
+  sys.stdout.write("</ul>\n")
+
+sys.stdout.write(rlgall.pend)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/web/scoring/scores.css	Wed Sep 05 22:34:00 2012 -0700
@@ -0,0 +1,44 @@
+@import url("/main.css");
+
+div.stable {
+	display: table;
+	border-width: 1px;
+	border-color: #101040;
+	border-style: solid;
+	border-collapse: collapse;
+}
+
+div.sentry {
+	display: table-row;
+	border-width: 1px 0;
+	border-color: #101040;
+	border-style: solid;
+}
+
+div.sentry:first-child {
+	background-color: #E0E0E0;
+}
+
+div.sentry:nth-child(3n) {
+	background-color: #E0E0FF;
+}
+
+div.sentry:nth-child(3n+4) {
+	background-color: #E0FFE0;
+}
+
+div.sentry:nth-child(3n+2) {
+	background-color: #FFE0E0;
+}
+
+span.shdata {
+	display: table-cell;
+	font-weight: bold;
+	text-align: center;
+	padding: 0 1em;
+}
+
+span.sdata {
+	display: table-cell;
+	padding: 0 1em;
+}