From 9f22717adc3a99285e7e070f730ff9ca36f13432 Mon Sep 17 00:00:00 2001 From: hmo Date: Thu, 23 Apr 2026 18:30:00 +0800 Subject: [PATCH] feat: add goal management section to student detail page --- app/__init__.py | 7 ++ app/templates/student.html | 159 ++++++++++++++++++++++++++++++++++++- 2 files changed, 165 insertions(+), 1 deletion(-) diff --git a/app/__init__.py b/app/__init__.py index ffeea74..1f27be3 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -39,11 +39,18 @@ def create_app(): app.register_blueprint(main_bp) app.register_blueprint(templates_bp) app.register_blueprint(goals_bp) + from app.routes import student_goals + app.register_blueprint(student_goals.student_goals_bp) # 创建数据库和目录 with app.app_context(): os.makedirs(os.path.join(BASE_DIR, "data"), exist_ok=True) os.makedirs(app.config["PDF_OUTPUT_DIR"], exist_ok=True) + + # 确保所有模型都被导入 + from app.models import Student, Problem, StudentProblem, Template, PracticePlan + from app.models import Goal, GoalRelation, StudentGoal # 新增目标相关模型 + db.create_all() # 简单迁移:为已存在的数据库添加新字段(必须在init_default_templates之前) diff --git a/app/templates/student.html b/app/templates/student.html index bcd8c6c..bb1cf5a 100644 --- a/app/templates/student.html +++ b/app/templates/student.html @@ -56,6 +56,19 @@ + +
+
+
🎯 练习目标
+ +
+
+
+
+
+
练习方案
@@ -238,19 +251,57 @@
+ + + {% endblock %} {% block extra_js %}