示例#1
0
def template_upload_form(p, short_code):
    with p(html.form({u'enctype':u'multipart/form-data',u'action':upload.url()})):
        p(u'Please upload a properly formatted CSV')
        p(html.br())
        p(html.input_text(u'short_code', short_code))
        p(html.input_file(name=u'csv'))
        p(html.input_submit(value=u'Upload'))
示例#2
0
文件: web_raven.py 项目: jperla/raven
def template_ask_matrix(p, id, figure, answer, choices):
    with p(html.html()):
        with p(html.head()):
            p(html.title('Answer a matrix'))
    with p(html.body()):
        p(html.p(html.img(matrix_guess.url(id))))
        choice_html = [helper_choice(figure, c) 
                        for c in choices] + [helper_choice(figure, answer)]
        numpy.random.shuffle(choice_html)
        with p(html.form()):
            for c in choice_html:
                p.sub(c)
            p(html.input_submit(value='Answer'))
示例#3
0
文件: __init__.py 项目: jperla/webify
def hello_template(p, name):
    with p(html.form(action=u'', method='GET')):
        p(u'Hello, %s! <br />' % name)
        p(u'Your name: %s' % html.input_text('name'))
        p(html.input_submit('name'))
示例#4
0
文件: finance.py 项目: jperla/finance
def partial_search_box(t, ticker):
    with t(html.div()):
        with t(html.form(attrs={'action':index.url()})):
            t(html.input_text('ticker', ticker))
            t(html.input_submit())