im wortschlucker.py rumgesaut, damit das mit den statischen Objekten klappt. Und angefangen, dass layout anzupassen.

This commit is contained in:
phear 2010-04-15 15:44:53 +00:00
parent a71aa83385
commit f276c11aeb
8 changed files with 142 additions and 15 deletions

Binary file not shown.

View file

@ -7,7 +7,7 @@
<title py:with="title = list(select('title/text()'))"> <title py:with="title = list(select('title/text()'))">
WortSchlucker<py:if test="title">: ${title}</py:if> WortSchlucker<py:if test="title">: ${title}</py:if>
</title> </title>
<link rel="stylesheet" href="${base_url}static/media/style.css" type="text/css" /> <link rel="stylesheet" href="${base_url}media/style.css" type="text/css" />
<script type="text/javascript" src="${base_url}media/jquery.js"></script> <script type="text/javascript" src="${base_url}media/jquery.js"></script>
${select('*[local-name()!="title"]')} ${select('*[local-name()!="title"]')}
</head> </head>
@ -26,11 +26,11 @@
</ul> </ul>
</div> </div>
<!-- end #menu --> <!-- end #menu -->
<div id="search"> <div class="search">
<form method="get" action=""> <form method="get" action="">
<fieldset> <fieldset>
<input type="text" name="s" id="search-text" size="15" /> <input type="text" name="s" class="search-text" size="15" />
<input type="submit" id="search-submit" value="GO" /> <input type="submit" class="search-submit" value="GO" />
</fieldset> </fieldset>
</form> </form>
</div> </div>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View file

@ -0,0 +1,73 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="220"
height="28"
id="svg8460"
version="1.1"
inkscape:version="0.47 r22583"
sodipodi:docname="Neues Dokument 20">
<defs
id="defs8462">
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 526.18109 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="744.09448 : 526.18109 : 1"
inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
id="perspective8468" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="1"
inkscape:pageshadow="2"
inkscape:zoom="3.959798"
inkscape:cx="102.05522"
inkscape:cy="-28.643527"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1276"
inkscape:window-height="976"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1" />
<metadata
id="metadata8465">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Ebene 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-1024.3622)">
<rect
style="fill:none;stroke:#000000;stroke-width:1.5;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
id="rect8470"
width="218.24493"
height="26.380983"
x="1.0407906"
y="0.93110955"
ry="12.811685"
transform="translate(0,1024.3622)" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

View file

@ -134,29 +134,29 @@ hr { display: none; }
} }
/* Search */ /* Search */
#search { .search {
float: right; float: right;
padding: 10px 10px 0px 0px; padding: 10px 10px 0px 0px;
} }
#search form { .search form {
float: right; float: right;
margin: 0; margin: 0;
padding: 4px 0px 0 0; padding: 4px 0px 0 0;
} }
#search fieldset { .search fieldset {
margin: 0; margin: 0;
padding: 0; padding: 0;
border: none; border: none;
} }
#search input { .search input {
float: left; float: left;
font: 12px Georgia, "Times New Roman", Times, serif; font: 12px Georgia, "Times New Roman", Times, serif;
} }
#search-text { .search-text {
width: 213px; width: 213px;
height: 28px; height: 28px;
padding: 6px 0 0 7px; padding: 6px 0 0 7px;
@ -165,7 +165,15 @@ hr { display: none; }
color: #000000; color: #000000;
} }
#search-submit { .form-entry {
width: 213px;
height: 28px;
padding: 6px 0 0 7px;
border: none;
background: url(images/form-entry.png) no-repeat left top;
color: #000000;
}
.search-submit {
width: 82px; width: 82px;
height: 28px; height: 28px;
margin-left: 10px; margin-left: 10px;

View file

@ -21,9 +21,9 @@
<h2>Submit something</h2> <h2>Submit something</h2>
<form action="${poll.get_submit_url()}" method="post"> <form action="${poll.get_submit_url()}" method="post">
<ul> <ul>
<li><label for="submitter">Submitter:</label><input type="text" id="submitter" name="submitter" /> <li><label for="submitter">Submitter:</label><input type="text" id="submitter" class="form-entry" name="submitter" />
<span py:if="'submitter' in errors" class="error">${errors.submitter}</span></li> <span py:if="'submitter' in errors" class="error">${errors.submitter}</span></li>
<li><label for="content">New content:</label><input type="text" id="content" name="content" /> <li><label for="content">New content:</label><input type="text" id="content" class="form-entry" name="content" />
<span py:if="'content' in errors" class="error">${errors.content}</span></li> <span py:if="'content' in errors" class="error">${errors.content}</span></li>
</ul> </ul>
<input type="submit" name="submit" value="Submit" /> <input type="submit" name="submit" value="Submit" />

View file

@ -9,20 +9,21 @@
</head> </head>
<body> <body>
<h1>New poll</h1> <h1>New poll</h1>
<form action="" method="post"> <form action="" method="post">
<p> <p>
<label for="author">Your name:</label> <label for="author">Your name:</label>
<input type="text" id="author" name="author" /> <input type="text" id="author" class="form-entry" name="author" />
<span py:if="'author' in errors" class="error">${errors.author}</span> <span py:if="'author' in errors" class="error">${errors.author}</span>
</p> </p>
<p> <p>
<label for="title">Poll name:</label> <label for="title">Poll name:</label>
<input type="text" id="title" name="title" /> <input type="text" id="title" class="form-entry" name="title" />
<span py:if="'title' in errors" class="error">${errors.title}</span> <span py:if="'title' in errors" class="error">${errors.title}</span>
</p> </p>
<p> <p>
<label for="description">Description:</label> <label for="description">Description:</label>
<input type="text" id="description" name="description" /> <input type="text" id="description" class="form-entry" name="description" />
<span py:if="'description' in errors" class="error">${errors.description}</span> <span py:if="'description' in errors" class="error">${errors.description}</span>
</p> </p>
<p> <p>

View file

@ -14,6 +14,8 @@ import formencode
import uuid import uuid
import datetime import datetime
import os import os
import mimetypes
import webob
db_filename = "database.sqlite" db_filename = "database.sqlite"
db_filename = os.path.abspath(db_filename) db_filename = os.path.abspath(db_filename)
@ -326,6 +328,49 @@ for table in (Poll, ContentSubmission, PollSetting):
for poll in Poll.select(): for poll in Poll.select():
print poll print poll
####### Ab hier hat m rumgesaut
### das ist natuerlich voellig falsch, aber so kann ich schnell mit dem Layout anfangen.
### Aender es also ruhig ab!
@bobo.query('/media/:pathname')
def statische_sachen(pathname):
response = webob.Response()
content_type = mimetypes.guess_type(pathname)[0]
if content_type is not None:
response.content_type = content_type
try:
response.body = open("templates/media/"+pathname).read()
except IOError:
raise bobo.NotFound
return response
@bobo.query('/media/images/:pathname')
def statische_sachen2(pathname):
response = webob.Response()
content_type = mimetypes.guess_type(pathname)[0]
if content_type is not None:
response.content_type = content_type
try:
response.body = open("templates/media/images/"+pathname).read()
except IOError:
raise bobo.NotFound
return response
####### bis hier hier hat m rumgesaut
# this line allows to use wortschlucker with mod_wsgi # this line allows to use wortschlucker with mod_wsgi
# see: http://groups.google.com/group/bobo-web/msg/2ba55fc381658cd1 # see: http://groups.google.com/group/bobo-web/msg/2ba55fc381658cd1
#application = bobo.Application(bobo_resources=__name__) #application = bobo.Application(bobo_resources=__name__)