def judge(category_id): annotator = get_current_annotator() if annotator is None: return render_template('logged_out.html', content=utils.render_markdown( settings.LOGGED_OUT_MESSAGE)) else: annotator_category = annotator.get_category(category_id) if annotator_category is None: return utils.user_error('AnnotatorCategory %s not found ' % category_id) if not annotator_category.category.active: return render_template('closed.html', content=utils.render_markdown( settings.CLOSED_MESSAGE)) maybe_init_annotator(annotator, annotator_category) if annotator_category.next is None: return render_template('wait.html', content=utils.render_markdown( settings.WAIT_MESSAGE)) elif annotator_category.prev is None: return render_template('begin.html', item=annotator_category.next, category=annotator_category.category) else: return render_template('vote.html', prev=annotator_category.prev, next=annotator_category.next, category=annotator_category.category)
def index(): annotator = get_current_annotator() if annotator is None: return render_template( 'logged_out.html', content=utils.render_markdown(settings.LOGGED_OUT_MESSAGE) ) else: if Setting.value_of(SETTING_CLOSED) == SETTING_TRUE: return render_template( 'closed.html', content=utils.render_markdown(settings.CLOSED_MESSAGE) ) if not annotator.active: return render_template( 'disabled.html', content=utils.render_markdown(settings.DISABLED_MESSAGE) ) if not annotator.read_welcome: return redirect(url_for('welcome')) maybe_init_annotator() if annotator.next is None: return render_template( 'wait.html', content=utils.render_markdown(settings.WAIT_MESSAGE) ) elif annotator.prev is None: return render_template('begin.html', item=annotator.next) else: return render_template('vote.html', prev=annotator.prev, next=annotator.next)
def index(): annotator = get_current_annotator() if annotator is None: return render_template('logged_out.html', content=utils.render_markdown( settings.LOGGED_OUT_MESSAGE)) else: if Setting.value_of(SETTING_CLOSED) == SETTING_TRUE: return render_template('closed.html', content=utils.render_markdown( settings.CLOSED_MESSAGE)) if not annotator.active: return render_template('disabled.html', content=utils.render_markdown( settings.DISABLED_MESSAGE)) if not annotator.read_welcome: return redirect(url_for('welcome')) categories = [ ac.category for ac in annotator.categories if ac.category.active ] if len(categories) == 1: return redirect(url_for('judge', category_id=categories[0].id)) if len(categories) == 0: return render_template('closed.html', content=utils.render_markdown( settings.CLOSED_MESSAGE)) return render_template('categories.html', categories=categories)
def index(): annotator = get_current_annotator() if annotator is None: return render_template( 'logged_out.html', content=utils.render_markdown(settings.LOGGED_OUT_MESSAGE) ) else: if Setting.value_of(SETTING_CLOSED) == SETTING_TRUE: return render_template( 'closed.html', content=utils.render_markdown(settings.CLOSED_MESSAGE) ) if not annotator.active: return render_template( 'disabled.html', content=utils.render_markdown(settings.DISABLED_MESSAGE) ) if not annotator.read_welcome: return redirect(url_for('welcome')) maybe_init_annotator(annotator) if annotator.next is None: return render_template( 'wait.html', content=utils.render_markdown(settings.WAIT_MESSAGE) ) elif annotator.prev is None: return render_template('begin.html', item=annotator.next) else: return render_template('vote.html', prev=annotator.prev, next=annotator.next)
def index(): annotator = get_current_annotator() if annotator is None: return render_template('logged_out.html', content=utils.render_markdown( settings.LOGGED_OUT_MESSAGE)) else: if Setting.value_of(SETTING_CLOSED) == SETTING_TRUE: return render_template('closed.html', content=utils.render_markdown( settings.CLOSED_MESSAGE)) if not annotator.active: return render_template('disabled.html', content=utils.render_markdown( settings.DISABLED_MESSAGE)) if not annotator.read_welcome: return redirect(url_for('welcome')) maybe_init_annotator(annotator) if annotator.next is None: return render_template('wait.html', content=utils.render_markdown( settings.WAIT_MESSAGE)) elif annotator.prev is None: time = Setting.by_key("start_time").value return render_template('begin.html', start_time=time, item=annotator.next) else: query = Decision.query.filter_by(annotator_id=annotator.id) if query.count() > 0: time = max(Decision.query.filter_by(annotator_id=annotator.id), key=lambda d: d.time).time else: time = Setting.by_key("start_time").value return render_template('vote.html', start_time=time, prev=annotator.prev, next=annotator.next)
def welcome(): return render_template( 'welcome.html', content=utils.render_markdown(settings.WELCOME_MESSAGE) )
def welcome(): return render_template( 'welcome.html', content=utils.render_markdown(settings.WELCOME_MESSAGE) )