def generate_html_gallery( person_suite ):
doc, tag, text = Doc().tagtext()
doc.asis('<!DOCTYPE html>')
with tag('html', lang="en"):
with tag('head'):
doc.asis('<meta charset="utf-8">')
doc.asis('<meta name="viewport" content="width=device-width, initial-scale=1">')
doc.asis('<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">')
with tag('script', src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"):
pass
with tag('script', src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"):
pass
with tag('body'):
with tag('div', klass="container-fluid"):
for person in person_suite:
print("Adding photos for user {0}".format(person.uid))
with tag('div', klass='row'):
for photo in person.photos:
with tag('div', klass="col-xs-1", style="padding-left: 5px; padding-right: 5px; padding-top: 5px; padding-bottom: 5px;"):
with tag('p'):
with tag('a', href=person.profile_url, target="_blank"):
doc.stag('img', src=photo, height="175", width="175")
return indent(doc.getvalue())
评论列表
文章目录