示例#1
0
文件: webapp.py 项目: sandhawke/riftr
def startPage(title):
    global page
    if page == None:

        print "Content-Type: text/html; charset=utf-8\n"
        page = h.Document()
        page.head.append(h.title(title))
        page.head << h.stylelink("http://validator.w3.org/base.css")
示例#2
0
def gen_html():
    if "id" in form:
        body = single_message()
    else:
        body = list_messages()

    return html.html(
        html.head(html.title("a858 auto-analysis"),
                  html.script(language='javascript', src='functions.js')),
        body)
示例#3
0
def test():
    h = html.HDoc()

    h.addHead(html.title("Bob Page"))
    h.addScript("referurl_dialog.js")

    h.add(html.h1("Test page"))
    h.add(html.p("Is this working now?"))

    eq_("".join(h), '<!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html;charset=utf-8" /><title>Bob Page</title>\n<script type="text/javascript" src="referurl_dialog.js"></script>\n</head>\n<body><h1>Test page</h1>\n<p>Is this working now?</p>\n</body></html>')
示例#4
0
def gen_html():
	if "id" in form:
		body = single_message()
	else:
		body = list_messages()

	return html.html(
		html.head(
			html.title("a858 auto-analysis"),
			html.script(language='javascript', src='functions.js')
		),
		body
	)
示例#5
0
def html_page(title, *content, **arguments):
    head = html.head(
        html.link(rel="shortcut icon", href=config["favicon"]),
        html.title("{} - {}".format(title, config["title"])),
        html.style(style),
    )
    nav = html.nav(
        html.ul(
            html.li(html.a("⚗", href=html.absolute())),
            html.li(html.a("Reviews", href=html.absolute("reviews"))),
            html.li(html.a("Commits", href=html.absolute("commits", repo.head.ref.name))),
            html.li(html.a("Tree", href=html.absolute("tree", repo.head.ref.name))),
            html.li(html.a("Refs", href=html.absolute("refs"))),
        )
    )
    return http.Html(html.html(head, html.body(*((nav,) + content + (html.script(script),)), **arguments)))