From c4ee02e046ce859385ffbe1886932aabc947351a Mon Sep 17 00:00:00 2001
From: phear
Date: Wed, 14 Dec 2005 19:02:56 +0000
Subject: [PATCH] added a navigation bar and modified the css file so that some
links look like buttons.
---
default.css | 148 +++++++++-------------------------------
login.py | 10 +--
logout.py | 2 +-
main.py | 5 +-
templates/login_form.cs | 2 +-
templates/main.cs | 4 +-
templates/navbar.cs | 11 +++
templates/overview.cs | 4 +-
templates/playgame.cs | 4 +-
9 files changed, 59 insertions(+), 131 deletions(-)
create mode 100644 templates/navbar.cs
diff --git a/default.css b/default.css
index 0864743..1e9ac56 100644
--- a/default.css
+++ b/default.css
@@ -56,122 +56,7 @@ td {
font-size: 1.2em;
}
-#head {
- width: 600px;
- height: 120px;
- margin: 0;
- padding: 0;
- background-position: top right;
- background-attachment: scroll;
- background-repeat: no-repeat;
- }
-#content {
- margin: 0;
- padding: 0;
- width: 600px;
- font-size: 0.9em;
- }
-
-#content a {
- line-height: 1.2em;
- color: #000000;
- text-decoration: none;
- font-weight: bold;
- font-size: 0.9em;
- }
-
-#content a:hover {
- text-decoration: underline;
- }
-
-#content a:visited {
- color: #acacac;
- }
-
-#content p {
- font-size: 0.9em;
- padding: 0 1em;
- text-align: justify;
- }
-
-#menu {
- text-align: center;
- border-top: 1px solid #5e5e5e;
- border-bottom: 1px solid #5e5e5e;
- background-color: #ACE149;
- }
-
-#menu a:link, #menu a:visited {
- color: #5e5e5e;
- margin: 5px;
- text-decoration: none;
- border: none;
- padding: 4px;
- font-size: 0.8em;
- }
-
-#menu a:hover {
- color: #8e8e8e;
- }
-
-#words {
- width: 565px;
- padding: 1.1em 0em 1.1em 1.1em;
- margin-top: 0;
- }
-
-#words h1{
- font-size: 1.8em;
- }
-
-#words h2{
- font-size: 1.4em;
- }
-
-#words ol, #words ul {
- font-size: 0.9em;
- }
-
-#words ol li {
- padding: 0 1em;
- line-height: 1.7em;
- }
-
-#words ul li {
- padding: 0 1em;
- line-height: 1.7em;
- list-style: none;
- background: url(cryptobox-img/list.gif) center left no-repeat;
- }
-
-#footer {
- clear: both;
- text-align: center;
- border-top: 1px solid #5e5e5e;
- border-bottom: 1px solid #5e5e5e;
- background-color: #ACE149;
- font-size: 0.8em;
- color: #5e5e5e;
- }
-
-#footer a:link, #footer a:visited {
- color: white;
- margin: 5px;
- text-decoration: none;
- border: none;
- padding: 4px;
- color: #5e5e5e;
- }
-
-#footer a:hover {
- text-decoration: underline;
- }
-
-#confirmtext span {
- color: red;
- font-weight: bold;
- }
/* ----------------------=-=-=- Forms -=-=-=--------------------- */
/* pretty forms and buttons */
@@ -212,6 +97,39 @@ input.submit:hover {
cursor: pointer;
}
+/* Button-like style for links with class="button"-------------------------------------------------------------------*/
+
+.button {
+ margin:20px;
+
+}
+.button a, .button a:link, .button a:visited {
+ background-color: #ACE149;
+ border: 1px solid #222222;
+ color: #222;
+ font-size: 0.8em;
+ font-weight: bold;
+ margin:0.3em;
+ padding:2px 4px 2px 4px;/* top right bottom left */
+ text-decoration:none;
+}
+
+.button a:hover {
+ background-color: #fff;
+ border: 1px solid #222;
+ color: #222;
+ font-size: 0.8em;
+ font-weight: bold;
+ margin:0.3em;
+}
+
+/* class navbar --------------------------------------------------------------------------------------------------------- */
+.navbar {
+ width:80%;
+ border-top: 1px solid;
+ padding:10px 20px 10px 20px;/* top right bottom left */
+ margin:auto;
+}
/* The Board--------------------------------------------------------------------------- --------------------------------- */
#board a, a:link, a:visited {
diff --git a/login.py b/login.py
index d8dc112..13808fc 100755
--- a/login.py
+++ b/login.py
@@ -32,15 +32,7 @@ def navigation_bar(req,form):
return(data)
-def logout(req,form):
- "" "
- gets request object and util.FieldStorage form.
- reads username from form and clears timeout and sessionid from users table.
- "" "
- username = form["username"]
- myuser = database.Users.byUsername(username)
- myuser.sessionid = ""
- myuser.timeout = 0
+
"""
diff --git a/logout.py b/logout.py
index b386485..c82914c 100644
--- a/logout.py
+++ b/logout.py
@@ -1,4 +1,4 @@
-import database
+import database,helper
from cherrypy import cpg
from cherrypy.lib import httptools
diff --git a/main.py b/main.py
index dbee338..8b1d769 100755
--- a/main.py
+++ b/main.py
@@ -1,5 +1,5 @@
import sys, traceback,string,time
-import login,createaccount,helper,gamecreation,playgame
+import login,createaccount,helper,gamecreation,playgame,logout
from cherrypy import cpg
#clearsilver templates
@@ -10,6 +10,7 @@ import neo_cs # you must import neo_cgi first...
class WebGoSite:
def index(self):
+ print "simpleCookie:"+str(cpg.response.simpleCookie["WebGoSessionCookie"]["expires"])
return helper.cs_render("templates/main.cs")
index.exposed = True
@@ -17,6 +18,7 @@ class WebGoSite:
cpg.root = WebGoSite()
cpg.root.createaccount = createaccount.CreateAccount()
cpg.root.login = login.Login()
+cpg.root.logout = logout.Logout()
cpg.root.overview = login.Overview()
cpg.root.gamecreation = gamecreation.GameCreation()
cpg.root.playgame = playgame.PlayGame()
@@ -30,3 +32,4 @@ cpg.server.start(configMap={'sessionStorageType' : 'ram',
['img','img']]
}
)
+
diff --git a/templates/login_form.cs b/templates/login_form.cs
index 41efc8a..0c5a77b 100644
--- a/templates/login_form.cs
+++ b/templates/login_form.cs
@@ -7,5 +7,5 @@
- create account
+
\ No newline at end of file
diff --git a/templates/main.cs b/templates/main.cs
index 7ba9a52..f1edd13 100644
--- a/templates/main.cs
+++ b/templates/main.cs
@@ -1,7 +1,7 @@
This is WebGo.
-login
-create an account
+
\ No newline at end of file
diff --git a/templates/navbar.cs b/templates/navbar.cs
new file mode 100644
index 0000000..fd45a64
--- /dev/null
+++ b/templates/navbar.cs
@@ -0,0 +1,11 @@
+
+
+
\ No newline at end of file
diff --git a/templates/overview.cs b/templates/overview.cs
index 71743f9..44496dd 100644
--- a/templates/overview.cs
+++ b/templates/overview.cs
@@ -32,9 +32,11 @@
New Game:
You have free game slots.
- Start a new game
+
Sorry, all your game slots are in use.
+
+
\ No newline at end of file
diff --git a/templates/playgame.cs b/templates/playgame.cs
index 8e95364..a3cb3a9 100644
--- a/templates/playgame.cs
+++ b/templates/playgame.cs
@@ -57,7 +57,9 @@
/if ?>
+
-
+
+
\ No newline at end of file