This is an automated email from the ASF dual-hosted git repository.

gstein pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/steve.git

commit ae6f6ca25559f1c64fd7821e77e8fbc0b4b6de1a
Author: Greg Stein <[email protected]>
AuthorDate: Mon Dec 22 19:31:25 2025 -0600

    add new route for managing an STV issue
---
 v3/server/pages.py | 33 ++++++++++++++++++++++++++++++---
 1 file changed, 30 insertions(+), 3 deletions(-)

diff --git a/v3/server/pages.py b/v3/server/pages.py
index f698bbd..cb81293 100644
--- a/v3/server/pages.py
+++ b/v3/server/pages.py
@@ -268,9 +268,7 @@ async def manage_page(election):
 
     md = election.get_metadata()
     result.e_title = md[1]
-
-    state = election.get_state()
-    result.e_state = state
+    result.e_state = md[2]
 
     result.issues = election.list_issues()
     result.issue_count = len(result.issues)
@@ -278,6 +276,34 @@ async def manage_page(election):
     return result
 
 
[email protected]('/manage-stv/<eid>/<iid>')
[email protected]({R.committer})  ### need general solution
+@load_election_issue
[email protected]_template(TEMPLATES / 'manage-stv.ezt')
+async def manage_stv_page(election, issue):
+    if issue.vtype != 'stv':
+        # This page is just for STV issues. Redirect to the Election
+        # management page.
+        return quart.redirect(f'/manage/{election.eid}', code=303)
+
+    result = await basic_info()
+    result.title = 'Manage an STV Issue'
+    result.eid = election.eid
+    result.issue = issue
+
+    md = election.get_metadata()
+    result.e_title = md[1]
+    result.e_state = md[2]
+
+    kv = edict(issue.kv)
+    result.seats = kv.seats
+
+    ### list of candidates. see KV.LABELMAP
+    #result.count = len(result.candidates)
+
+    return result
+
+
 @APP.post('/do-create-election')
 @asfquart.auth.require({R.pmc_member})  ### need general solution
 async def do_create_endpoint():
@@ -357,6 +383,7 @@ async def do_add_issue_endpoint(election):
     ### do better with these
     vtype = 'yna'
     kv = None
+    ### for STV, there is a SEATS form parameter. Create empty LABELMAP.
 
     iid = election.add_issue(form.title, form.description, vtype, kv)
 

Reply via email to