added web badges

git-svn-id: http://yolanda.mister-muffin.de/svn@364 7eef14d0-6ed0-489d-bf55-20463b2d70db
This commit is contained in:
erlehmann 2008-08-07 18:23:02 +00:00
parent a1877a6894
commit 578ba84952
13 changed files with 100 additions and 69 deletions

View file

@ -1,12 +1,12 @@
from mako import runtime, filters, cache from mako import runtime, filters, cache
UNDEFINED = runtime.UNDEFINED UNDEFINED = runtime.UNDEFINED
_magic_number = 2 _magic_number = 2
_modified_time = 1217192624.700382 _modified_time = 1218131048.479471
_template_filename=u'/home/nils/src/yolanda/trunk/yolanda/templates/xhtml/base.mako' _template_filename=u'/home/nils/src/yolanda/trunk/yolanda/templates/xhtml/base.mako'
_template_uri=u'/xhtml/base.mako' _template_uri=u'/xhtml/base.mako'
_template_cache=cache.Cache(__name__, _modified_time) _template_cache=cache.Cache(__name__, _modified_time)
_source_encoding=None _source_encoding=None
_exports = [] _exports = ['search']
def render_body(context,**pageargs): def render_body(context,**pageargs):
@ -16,31 +16,62 @@ def render_body(context,**pageargs):
h = context.get('h', UNDEFINED) h = context.get('h', UNDEFINED)
self = context.get('self', UNDEFINED) self = context.get('self', UNDEFINED)
# SOURCE LINE 1 # SOURCE LINE 1
context.write(u'<?xml version="1.0" ?>\n<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\n "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n\n<html xmlns="http://www.w3.org/1999/xhtml">\n\n<head>\n\n <meta\n http-equiv="Content-Type"\n content="application/xhtml+xml;charset=utf-8"\n />\n\n <link\n rel="stylesheet"\n type="text/css"\n media="screen"\n href="') context.write(u'<?xml version="1.0" ?>\n<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\n "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n\n')
# SOURCE LINE 18 # SOURCE LINE 16
context.write(u'\n\n<html xmlns="http://www.w3.org/1999/xhtml">\n\n<head>\n\n <meta\n http-equiv="Content-Type"\n content="application/xhtml+xml;charset=utf-8"\n />\n\n <link\n rel="stylesheet"\n type="text/css"\n media="screen"\n href="')
# SOURCE LINE 31
context.write(unicode(h.url_for('/css/default.css'))) context.write(unicode(h.url_for('/css/default.css')))
context.write(u'"\n />\n\n <title>\n Yolanda - ') context.write(u'"\n />\n\n <title>\n Yolanda - ')
# SOURCE LINE 22 # SOURCE LINE 35
context.write(unicode(self.title())) context.write(unicode(self.title()))
context.write(u'\n </title>\n\n</head>\n\n<body>\n\n <div id="heading-box">\n <h1>\n ') context.write(u'\n </title>\n\n</head>\n\n<body>\n\n <div id="heading-box">\n <h1>\n ')
# SOURCE LINE 31
context.write(unicode(self.heading()))
context.write(u'\n </h1>\n </div>\n\n <div id="search-box">\n\n <h1>\n Search all videos\n </h1>\n\n ')
# SOURCE LINE 41
context.write(unicode(h.form(h.url_for('search_results'), method='get')))
context.write(u'\n\n ')
# SOURCE LINE 43
context.write(unicode(h.text_field('query')))
context.write(u'\n ')
# SOURCE LINE 44 # SOURCE LINE 44
context.write(unicode(h.submit('Search'))) context.write(unicode(self.heading()))
context.write(u'\n\n ') context.write(u'\n </h1>\n </div>\n\n ')
# SOURCE LINE 46 # SOURCE LINE 48
context.write(unicode(h.end_form())) context.write(unicode(self.search()))
context.write(u'\n\n </div>\n\n ') context.write(u'\n\n ')
# SOURCE LINE 50 # SOURCE LINE 50
context.write(unicode(self.body())) context.write(unicode(self.body()))
context.write(u'\n\n <div id="copyright">\n <em>Yolanda</em> Copyright &copy; 2007, 2008 <em>The Yolanda Developers</em> &ndash;\n This program comes with <em>absolutely no warranty</em>; for details <a href="">click here</a>.\n This is <em>free software</em>, and you are welcome to redistribute it\n under certain conditions; <a href="">click here</a> for details.\n To view the source code, <a href="">click here</a>. Report bugs <a href="">here</a>.\n </div>\n\n <ul id="antipixel" role="navigation">\n\n <li>\n <a href="http://validator.w3.org/">\n <img alt="XHTML 1.1 logo" class="antipixel" src="" />\n </a>\n </li>\n\n <li>\n <a href="http://jigsaw.w3.org/css-validator/">\n <img alt="CSS logo" class="antipixel" src="" />\n </a>\n </li>\n\n <li>\n <a href="">\n <img alt="Javascript logo" class="antipixel" src="" />\n </a>\n </li>\n\n <li>\n <a href="http://www.theora.org/">\n <img alt="Ogg Theora logo" class="antipixel" src="" />\n </a>\n </li>\n\n </ul>\n\n</body>\n\n</html>\n') context.write(u'\n\n <div id="copyright">\n <em>Yolanda</em> Copyright &copy; 2007, 2008 <em>The Yolanda Developers</em> &ndash;\n This program comes with <em>absolutely no warranty</em>; for details <a href="')
# SOURCE LINE 54
context.write(unicode(h.url_for('license')))
context.write(u'">click here</a>.\n This is <em>free software</em>, and you are welcome to redistribute it\n under certain conditions; <a href="')
# SOURCE LINE 56
context.write(unicode(h.url_for('license')))
context.write(u'">click here</a> for details.\n To view the source code, <a href="">click here</a>. Report bugs <a href="">here</a>.\n </div>\n\n <ul id="antipixel" role="navigation">\n\n <li>\n <a href="http://validator.w3.org/">\n <img alt="XHTML 1.1 logo" class="badge" src="')
# SOURCE LINE 64
context.write(unicode(h.url_for('images/badges/xhtml 1.1.png')))
context.write(u'" />\n </a>\n </li>\n\n <li>\n <a href="http://jigsaw.w3.org/css-validator/">\n <img alt="CSS logo" class="badge" src="')
# SOURCE LINE 70
context.write(unicode(h.url_for('images/badges/css.png')))
context.write(u'" />\n </a>\n </li>\n\n <li>\n <a href="http://www.theora.org/">\n <img alt="Ogg Theora logo" class="badge" src="')
# SOURCE LINE 76
context.write(unicode(h.url_for('images/badges/ogg theora.png')))
context.write(u'" />\n </a>\n </li>\n\n </ul>\n\n</body>\n\n</html>\n')
return ''
finally:
context.caller_stack.pop_frame()
def render_search(context):
context.caller_stack.push_frame()
try:
h = context.get('h', UNDEFINED)
# SOURCE LINE 5
context.write(u'\n <div id="search-box">\n\n ')
# SOURCE LINE 8
context.write(unicode(h.form(h.url_for('search_results'), method='get')))
context.write(u'\n\n ')
# SOURCE LINE 10
context.write(unicode(h.text_field('query')))
context.write(u'\n ')
# SOURCE LINE 11
context.write(unicode(h.submit('Search Videos')))
context.write(u'\n\n ')
# SOURCE LINE 13
context.write(unicode(h.end_form()))
context.write(u'\n\n </div>\n')
return '' return ''
finally: finally:
context.caller_stack.pop_frame() context.caller_stack.pop_frame()

View file

@ -12,19 +12,19 @@ class SearchController(BaseController):
c.query = request.params['query'] c.query = request.params['query']
# c.results dummy # c.results dummy
c.results = [ c.results = [
{'title': 'foobar', 'id': '23' , 'thumbnail': h.url_for('/images/404.png')}, {'title': 'foobar', 'id': '23' , 'thumbnail': h.url_for('/images/404.png')},
{'title': 'blablupp', 'id': '42', 'thumbnail': h.url_for('/images/404.png')}, {'title': 'blablupp', 'id': '42', 'thumbnail': h.url_for('/images/404.png')},
{'title': 'uiae nrdt', 'id': '555' , 'thumbnail': h.url_for('/images/404.png')}, {'title': 'uiae nrdt', 'id': '555' , 'thumbnail': h.url_for('/images/404.png')},
{'title': 'uiaenrtd uiaenrtd uiaenrdt', 'id': '666666666', 'thumbnail': h.url_for('/images/404.png')}, {'title': 'uiaenrtd uiaenrtd uiaenrdt', 'id': '666666666', 'thumbnail': h.url_for('/images/404.png')},
{'title': 'foobar', 'id': '23' , 'thumbnail': h.url_for('/images/404.png')}, {'title': 'foobar', 'id': '23' , 'thumbnail': h.url_for('/images/404.png')},
{'title': 'blablupp', 'id': '42', 'thumbnail': h.url_for('/images/404.png')}, {'title': 'blablupp', 'id': '42', 'thumbnail': h.url_for('/images/404.png')},
{'title': 'James Bond drives a bulletproof Aston Martin !!!', 'id': '555' , 'thumbnail': h.url_for('/images/404.png')}, {'title': 'James Bond drives a bulletproof Aston Martin !!!', 'id': '555' , 'thumbnail': h.url_for('/images/404.png')},
{'title': 'uiaenrtd uiaenrtd uiaenrdt uiaenrtd uiaenrtd', 'id': '666666666', 'thumbnail': h.url_for('/images/404.png')}, {'title': 'uiaenrtd uiaenrtd uiaenrdt uiaenrtd uiaenrtd', 'id': '666666666', 'thumbnail': h.url_for('/images/404.png')},
{'title': 'foobar', 'id': '123' , 'thumbnail': h.url_for('/images/404.png')}, {'title': 'foobar', 'id': '123' , 'thumbnail': h.url_for('/images/404.png')},
{'title': 'blablupp', 'id': '42', 'thumbnail': h.url_for('/images/404.png')}, {'title': 'blablupp', 'id': '42', 'thumbnail': h.url_for('/images/404.png')},
{'title': 'lolwtf hax !!!11', 'id': '9001', 'thumbnail': h.url_for('/images/404.png')} {'title': 'lolwtf hax !!!11', 'id': '9001', 'thumbnail': h.url_for('/images/404.png')}
] ]
return render('/xhtml/results.mako') return render('/xhtml/results.mako')
# return request.params['query'] # return request.params['query']

Binary file not shown.

View file

@ -7,6 +7,11 @@ log = logging.getLogger(__name__)
class VideoController(BaseController): class VideoController(BaseController):
def index(self): def index(self):
c.video = {
'title': 'foobar',
'description': 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nullam sapien mauris, venenatis at, fermentum at, tempus eu, urna.' ,
'preview': h.url_for('/images/404.png')
}
return 'show a video html page' return 'show a video html page'
def file(self): def file(self):

Binary file not shown.

View file

@ -12,15 +12,6 @@ body
text-align: center; text-align: center;
} }
div
{
background-color: #eeeeec;
color: black;
border: 1px solid black;
margin: 0.5em;
padding: 0.5em;
}
form form
{ {
padding: 0.5em; padding: 0.5em;
@ -58,6 +49,7 @@ ol, ul[role="navigation"]
ol#results li ol#results li
{ {
display: inline-block; display: inline-block;
font-weight: bold;
padding: 0.5em; padding: 0.5em;
vertical-align: top; vertical-align: top;
width: 227px; width: 227px;
@ -68,12 +60,12 @@ ol, ul[role="navigation"]
border: 1px solid black; border: 1px solid black;
} }
#antipixel li, #footer li #badge li, #footer li
{ {
display: inline-block; display: inline-block;
} }
#antipixel li #badge li
{ {
padding: 0.5em; padding: 0.5em;
} }
@ -91,6 +83,11 @@ ol, ul[role="navigation"]
#heading-box, #search-box #heading-box, #search-box
{ {
background-color: #eeeeec;
color: black;
border: 1px solid black;
margin: 0.5em;
padding: 0.5em;
clear: right; clear: right;
float: right; float: right;
width: 15em; width: 15em;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 9.3 KiB

View file

@ -0,0 +1,4 @@
Web badges
License: GPL
Source: from http://www.zwahlendesign.ch/en/node/19

Binary file not shown.

After

Width:  |  Height:  |  Size: 724 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 794 B

View file

@ -2,6 +2,19 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%def name="search()">
<div id="search-box">
${h.form(h.url_for('search_results'), method='get')}
${h.text_field('query')}
${h.submit('Search Videos')}
${h.end_form()}
</div>
</%def>
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
@ -32,28 +45,15 @@
</h1> </h1>
</div> </div>
<div id="search-box"> ${self.search()}
<h1>
Search all videos
</h1>
${h.form(h.url_for('search_results'), method='get')}
${h.text_field('query')}
${h.submit('Search')}
${h.end_form()}
</div>
${self.body()} ${self.body()}
<div id="copyright"> <div id="copyright">
<em>Yolanda</em> Copyright &copy; 2007, 2008 <em>The Yolanda Developers</em> &ndash; <em>Yolanda</em> Copyright &copy; 2007, 2008 <em>The Yolanda Developers</em> &ndash;
This program comes with <em>absolutely no warranty</em>; for details <a href="">click here</a>. This program comes with <em>absolutely no warranty</em>; for details <a href="${h.url_for('license')}">click here</a>.
This is <em>free software</em>, and you are welcome to redistribute it This is <em>free software</em>, and you are welcome to redistribute it
under certain conditions; <a href="">click here</a> for details. under certain conditions; <a href="${h.url_for('license')}">click here</a> for details.
To view the source code, <a href="">click here</a>. Report bugs <a href="">here</a>. To view the source code, <a href="">click here</a>. Report bugs <a href="">here</a>.
</div> </div>
@ -61,25 +61,19 @@
<li> <li>
<a href="http://validator.w3.org/"> <a href="http://validator.w3.org/">
<img alt="XHTML 1.1 logo" class="antipixel" src="" /> <img alt="XHTML 1.1 logo" class="badge" src="${h.url_for('images/badges/xhtml 1.1.png')}" />
</a> </a>
</li> </li>
<li> <li>
<a href="http://jigsaw.w3.org/css-validator/"> <a href="http://jigsaw.w3.org/css-validator/">
<img alt="CSS logo" class="antipixel" src="" /> <img alt="CSS logo" class="badge" src="${h.url_for('images/badges/css.png')}" />
</a>
</li>
<li>
<a href="">
<img alt="Javascript logo" class="antipixel" src="" />
</a> </a>
</li> </li>
<li> <li>
<a href="http://www.theora.org/"> <a href="http://www.theora.org/">
<img alt="Ogg Theora logo" class="antipixel" src="" /> <img alt="Ogg Theora logo" class="badge" src="${h.url_for('images/badges/ogg theora.png')}" />
</a> </a>
</li> </li>