diff --git a/app/app/routers/student_profiles.py b/app/app/routers/student_profiles.py
index 85dc68a..afe991b 100644
--- a/app/app/routers/student_profiles.py
+++ b/app/app/routers/student_profiles.py
@@ -12,7 +12,7 @@ from ..api_utils import (
payload_to_teacher,
read_register_payload,
)
-from ..auth import verify_admin_auth, verify_student_profiles_auth
+from ..auth import verify_admin_auth, verify_any_auth, verify_student_profiles_auth
from ..config import (
ACCOUNTS_PATH,
ADMIN_TASKS_PATH,
@@ -176,7 +176,7 @@ def students(
@router.get("/api/students/{student}")
-def student_detail(student: str, _user: str = Depends(verify_student_profiles_auth)):
+def student_detail(student: str, _user: str = Depends(verify_any_auth)):
for student_profile in load_student_profiles():
if student_profile.student == student or student_profile.student_id == student:
return student_profile_to_dict(student_profile)
diff --git a/app/app/static/app.js b/app/app/static/app.js
index 7ea9c6e..5fa6b07 100644
--- a/app/app/static/app.js
+++ b/app/app/static/app.js
@@ -50,7 +50,6 @@ let currentRecordOrder = [];
let correctedRecords = new Map();
let correctedRecordOrder = [];
let expandedSummaryRecords = new Set();
-let expandedSummaryBodies = new Set();
let collapsedTeacherGroups = new Set();
let currentRecordPage = { query: "", offset: 0, limit: 0, total: 0, shown: 0, hasMore: false };
let activeCorrectionKey = "";
@@ -244,16 +243,7 @@ function renderRecordRow(row, rowNumber) {
`;
}
-function summaryBodyKey(recordKey, index) {
- return `${recordKey}:${index}`;
-}
-
-function summaryPreviewText(value) {
- const text = String(value || "暂无正文");
- return text.length > 120 ? `${text.slice(0, 120)}...` : text;
-}
-
-function renderSummaryEntry(summary, recordKey, index) {
+function renderSummaryEntry(summary) {
const title = summary.title || "课程小结";
const time = summary.time_range ? ` · ${summary.time_range}` : "";
const meta = [
@@ -261,15 +251,11 @@ function renderSummaryEntry(summary, recordKey, index) {
summary.teacher || "",
summary.subject || "",
].filter(Boolean).join(" · ");
- const bodyKey = summaryBodyKey(recordKey, index);
const body = summary.body || "暂无正文";
- const expanded = expandedSummaryBodies.has(bodyKey);
- const canToggle = body.length > 120;
return `
${escapeHtml(title)}${escapeHtml(time)}
${meta ? `
${escapeHtml(meta)}
` : ""}
-
${escapeHtml(expanded ? body : summaryPreviewText(body))}
- ${canToggle ? `
` : ""}
+
${escapeHtml(body)}
`;
}
@@ -300,7 +286,7 @@ function renderGroupedRecords(records) {
const summaryCount = Number(row.summary_count || 0);
const summaryRow = summaryCount
? `
- | ${(row.summaries || []).map((summary, index) => renderSummaryEntry(summary, row._recordKey, index)).join("")} |
+ ${(row.summaries || []).map((summary) => renderSummaryEntry(summary)).join("")} |
`
: renderSummaryMissingRow(row._recordKey, expandedSummaryRecords.has(row._recordKey));
return `${renderRecordRow(row, displayIndex)}${summaryRow}`;
@@ -341,15 +327,6 @@ function toggleTeacherGroup(teacher) {
renderCurrentRecords();
}
-function toggleSummaryBody(key) {
- if (expandedSummaryBodies.has(key)) {
- expandedSummaryBodies.delete(key);
- } else {
- expandedSummaryBodies.add(key);
- }
- renderCurrentRecords();
-}
-
function statusClass(status) {
if (status === "欠费") return "debt";
if (status === "预警") return "warning";
@@ -414,7 +391,6 @@ function resetCorrections() {
correctedRecordOrder = [];
currentRecordOrder = [];
expandedSummaryRecords = new Set();
- expandedSummaryBodies = new Set();
collapsedTeacherGroups = new Set();
activeCorrectionKey = "";
updateCorrectionToolbar();
@@ -782,7 +758,6 @@ async function queryRecords(query, options = {}) {
} else {
currentRecordOrder = [];
expandedSummaryRecords = new Set();
- expandedSummaryBodies = new Set();
collapsedTeacherGroups = new Set();
}
try {
@@ -853,7 +828,6 @@ recordRows.addEventListener("click", (event) => {
const editButton = event.target.closest(".correction-edit");
const deleteButton = event.target.closest(".record-delete");
const teacherToggle = event.target.closest(".teacher-group-toggle");
- const summaryToggle = event.target.closest(".summary-toggle");
if (summarySupplementButton) {
openSummarySupplementDialog(summarySupplementButton.dataset.recordKey);
return;
@@ -870,10 +844,6 @@ recordRows.addEventListener("click", (event) => {
toggleTeacherGroup(teacherToggle.dataset.teacher);
return;
}
- if (summaryToggle) {
- toggleSummaryBody(summaryToggle.dataset.summaryBodyKey);
- return;
- }
const row = event.target.closest(".record-row");
if (row && !event.target.closest(".record-action-cell")) toggleRecordSummary(row.dataset.recordKey);
});
diff --git a/app/app/static/index.html b/app/app/static/index.html
index f0a480f..2293a5f 100644
--- a/app/app/static/index.html
+++ b/app/app/static/index.html
@@ -4,7 +4,7 @@
新时空教务管理系统
-
+