diff --git a/app/routers/admin.py b/app/routers/admin.py index 4ff71b8..0190d0f 100644 --- a/app/routers/admin.py +++ b/app/routers/admin.py @@ -244,6 +244,7 @@ def voting_admin(request: Request, db: Session = Depends(get_db)): "config": config, "results": results, "total_votes": total_votes, + "server_time": datetime.now().strftime("%H:%M:%S"), "error": None, "success": None, }, @@ -261,6 +262,8 @@ def update_voting_config( _require_admin(request) config = _get_or_create_config(db) + now_str = datetime.now().strftime("%H:%M:%S") + try: datetime.strptime(start_time, "%H:%M") datetime.strptime(end_time, "%H:%M") @@ -273,6 +276,7 @@ def update_voting_config( "config": config, "results": results, "total_votes": sum(r["votes"] for r in results), + "server_time": now_str, "error": "Formato de hora inválido. Use HH:MM", "success": None, }, @@ -288,6 +292,7 @@ def update_voting_config( "config": config, "results": results, "total_votes": sum(r["votes"] for r in results), + "server_time": now_str, "error": "La hora de inicio debe ser anterior a la hora de fin", "success": None, }, @@ -307,6 +312,7 @@ def update_voting_config( "config": config, "results": results, "total_votes": sum(r["votes"] for r in results), + "server_time": now_str, "error": None, "success": "Configuración guardada", }, diff --git a/app/templates/admin/voting.html b/app/templates/admin/voting.html index 864c54a..ff10838 100644 --- a/app/templates/admin/voting.html +++ b/app/templates/admin/voting.html @@ -54,12 +54,15 @@ -