added a navigation bar and modified the css file so that some links look like buttons.
This commit is contained in:
parent
da320b42c6
commit
c4ee02e046
9 changed files with 59 additions and 131 deletions
148
default.css
148
default.css
|
@ -56,122 +56,7 @@ td {
|
||||||
font-size: 1.2em;
|
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 -=-=-=--------------------- */
|
/* ----------------------=-=-=- Forms -=-=-=--------------------- */
|
||||||
/* pretty forms and buttons */
|
/* pretty forms and buttons */
|
||||||
|
@ -212,6 +97,39 @@ input.submit:hover {
|
||||||
cursor: pointer;
|
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--------------------------------------------------------------------------- --------------------------------- */
|
/* The Board--------------------------------------------------------------------------- --------------------------------- */
|
||||||
#board a, a:link, a:visited {
|
#board a, a:link, a:visited {
|
||||||
|
|
10
login.py
10
login.py
|
@ -32,15 +32,7 @@ def navigation_bar(req,form):
|
||||||
return(data)
|
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
|
|
||||||
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import database
|
import database,helper
|
||||||
|
|
||||||
from cherrypy import cpg
|
from cherrypy import cpg
|
||||||
from cherrypy.lib import httptools
|
from cherrypy.lib import httptools
|
||||||
|
|
5
main.py
5
main.py
|
@ -1,5 +1,5 @@
|
||||||
import sys, traceback,string,time
|
import sys, traceback,string,time
|
||||||
import login,createaccount,helper,gamecreation,playgame
|
import login,createaccount,helper,gamecreation,playgame,logout
|
||||||
from cherrypy import cpg
|
from cherrypy import cpg
|
||||||
|
|
||||||
#clearsilver templates
|
#clearsilver templates
|
||||||
|
@ -10,6 +10,7 @@ import neo_cs # you must import neo_cgi first...
|
||||||
|
|
||||||
class WebGoSite:
|
class WebGoSite:
|
||||||
def index(self):
|
def index(self):
|
||||||
|
print "simpleCookie:"+str(cpg.response.simpleCookie["WebGoSessionCookie"]["expires"])
|
||||||
return helper.cs_render("templates/main.cs")
|
return helper.cs_render("templates/main.cs")
|
||||||
|
|
||||||
index.exposed = True
|
index.exposed = True
|
||||||
|
@ -17,6 +18,7 @@ class WebGoSite:
|
||||||
cpg.root = WebGoSite()
|
cpg.root = WebGoSite()
|
||||||
cpg.root.createaccount = createaccount.CreateAccount()
|
cpg.root.createaccount = createaccount.CreateAccount()
|
||||||
cpg.root.login = login.Login()
|
cpg.root.login = login.Login()
|
||||||
|
cpg.root.logout = logout.Logout()
|
||||||
cpg.root.overview = login.Overview()
|
cpg.root.overview = login.Overview()
|
||||||
cpg.root.gamecreation = gamecreation.GameCreation()
|
cpg.root.gamecreation = gamecreation.GameCreation()
|
||||||
cpg.root.playgame = playgame.PlayGame()
|
cpg.root.playgame = playgame.PlayGame()
|
||||||
|
@ -30,3 +32,4 @@ cpg.server.start(configMap={'sessionStorageType' : 'ram',
|
||||||
['img','img']]
|
['img','img']]
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -7,5 +7,5 @@
|
||||||
<input name="password" type="text" class="text" size="20"></p>
|
<input name="password" type="text" class="text" size="20"></p>
|
||||||
<p><input type="submit" class="submit" value="login"></p>
|
<p><input type="submit" class="submit" value="login"></p>
|
||||||
</form>
|
</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" ?>
|
<?cs include:"templates/footer.cs" ?>
|
|
@ -1,7 +1,7 @@
|
||||||
<?cs include:"templates/header.cs" ?>
|
<?cs include:"templates/header.cs" ?>
|
||||||
|
|
||||||
This is WebGo.<br>
|
This is WebGo.<br>
|
||||||
<a href="/login">login</a><br>
|
<div class="button"><a href="/login">login</a>
|
||||||
<a href="/createaccount">create an account</a><br>
|
<a href="/createaccount">create an account</a><br></div>
|
||||||
|
|
||||||
<?cs include:"templates/footer.cs" ?>
|
<?cs include:"templates/footer.cs" ?>
|
11
templates/navbar.cs
Normal file
11
templates/navbar.cs
Normal 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>
|
|
@ -32,9 +32,11 @@
|
||||||
<h2>New Game:</h2>
|
<h2>New Game:</h2>
|
||||||
<?cs if:Data.Counter ?>
|
<?cs if:Data.Counter ?>
|
||||||
You have <?cs var:Data.Counter ?> free game slots.<br>
|
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 ?>
|
<?cs else ?>
|
||||||
Sorry, all your game slots are in use.
|
Sorry, all your game slots are in use.
|
||||||
<?cs /if ?>
|
<?cs /if ?>
|
||||||
|
|
||||||
|
<?cs include:"templates/navbar.cs" ?>
|
||||||
|
|
||||||
<?cs include:Settings.TemplateDir +"footer.cs" ?>
|
<?cs include:Settings.TemplateDir +"footer.cs" ?>
|
|
@ -57,7 +57,9 @@
|
||||||
/if ?><?cs
|
/if ?><?cs
|
||||||
/loop ?><?cs
|
/loop ?><?cs
|
||||||
/loop ?>
|
/loop ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?cs set:Settings.DisplayRefreshButton = 1 ?>
|
||||||
|
<?cs include:"templates/navbar.cs" ?>
|
||||||
|
|
||||||
<?cs include:"templates/footer.cs" ?>
|
<?cs include:"templates/footer.cs" ?>
|
Loading…
Reference in a new issue