added a navigation bar and modified the css file so that some links look like buttons.

This commit is contained in:
phear 2005-12-14 19:02:56 +00:00
parent da320b42c6
commit c4ee02e046
9 changed files with 59 additions and 131 deletions

View file

@ -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 {

View file

@ -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
"""

View file

@ -1,4 +1,4 @@
import database
import database,helper
from cherrypy import cpg
from cherrypy.lib import httptools

View file

@ -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']]
}
)

View file

@ -7,5 +7,5 @@
<input name="password" type="text" class="text" size="20"></p>
<p><input type="submit" class="submit" value="login"></p>
</form>
<a href="/createaccount"> create account</a><br>
<div class="button">Don't have an account? <a href="/createaccount"> create one!</a><br></div>
<?cs include:"templates/footer.cs" ?>

View file

@ -1,7 +1,7 @@
<?cs include:"templates/header.cs" ?>
This is WebGo.<br>
<a href="/login">login</a><br>
<a href="/createaccount">create an account</a><br>
<div class="button"><a href="/login">login</a>
<a href="/createaccount">create an account</a><br></div>
<?cs include:"templates/footer.cs" ?>

11
templates/navbar.cs Normal file
View file

@ -0,0 +1,11 @@
<p>
<div class="navbar">
<div class="button">
<a href="/overview/">Game overview</a>
<?cs if:Settings.DisplayRefreshButton ?>
<a href="/playgame/?game=<?cs var:Data.GameName?>">Refresh page</a>
<?cs /if ?>
<a href="/logout/">Logout</a>
</div>
</div>
</p>

View file

@ -32,9 +32,11 @@
<h2>New Game:</h2>
<?cs if:Data.Counter ?>
You have <?cs var:Data.Counter ?> free game slots.<br>
<a href="/gamecreation"> Start a new game</a><br>
<div class="button"><a href="/gamecreation"> Start a new game</a></div><br>
<?cs else ?>
Sorry, all your game slots are in use.
<?cs /if ?>
<?cs include:"templates/navbar.cs" ?>
<?cs include:Settings.TemplateDir +"footer.cs" ?>

View file

@ -57,7 +57,9 @@
/if ?><?cs
/loop ?><?cs
/loop ?>
</div>
<?cs set:Settings.DisplayRefreshButton = 1 ?>
<?cs include:"templates/navbar.cs" ?>
<?cs include:"templates/footer.cs" ?>