def view(): reference_code = post_get('reference_code') entry = check_submission(reference_code) if entry: return skeleton(bottle.template('edit_form', var=entry)) else: return check_code(var="Sorry, your code seems invalid!")
def index(): return skeleton(bottle.template('welcome')) """Only authenticated users can see this""" # session = bottle.request.environ.get('beaker.session') # aaa.require(fail_redirect='/login') return 'Hi! <a href="/admin">Admin page</a> <a href="/logout">Logout</a>'
def submit(): reference_code = hash( post_get('title') + str(post_get('authors')) + settings['salt']) subm = Submission({ 'reference_code': reference_code, 'title': post_get('title'), 'authors': post_get('authors'), 'affiliations': post_get('affils'), 'contact': post_get('contact'), 'text': post_get('text'), 'references': post_get('ref'), 'figurl': post_get('figurl'), 'table': post_get('table'), 'caption': post_get('caption') }) db.save(subm) tex.parse(subm) return skeleton(bottle.template('submit_message', var=reference_code))
def submit(): reference_code = hash(post_get('title') + str(post_get('authors')) + settings['salt']) subm = Submission({ 'reference_code': reference_code, 'title': post_get('title'), 'authors': post_get('authors'), 'affiliations': post_get('affils'), 'contact': post_get('contact'), 'text': post_get('text'), 'references': post_get('ref'), 'figurl': post_get('figurl'), 'table': post_get('table'), 'caption': post_get('caption') }) db.save(subm) tex.parse(subm) return skeleton(bottle.template('submit_message', var=reference_code))
def check_code(var=None): return skeleton(bottle.template('code_form', var=var))
def show_submit(): return skeleton(bottle.template('submit_form'))
def login_form(): """Serve login form""" return skeleton(bottle.template('login_form'))