Changeset 50f2fb4 for src/app/professor/students
- Timestamp:
- 01/30/26 01:40:27 (8 months ago)
- Branches:
- master
- Children:
- ba52069
- Parents:
- 298f9b3
- File:
-
- 1 edited
-
src/app/professor/students/page.tsx (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/app/professor/students/page.tsx
r298f9b3 r50f2fb4 2 2 3 3 import { useEffect, useMemo, useState } from "react"; 4 import { useTranslation } from 'react-i18next'; 4 5 5 6 type UsersBySubject = { … … 36 37 37 38 export default function ProfessorStudentsPage() { 39 const { t } = useTranslation(); 38 40 const [subjects, setSubjects] = useState<SubjectsAndUsers[]>([]); 39 41 const [loading, setLoading] = useState(true); … … 129 131 <div className="bg-white rounded-xl shadow-sm border border-gray-200 p-6"> 130 132 <div className="flex flex-col gap-4 md:flex-row md:items-end md:justify-between"> 133 131 134 <div> 132 <h1 className="text-2xl font-semibold text-gray-900"> Professor • Students</h1>135 <h1 className="text-2xl font-semibold text-gray-900">{t('prof_students_title')}</h1> 133 136 <p className="text-gray-700 mt-1"> 134 Data comes from<span className="font-mono">/api/prof/students</span> (demo store).137 {t('prof_students_data_note')} <span className="font-mono">/api/prof/students</span> (demo store). 135 138 </p> 136 139 </div> … … 138 141 <div className="flex flex-col sm:flex-row gap-3"> 139 142 <div className="flex flex-col"> 140 <label className="text-sm text-gray-700"> Filter by subject</label>143 <label className="text-sm text-gray-700">{t('filter_by_subject')}</label> 141 144 <select 142 145 className="border border-gray-300 rounded-lg px-3 py-2" … … 144 147 onChange={(e) => setSubjectFilter(e.target.value)} 145 148 > 146 <option value="all"> All subjects</option>149 <option value="all">{t('all_subjects')}</option> 147 150 {subjects 148 151 .filter((s) => typeof s.Id === "number") 149 152 .map((s) => ( 150 153 <option key={String(s.Id)} value={String(s.Id)}> 151 {s.Name ?? ` Subject${s.Id}`}154 {s.Name ?? `${t('subject')} ${s.Id}`} 152 155 </option> 153 156 ))} … … 156 159 157 160 <div className="flex flex-col"> 158 <label className="text-sm text-gray-700"> Find student by index / ID</label>161 <label className="text-sm text-gray-700">{t('find_student_by_id')}</label> 159 162 <input 160 163 className="border border-gray-300 rounded-lg px-3 py-2" 161 placeholder= "e.g. 20001"164 placeholder={t('student_id_placeholder')} 162 165 value={studentIdQuery} 163 166 onChange={(e) => setStudentIdQuery(e.target.value)} … … 177 180 <thead className="bg-gray-50"> 178 181 <tr> 179 <th className="text-left text-sm font-semibold text-gray-700 px-4 py-3 border-b"> Student</th>180 <th className="text-left text-sm font-semibold text-gray-700 px-4 py-3 border-b"> ID</th>181 <th className="text-left text-sm font-semibold text-gray-700 px-4 py-3 border-b"> Subject</th>182 <th className="text-left text-sm font-semibold text-gray-700 px-4 py-3 border-b"> Grade</th>183 <th className="text-left text-sm font-semibold text-gray-700 px-4 py-3 border-b"> Actions</th>182 <th className="text-left text-sm font-semibold text-gray-700 px-4 py-3 border-b">{t('student')}</th> 183 <th className="text-left text-sm font-semibold text-gray-700 px-4 py-3 border-b">{t('id')}</th> 184 <th className="text-left text-sm font-semibold text-gray-700 px-4 py-3 border-b">{t('subject')}</th> 185 <th className="text-left text-sm font-semibold text-gray-700 px-4 py-3 border-b">{t('grade')}</th> 186 <th className="text-left text-sm font-semibold text-gray-700 px-4 py-3 border-b">{t('actions')}</th> 184 187 </tr> 185 188 </thead> … … 188 191 <tr> 189 192 <td className="px-4 py-4 text-gray-700" colSpan={5}> 190 Loading...193 {t('loading')} 191 194 </td> 192 195 </tr> … … 194 197 <tr> 195 198 <td className="px-4 py-4 text-gray-700" colSpan={5}> 196 No students found.199 {t('no_students_found')} 197 200 </td> 198 201 </tr> … … 227 230 </select> 228 231 <span className="text-sm text-gray-600"> 229 Current: {r.grade > 0 ? r.grade : "—"}232 {t('current')}: {r.grade > 0 ? r.grade : t('none')} 230 233 </span> 231 234 </div> … … 245 248 }} 246 249 > 247 Add grade250 {t('add_grade')} 248 251 </button> 249 252 … … 260 263 }} 261 264 > 262 Edit grade265 {t('edit_grade')} 263 266 </button> 264 267 … … 275 278 }} 276 279 > 277 Remove grade280 {t('remove_grade')} 278 281 </button> 279 282 </div>
Note:
See TracChangeset
for help on using the changeset viewer.
