Changeset 50f2fb4 for src/app/students/applications/page.tsx
- Timestamp:
- 01/30/26 01:40:27 (8 months ago)
- Branches:
- master
- Children:
- ba52069
- Parents:
- 298f9b3
- File:
-
- 1 edited
-
src/app/students/applications/page.tsx (modified) (16 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/app/students/applications/page.tsx
r298f9b3 r50f2fb4 14 14 } from '@fortawesome/free-solid-svg-icons'; 15 15 import { useState } from 'react'; 16 import { useTranslation } from 'react-i18next'; 16 17 import applicationsData from '@/data/applications.json'; 17 18 … … 28 29 29 30 const CompletedBadge = ({ completed }: { completed: string }) => { 30 if (completed === "Да") { 31 return ( 32 <span className="inline-flex items-center justify-center w-6 h-6 bg-green-100 text-green-600 rounded-full"> 31 const { t } = useTranslation(); 32 if (completed === t('yes', 'Да')) { 33 return ( 34 <span className="inline-flex items-center justify-center w-6 h-6 bg-green-100 text-green-600 rounded-full" title={t('completed')}> 33 35 <FontAwesomeIcon icon={faCheckCircle} className="w-4 h-4" /> 34 36 </span> … … 36 38 } else { 37 39 return ( 38 <span className="inline-flex items-center justify-center w-6 h-6 bg-red-100 text-red-600 rounded-full" >40 <span className="inline-flex items-center justify-center w-6 h-6 bg-red-100 text-red-600 rounded-full" title={t('not_completed')}> 39 41 <FontAwesomeIcon icon={faTimesCircle} className="w-4 h-4" /> 40 42 </span> … … 64 66 65 67 export default function ApplicationsPage() { 68 const { t } = useTranslation(); 66 69 const [selectedSession, setSelectedSession] = useState(applicationsData.currentSession.id); 67 70 const [isDropdownOpen, setIsDropdownOpen] = useState(false); 68 71 69 72 const currentSessionData = applicationsData.examSessions.find(s => s.id === selectedSession) || applicationsData.currentSession; 70 73 const { applications } = applicationsData; … … 79 82 </div> 80 83 <div> 81 <h1 className="text-3xl font-bold mb-2"> Пријави</h1>84 <h1 className="text-3xl font-bold mb-2">{t('applications_header', 'Пријави')}</h1> 82 85 <p className="text-lg opacity-90"> 83 Електронски пријави за испити86 {t('applications_subheader', 'Електронски пријави за испити')} 84 87 </p> 85 88 </div> … … 92 95 <h2 className="text-lg font-semibold text-gray-900 flex items-center gap-2"> 93 96 <FontAwesomeIcon icon={faCalendarAlt} className="text-primary" /> 94 Избери испитна сесија:97 {t('select_exam_session', 'Избери испитна сесија:')} 95 98 </h2> 96 99 97 100 <div className="relative"> 98 101 <button … … 102 105 <div className="flex items-center justify-between"> 103 106 <span className="text-sm font-medium text-primary"> 104 { currentSessionData.name}107 {t(currentSessionData.id, currentSessionData.name)} 105 108 </span> 106 <FontAwesomeIcon 107 icon={faChevronDown} 109 <FontAwesomeIcon 110 icon={faChevronDown} 108 111 className={`w-4 h-4 text-gray-400 transition-transform ml-4 ${isDropdownOpen ? 'rotate-180' : ''}`} 109 112 /> 110 113 </div> 111 114 </button> 112 115 113 116 {isDropdownOpen && ( 114 117 <div className="absolute z-10 right-0 mt-1 w-80 bg-white border border-gray-200 rounded-lg shadow-lg"> … … 122 125 className="w-full px-4 py-3 text-left text-sm hover:bg-gray-50 focus:outline-none focus:bg-gray-50 first:rounded-t-lg last:rounded-b-lg" 123 126 > 124 <div className="font-medium text-gray-900">{ session.name}</div>125 <div className="text-xs text-gray-500">{session.year} - { session.semester} - {session.session}</div>127 <div className="font-medium text-gray-900">{t(session.id, session.name)}</div> 128 <div className="text-xs text-gray-500">{session.year} - {t(session.semester, session.semester)} - {t(session.session, session.session)}</div> 126 129 </button> 127 130 ))} … … 135 138 <div className="bg-white rounded-xl shadow-sm border border-gray-100 overflow-hidden"> 136 139 <div className="bg-primary text-white px-6 py-4"> 137 <h2 className="text-xl font-bold"> Пријавени испити</h2>138 </div> 139 140 <h2 className="text-xl font-bold">{t('registered_exams', 'Пријавени испити')}</h2> 141 </div> 142 140 143 <div className="overflow-x-auto"> 141 144 <table className="w-full"> … … 143 146 <tr> 144 147 <th className="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">#</th> 145 <th className="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"> Сериски број</th>146 <th className="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"> Код</th>147 <th className="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"> Предмет</th>148 <th className="px-4 py-4 text-center text-xs font-medium text-gray-500 uppercase tracking-wider"> Завршена</th>149 <th className="px-4 py-4 text-center text-xs font-medium text-gray-500 uppercase tracking-wider"> Таксени</th>150 <th className="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"> Датум</th>151 <th className="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"> Наставник</th>152 <th className="px-4 py-4 text-center text-xs font-medium text-gray-500 uppercase tracking-wider"> Декада</th>148 <th className="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">{t('serial_number', 'Сериски број')}</th> 149 <th className="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">{t('code', 'Код')}</th> 150 <th className="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">{t('subject', 'Предмет')}</th> 151 <th className="px-4 py-4 text-center text-xs font-medium text-gray-500 uppercase tracking-wider">{t('completed', 'Завршена')}</th> 152 <th className="px-4 py-4 text-center text-xs font-medium text-gray-500 uppercase tracking-wider">{t('fee', 'Таксени')}</th> 153 <th className="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">{t('date', 'Датум')}</th> 154 <th className="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">{t('instructor', 'Наставник')}</th> 155 <th className="px-4 py-4 text-center text-xs font-medium text-gray-500 uppercase tracking-wider">{t('decade', 'Декада')}</th> 153 156 </tr> 154 157 </thead> … … 166 169 <div className="flex items-center gap-2"> 167 170 <FontAwesomeIcon icon={faFileText} className="w-4 h-4 text-primary" /> 168 { application.subject}171 {t(application.subject, application.subject)} 169 172 </div> 170 173 </TableCell> … … 179 182 <div className="flex items-center gap-2"> 180 183 <FontAwesomeIcon icon={faUser} className="w-4 h-4 text-gray-400" /> 181 <span className="font-medium text-gray-900">{ application.instructor}</span>184 <span className="font-medium text-gray-900">{t(application.instructor, application.instructor)}</span> 182 185 </div> 183 186 </TableCell> … … 194 197 <FontAwesomeIcon icon={faInfoCircle} className="w-5 h-5 text-blue-600 mt-0.5 flex-shrink-0" /> 195 198 <div> 196 <h3 className="font-medium text-blue-900 mb-1"> Важна забелешка</h3>199 <h3 className="font-medium text-blue-900 mb-1">{t('important_note', 'Важна забелешка')}</h3> 197 200 <p className="text-sm text-blue-800 leading-relaxed"> 198 { applicationsData.note}201 {t('applications_important_note_text')} 199 202 </p> 200 203 </div> … … 211 214 </div> 212 215 <div> 213 <h3 className="text-lg font-bold text-gray-900"> Пријавени испити</h3>216 <h3 className="text-lg font-bold text-gray-900">{t('registered_exams', 'Пријавени испити')}</h3> 214 217 <p className="text-2xl font-bold text-blue-600"> 215 218 {applications.length} … … 225 228 </div> 226 229 <div> 227 <h3 className="text-lg font-bold text-gray-900"> Завршени</h3>230 <h3 className="text-lg font-bold text-gray-900">{t('completed', 'Завршени')}</h3> 228 231 <p className="text-2xl font-bold text-green-600"> 229 {applications.filter(app => app.completed === "Да").length}232 {applications.filter(app => app.completed === t('yes', 'Да')).length} 230 233 </p> 231 234 </div> … … 239 242 </div> 240 243 <div> 241 <h3 className="text-lg font-bold text-gray-900"> Вкупна такса</h3>244 <h3 className="text-lg font-bold text-gray-900">{t('total_fee', 'Вкупна такса')}</h3> 242 245 <p className="text-2xl font-bold text-yellow-600"> 243 246 {applications.reduce((sum, app) => sum + parseFloat(app.fee.replace(',', '.')), 0).toFixed(2)}
Note:
See TracChangeset
for help on using the changeset viewer.
