Skip to content

Commit

Permalink
Allow filtering of types in sense check
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonty committed May 20, 2024
1 parent 356e3b8 commit 6706f10
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
8 changes: 6 additions & 2 deletions apps/cfp_review/sense_check.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from datetime import timedelta

from flask import render_template
from flask import render_template, request

from models import event_start, event_end
from models.cfp import Proposal
Expand Down Expand Up @@ -97,9 +97,13 @@ def _check_timing(t, note, reason_key):
@cfp_review.route("/sense_check")
@review_required
def sense_check():
types_to_show = request.args.getlist("type")
if not types_to_show:
types_to_show = ["talk", "workshop", "youthworkshop", "performance"]

accepted_proposals = (
Proposal.query_accepted(include_user_scheduled=False)
.filter(Proposal.type.in_(["talk", "workshop", "youthworkshop", "performance"]))
.filter(Proposal.type.in_(types_to_show))
.order_by(Proposal.type)
.all()
)
Expand Down
9 changes: 9 additions & 0 deletions templates/cfp_review/sense_check.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
{% block body %}
<h2>Schedule Sense Check</h2>

<p>
Show:
<a href="{{ url_for('cfp_review.sense_check') }}">All</a> /
<a href="{{ url_for('cfp_review.sense_check', type='talk') }}">Talk</a> /
<a href="{{ url_for('cfp_review.sense_check', type='workshop') }}">Workshop</a> /
<a href="{{ url_for('cfp_review.sense_check', type='youthworkshop') }}">Youth Workshop</a> /
<a href="{{ url_for('cfp_review.sense_check', type='performance') }}">Performance</a>
</p>

<p>Checked {{ proposals_count }} proposals, found {{ not_sensible_proposals|length }} suspect proposals.</p>

{% if not_sensible_proposals|length > 0 %}
Expand Down

0 comments on commit 6706f10

Please sign in to comment.