From b82919b8c9b99fd046135d4dc6ed1965c2fa2c23 Mon Sep 17 00:00:00 2001 From: Jon Wood Date: Sat, 25 May 2024 17:51:49 +0000 Subject: [PATCH] Changelog page to review all proposal changes --- apps/cfp_review/base.py | 12 +++++ templates/cfp_review/_nav.html | 1 + templates/cfp_review/proposal_versions.html | 50 +++++++++++++++++++++ 3 files changed, 63 insertions(+) create mode 100644 templates/cfp_review/proposal_versions.html diff --git a/apps/cfp_review/base.py b/apps/cfp_review/base.py index 6eae779c7..a06529361 100644 --- a/apps/cfp_review/base.py +++ b/apps/cfp_review/base.py @@ -24,6 +24,7 @@ from models.permission import Permission from sqlalchemy import func, exists, select from sqlalchemy.orm import joinedload, undefer +from sqlalchemy_continuum.utils import version_class from main import db, external_url from .estimation import get_cfp_estimate @@ -668,6 +669,17 @@ def message_proposer(proposal_id): ) +@cfp_review.route("/proposals/versions") +@admin_required +def proposal_versions(): + size = int(request.args.get("size", "100")) + version_cls = version_class(Proposal) + versions = version_cls.query.order_by(version_cls.modified.desc()) + paged_versions = db.paginate(versions, per_page=size, error_out=False) + + return render_template("cfp_review/proposal_versions.html", versions=paged_versions) + + @cfp_review.route("/proposals//versions") @admin_required def proposal_latest_version(proposal_id): diff --git a/templates/cfp_review/_nav.html b/templates/cfp_review/_nav.html index 778e47055..814f21260 100644 --- a/templates/cfp_review/_nav.html +++ b/templates/cfp_review/_nav.html @@ -33,6 +33,7 @@ {{ menuitem('Manual Review', ".proposals", proposal_counts['manual-review'], state='manual-review')}} {{ menuitem('Summary', ".proposals_summary")}} + {{ menuitem('Changelog', ".proposal_versions" )}}