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'))
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'))
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'))
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())