css: changed all id tags into class tags.

This commit is contained in:
phear 2005-10-09 21:43:20 +00:00
parent 2066a179cf
commit 055756dab1
5 changed files with 34 additions and 106 deletions

View file

@ -10,14 +10,14 @@ def display_create_form(req,form):
data = """ data = """
<form method="post"> <form method="post">
<p>Your username:<br> <p>Your username:<br>
<input name="username" type="text" id="text" size="20"></p> <input name="username" type="text" class="text" size="20"></p>
<p>Your Password:<br> <p>Your Password:<br>
<input name="password1" type="text" id="text" size="20"></p> <input name="password1" type="text" class="text" size="20"></p>
<p>Please retype your Password:<br> <p>Please retype your Password:<br>
<input name="password2" type="text" id="text" size="20"></p> <input name="password2" type="text" class="text" size="20"></p>
<input type="hidden" name="sessionid" value="%s"> <input type="hidden" name="sessionid" value="%s">
<input type="hidden" name="createaccount" value="process"> <input type="hidden" name="createaccount" value="process">
<p><input type="submit" id ="submit" value="create account"></p> <p><input type="submit" class="submit" value="create account"></p>
</form> </form>
""" % helper.generate_session_id() """ % helper.generate_session_id()
req.write(data) req.write(data)
@ -49,7 +49,7 @@ def process_form(req,form):
<input name="username" type="hidden" value="%s"></p> <input name="username" type="hidden" value="%s"></p>
<input name="password" type="hidden" value="%s"></p> <input name="password" type="hidden" value="%s"></p>
<input type="hidden" name="sessionid" value="%s"> <input type="hidden" name="sessionid" value="%s">
<p><input type="submit" id ="submit" value="login"></p> <p><input type="submit" class="submit" value="login"></p>
</form> </form>
""" % (username,password1,helper.generate_session_id()) """ % (username,password1,helper.generate_session_id())
req.write(data) req.write(data)

View file

@ -174,58 +174,7 @@ td {
} }
/* -------=-=-=- warnings, errors and success messages-=-=-=-------- */
#words div.warning,div.error,div.success {
margin-top: 20px;
margin-bottom: 20px;
padding-top: 10px;
padding-bottom: 15px;
color: #707070;
}
#words .warning,.error,.success {
border: 1px dashed #808080;
text-align: center;
color: #5e5e5e;
text-decoration: none;
font-weight: bold;
font-size: 0.9em;
padding-left: 40px;
padding-right: 40px;
}
#words .warning {
background-color: #f5f5f5;
}
#words .error {
background-color: #f5f5f5;
}
#words .success {
/* background-color: #90EE90; */
}
#words div.warning,div.error,div.success h1,h2 {
color: #808080;
}
#words .warning,.error,.success a {
// TODO: WHY line-height???
// line-height: 5em;
color: #5e5e5e;
text-decoration: none;
font-weight: bold;
font-size: 0.9em;
}
#words .note {
text-align: center;
color: #F48659;
font-style: italic;
}
/* ----------------------=-=-=- Forms -=-=-=--------------------- */ /* ----------------------=-=-=- Forms -=-=-=--------------------- */
/* pretty forms and buttons */ /* pretty forms and buttons */
input { input {
@ -234,7 +183,7 @@ input {
border: 0px; border: 0px;
} }
input#text { input.text {
border: 1px solid #333333; border: 1px solid #333333;
color: #333333; color: #333333;
background: #fff; background: #fff;
@ -242,15 +191,15 @@ input#text {
font-size: 1em; font-size: 1em;
} }
input#text:hover { input.text:hover {
background: #fff; background: #fff;
border: 1px solid #ACE149; border: 1px solid #ACE149;
color: #7DA721; color: #7DA721;
font-size: 1em; font-size: 1em;
} }
/* the submit buttons have to have id="submit" for the following style: ------------------------------------- */ /* the submit buttons have to have class="submit" for the following style: ------------------------------------- */
input#submit { input.submit {
background-color: #ACE149; background-color: #ACE149;
border: 1px solid #222222; border: 1px solid #222222;
color: #222; color: #222;
@ -259,7 +208,7 @@ input#submit {
cursor: pointer; cursor: pointer;
} }
input#submit:hover { input.submit:hover {
background-color: #fff; background-color: #fff;
border: 1px solid #222; border: 1px solid #222;
color: #222; color: #222;
@ -267,22 +216,3 @@ input#submit:hover {
font-weight: bold; font-weight: bold;
cursor: pointer; cursor: pointer;
} }
/*input#goban:hover {
padding: 0px;
border: 0px;
margin: 0px;
}
*/
#words form label {
min-width: 20em;
}
#words form p {
text-align: center;
}

View file

@ -20,10 +20,10 @@ def display_game_creation_form(req,sessionid,username):
<p>Player One (Black): %s </p> <p>Player One (Black): %s </p>
<p>Player Two (White): %s </p> <p>Player Two (White): %s </p>
<p>Goban Size: %s fields </p> <p>Goban Size: %s fields </p>
<p>Optional name for game: <input type="text" name="description" size="20" id="text"></p> <p>Optional name for game: <input type="text" name="description" size="20" class="text"></p>
<input type="hidden" name="sessionid" value="%s"> <input type="hidden" name="sessionid" value="%s">
<input type="hidden" name="username" value="%s"> <input type="hidden" name="username" value="%s">
<input type="submit" id="submit" name="create" value="create game"> <input type="submit" class="submit" name="create" value="create game">
</form> </form>
""" % (p1data,p2data,gobansize,sessionid,username) """ % (p1data,p2data,gobansize,sessionid,username)

View file

@ -53,30 +53,30 @@ def display_goban(goban,req,form):
sy = str(y) sy = str(y)
# check position: # check position:
if (x == 1) and (y == 1): # upper left if (x == 1) and (y == 1): # upper left
data += '<input type=image id="goban" src="img/topleftline'+stone+'.png" name="('+sx+','+sy+')"\n>' data += '<input type=image class="goban" src="img/topleftline'+stone+'.png" name="('+sx+','+sy+')"\n>'
elif (x == 1) and (y == size): # upper right elif (x == 1) and (y == size): # upper right
data += '<input type=image id="goban" src="img/toprightline'+stone+'.png" name="('+sx+','+sy+')"\n><br\n>' data += '<input type=image class="goban" src="img/toprightline'+stone+'.png" name="('+sx+','+sy+')"\n><br\n>'
elif (x == size) and (y == size): # lower right elif (x == size) and (y == size): # lower right
data += '<input type=image id="goban" src="img/bottomrightline'+stone+'.png" name="('+sx+','+sy+')"\n><br>\n' data += '<input type=image class="goban" src="img/bottomrightline'+stone+'.png" name="('+sx+','+sy+')"\n><br>\n'
elif (x == size) and (y == 1): # lower left elif (x == size) and (y == 1): # lower left
data += '<input type=image id="goban" src="img/bottomleftline'+stone+'.png" name="('+sx+','+sy+')"\n>' data += '<input type=image class="goban" src="img/bottomleftline'+stone+'.png" name="('+sx+','+sy+')"\n>'
elif (y == 1): #left line elif (y == 1): #left line
data += '<input type=image id="goban" src="img/leftline'+stone+'.png" name="('+sx+','+sy+')"\n>' data += '<input type=image class="goban" src="img/leftline'+stone+'.png" name="('+sx+','+sy+')"\n>'
elif (x == 1): # top line elif (x == 1): # top line
data += '<input type=image id="goban" src="img/topline'+stone+'.png" name="('+sx+','+sy+')"\n>' data += '<input type=image class="goban" src="img/topline'+stone+'.png" name="('+sx+','+sy+')"\n>'
elif (y == size): # right line elif (y == size): # right line
data += '<input type=image id="goban" src="img/rightline'+stone+'.png" name="('+sx+','+sy+')"\n><br\n>' data += '<input type=image class="goban" src="img/rightline'+stone+'.png" name="('+sx+','+sy+')"\n><br\n>'
elif (x == size): #bottom line elif (x == size): #bottom line
data += '<input type=image id="goban" src="img/bottomline'+stone+'.png" name="('+sx+','+sy+')"\n>' data += '<input type=image class="goban" src="img/bottomline'+stone+'.png" name="('+sx+','+sy+')"\n>'
else: # hoshi or empty inner field else: # hoshi or empty inner field
defaultfield = '<input type=image id="goban" src="img/centerline'+stone+'.png" name="('+sx+','+sy+')"\n>' defaultfield = '<input type=image class="goban" src="img/centerline'+stone+'.png" name="('+sx+','+sy+')"\n>'
#too lazy to make special images for hoshi fields with stones: #too lazy to make special images for hoshi fields with stones:
if gobandict[(x,y)] == 1: if gobandict[(x,y)] == 1:
hoshifield = '<input type=image id="goban" src="img/centerline_white.png" name="('+sx+','+sy+')"\n>' hoshifield = '<input type=image class="goban" src="img/centerline_white.png" name="('+sx+','+sy+')"\n>'
elif gobandict[(x,y)] == 2: elif gobandict[(x,y)] == 2:
hoshifield = '<input type=image id="goban" src="img/centerline_black.png" name="('+sx+','+sy+')"\n>' hoshifield = '<input type=image class="goban" src="img/centerline_black.png" name="('+sx+','+sy+')"\n>'
else: #empty hoshi else: #empty hoshi
hoshifield = '<input type=image id="goban" src="img/hoshi.png" name="('+sx+','+sy+')"\n>' hoshifield = '<input type=image class="goban" src="img/hoshi.png" name="('+sx+','+sy+')"\n>'
if size == 19: # 9 hoshis if size == 19: # 9 hoshis
if (x,y) in hoshis19x19: if (x,y) in hoshis19x19:
data += hoshifield data += hoshifield

View file

@ -64,7 +64,7 @@ def game_overview_form(req,form):
tmp += '<input type="hidden" name="sessionid" value="%s">\n' % sessionid tmp += '<input type="hidden" name="sessionid" value="%s">\n' % sessionid
tmp += '<input type="hidden" name="username" value="%s">\n' % username tmp += '<input type="hidden" name="username" value="%s">\n' % username
tmp += '<input type="hidden" name="game" value="%s">\n' % item tmp += '<input type="hidden" name="game" value="%s">\n' % item
tmp += '<td><input type=submit id="submit" name="play" value="Play"></td>\n' tmp += '<td><input type=submit class="submit" name="play" value="Play"></td>\n'
description = psql.get_description(item) description = psql.get_description(item)
if (description == None) or (description == "None") or (description == ""): if (description == None) or (description == "None") or (description == ""):
description = item description = item
@ -74,7 +74,7 @@ def game_overview_form(req,form):
tmp += '<td>%s</td>\n' % players[1] tmp += '<td>%s</td>\n' % players[1]
tmp += '<td>%s</td>\n' % helper.format_time(psql.get_time(item,"created")) tmp += '<td>%s</td>\n' % helper.format_time(psql.get_time(item,"created"))
tmp += '<td>%s</td>\n' % helper.format_time(psql.get_time(item,"lastmove")) tmp += '<td>%s</td>\n' % helper.format_time(psql.get_time(item,"lastmove"))
tmp += '<td><input type=submit id="submit" name="delete" value="Delete"></td>\n' tmp += '<td><input type=submit class="submit" name="delete" value="Delete"></td>\n'
tmp += '</tr></form>\n' tmp += '</tr></form>\n'
if helper.clean_list(gamelist) != []: if helper.clean_list(gamelist) != []:
tmp += '</table>' tmp += '</table>'
@ -92,13 +92,11 @@ def game_overview_form(req,form):
<form method="post"> <form method="post">
<input type="hidden" name="sessionid" value="%s"> <input type="hidden" name="sessionid" value="%s">
<input type="hidden" name="username" value="%s"> <input type="hidden" name="username" value="%s">
<input type=submit id="submit" name="create" value="Start a new game"> <input type=submit class="submit" name="create" value="Start a new game">
</form> </form>
""" % (sessionid, username) """ % (sessionid, username)
else: else:
data+= "Sorry, all your game slots are in use." data+= "Sorry, all your game slots are in use."
#display "You have ... free game slots" + Button "create game"
#bei "create game neue funktion zum Erstellen + Mitspieler aus Liste auswählen.
data+=helper.footer() data+=helper.footer()
req.write(data) req.write(data)
@ -110,15 +108,15 @@ def login_form():
data = helper.header() + """ data = helper.header() + """
<form method="post"> <form method="post">
<p>Name:<br> <p>Name:<br>
<input name="username" type="text" id="text" size="20"></p> <input name="username" type="text" class="text" size="20"></p>
<p>Password:<br> <p>Password:<br>
<input name="password" type="text" id="text" size="20"></p> <input name="password" type="text" class="text" size="20"></p>
<input type="hidden" name="sessionid" value="%s"> <input type="hidden" name="sessionid" value="%s">
<p><input type="submit" id ="submit" value="login"></p> <p><input type="submit" class="submit" value="login"></p>
</form> </form>
<form method="post"> <form method="post">
<input type="hidden" name="createaccount" value="init"> <input type="hidden" name="createaccount" value="init">
<input type="submit" id="submit" value="create account"> <input type="submit" class="submit" value="create account">
</form> </form>
""" % helper.generate_session_id() """ % helper.generate_session_id()
data += helper.footer() data += helper.footer()
@ -141,9 +139,9 @@ def navigation_bar(req,form):
<input type="hidden" name="username" value="%s"> <input type="hidden" name="username" value="%s">
<input type="hidden" name="sessionid" value="%s"> <input type="hidden" name="sessionid" value="%s">
<input type="hidden" name="game" value="%s"> <input type="hidden" name="game" value="%s">
<input type="submit" id="submit" name="logout" value="logout"> <input type="submit" class="submit" name="logout" value="logout">
<input type="submit" id="submit" name="game overview" value="game overview"> <input type="submit" class="submit" name="game overview" value="game overview">
<input type="submit" id="submit" name="refresh" value="refresh"> <input type="submit" class="submit" name="refresh" value="refresh">
</form> </form>
""" % (username,sessionid,game) """ % (username,sessionid,game)
return(data) return(data)