diff --git a/controllers/dashboard.controller.js b/controllers/dashboard.controller.js index aef143e..ee8df9b 100644 --- a/controllers/dashboard.controller.js +++ b/controllers/dashboard.controller.js @@ -8,6 +8,7 @@ async function showDashboard(req, res) { const waitingPatients = await getWaitingPatients(db); res.render("dashboard", { + user: req.session.user, waitingPatients }); diff --git a/controllers/medication.controller.js b/controllers/medication.controller.js index 8c844ea..69926ab 100644 --- a/controllers/medication.controller.js +++ b/controllers/medication.controller.js @@ -5,7 +5,7 @@ function listMedications(req, res, next) { const { q, onlyActive } = req.query; let sql = ` - SELECT + SELECT v.id, m.id AS medication_id, m.name AS medication, @@ -44,8 +44,9 @@ function listMedications(req, res, next) { res.render("medications", { title: "Medikamentenübersicht", - sidebarPartial: "partials/sidebar-empty", // ✅ schwarzer Balken links - active: "medications", + + // ✅ IMMER patient-sidebar verwenden + sidebarPartial: "partials/patient-sidebar", rows, query: { q, onlyActive }, diff --git a/locales/de.json b/locales/de.json index 23dc9b1..8fb2d82 100644 --- a/locales/de.json +++ b/locales/de.json @@ -26,7 +26,34 @@ "nodata":"keine Daten", "month":"Monat", "patientcash":"Umsatz pro Patient", - "patient":"Patient" + "patient":"Patient", + "systeminfo":"Systeminformationen", + "table":"Tabelle", + "lines":"Zeilen", + "size":"Grösse", + "errordatabase":"Fehler beim Auslesen der Datenbankinfos:", + "welcome":"Willkommen", + "waitingroomtext":"Wartezimmer-Monitor", + "waitingroomtextnopatient":"Keine Patienten im Wartezimmer.", + "gender":"Geschlecht", + "birthday":"Geburtstag", + "email":"E-Mail", + "phone":"Telefon", + "address":"Adresse", + "country":"Land", + "notice":"Notizen", + "create":"Erstellt", + "change":"Geändert", + "reset2":"Zurücksetzen", + "edit":"Bearbeiten", + "selection":"Auswahl", + "waiting":"Wartet bereits", + "towaitingroom":"Ins Wartezimmer", + "overview":"Übersicht", + "upload":"Hochladen", + "lock":"Sperren", + "unlock":"Enrsperren", + "name":"Name" }, "sidebar": { "patients": "Patienten", @@ -75,6 +102,15 @@ "port":"Port", "database":"Datenbank", "password":"Password", - "connectiontest":"Verbindung testen" + "connectiontest":"Verbindung testen", + "tablecount":"Anzahl Tabellen", + "databasesize":"Datenbankgrösse", + "tableoverview":"Tabellenübersicht" + }, + + "patienteoverview": { + "patienttitle": "Patientenübersicht", + "newpatient":"Neuer Patient", + "nopatientfound":"Keine Patienten gefunden" } } diff --git a/locales/es.json b/locales/es.json index 6fb5da9..f9b5db4 100644 --- a/locales/es.json +++ b/locales/es.json @@ -26,8 +26,36 @@ "nodata":"sin datos", "month":"mes", "patientcash":"Ingresos por paciente", - "patient":"paciente" + "patient":"paciente", + "systeminfo":"Información del sistema", + "table":"tablas", + "lines":"líneas", + "size":"Tamaño", + "errordatabase":"Error al leer la información de la base de datos:", + "welcome":"Bienvenido", + "waitingroomtext":"Monitor de sala de espera", + "waitingroomtextnopatient":"No hay pacientes en la sala de espera.", + "gender":"Sexo", + "birthday":"Fecha de nacimiento", + "email":"Correo electrónico", + "phone":"Teléfono", + "address":"AdreDirecciónsse", + "country":"País", + "notice":"Notas", + "create":"Creado", + "change":"Modificado", + "reset2":"Restablecer", + "edit":"editar", + "selection":"Selección", + "waiting":"Ya está esperando", + "towaitingroom":"A la sala de espera", + "overview":"Resumen", + "upload":"Cargar", + "lock":"bloquear", + "unlock":"desbloquear", + "name":"Nombre" }, + "sidebar": { "patients": "Pacientes", "medications": "Medicamentos", @@ -75,6 +103,15 @@ "database":"Base de datos", "password":"Contraseña", "connectiontest":"Probar conexión", - "text":"Aquí puedes probar y guardar la conexión a la base de datos. " + "text":"Aquí puedes probar y guardar la conexión a la base de datos. ", + "tablecount":"Número de tablas", + "databasesize":"Tamaño de la base de datos", + "tableoverview":"Resumen de tablas" + }, + + "patienteoverview": { + "patienttitle": "Resumen de pacientes", + "newpatient":"Paciente nuevo", + "nopatientfound":"No se han encontrado pacientes." } } diff --git a/mysql-apt-config_0.8.30-1_all.deb b/mysql-apt-config_0.8.30-1_all.deb new file mode 100644 index 0000000..083f256 Binary files /dev/null and b/mysql-apt-config_0.8.30-1_all.deb differ diff --git a/services/auth.service.js b/services/auth.service.js index 43a596b..14a63cc 100644 --- a/services/auth.service.js +++ b/services/auth.service.js @@ -40,7 +40,10 @@ async function loginUser(db, username, password, lockTimeMinutes) { resolve({ id: user.id, username: user.username, - role: user.role + role: user.role, + title: user.title, + firstname: user.first_name, + lastname: user.last_name }); } ); diff --git a/views/admin/database.ejs b/views/admin/database.ejs index 5a5650b..c728073 100644 --- a/views/admin/database.ejs +++ b/views/admin/database.ejs @@ -132,13 +132,13 @@

- Systeminformationen + <%=t.global.systeminfo%>

<% if (typeof systemInfo !== "undefined" && systemInfo && systemInfo.error) { %>
- ❌ Fehler beim Auslesen der Datenbankinfos: + ❌ <%=t.global.errordatabase%>
<%= systemInfo.error %>
@@ -154,14 +154,14 @@
-
Anzahl Tabellen
+
<%=t.databaseoverview.tablecount%>
<%= systemInfo.tableCount %>
-
Datenbankgröße
+
<%=t.databaseoverview.databasesize%>
<%= systemInfo.dbSizeMB %> MB
@@ -170,15 +170,15 @@ <% if (systemInfo.tables && systemInfo.tables.length > 0) { %>
-
Tabellenübersicht
+
<%=t.databaseoverview.tableoverview%>
- - - + + + diff --git a/views/dashboard.ejs b/views/dashboard.ejs index f3cd375..5708ea5 100644 --- a/views/dashboard.ejs +++ b/views/dashboard.ejs @@ -24,7 +24,7 @@ WARTEZIMMER MONITOR ========================= -->
-
🪑 Wartezimmer-Monitor
+
🪑 <%=t.global.waitingroomtext%>
<% if (waitingPatients && waitingPatients.length > 0) { %> @@ -56,7 +56,7 @@ <% }) %> <% } else { %> -
Keine Patienten im Wartezimmer.
+
<%=t.global.waitingroomtextnopatient%>
<% } %>
diff --git a/views/medications.ejs b/views/medications.ejs index 116e47c..9a85617 100644 --- a/views/medications.ejs +++ b/views/medications.ejs @@ -1,141 +1,140 @@ <%- include("partials/page-header", { user, - title: "Medikamentenübersicht", + title: t.patienteoverview.patienttitle, subtitle: "", showUserName: true }) %> -
+
- <%- include("partials/flash") %> + <%- include("partials/flash") %> -
+
-
-
+
+
- -
+ + -
- -
+
+ +
-
- - Reset -
+
+ + Reset +
-
-
- - > - +
+
+ + > + +
+
+ + + + + + ➕ Neues Medikament + + +
+
TabelleZeilenGröße (MB)<%=t.global.table%><%=t.global.lines%><%=t.global.size%> (MB)
+ + + + + + + + + + + + + + <% rows.forEach(r => { %> + + + + + + + + + + + + + + + + + + + <% }) %> + + +
MedikamentDarreichungsformDosierungPackungStatusAktionen
<%= r.medication %><%= r.form %> + + + + + <%= r.active ? "Aktiv" : "Inaktiv" %> + + + + + + + + + +
+ +
+ +
+
- - - - - - ➕ Neues Medikament - - -
- - - - - - - - - - - - - - - <% rows.forEach(r => { %> - - - - - - - - - - - - - - - - - - - <% }) %> - - -
MedikamentDarreichungsformDosierungPackungStatusAktionen
<%= r.medication %><%= r.form %> - - - - - <%= r.active ? "Aktiv" : "Inaktiv" %> - - - - - - - - - -
- -
- -
- - - - - - + + diff --git a/views/partials/admin-sidebar.ejs b/views/partials/admin-sidebar.ejs index 65ea731..0403678 100644 --- a/views/partials/admin-sidebar.ejs +++ b/views/partials/admin-sidebar.ejs @@ -75,5 +75,10 @@ <% } %> + + + <%= t.sidebar.logout %> + + diff --git a/views/partials/page-header.ejs b/views/partials/page-header.ejs index e2c145e..6e2f99c 100644 --- a/views/partials/page-header.ejs +++ b/views/partials/page-header.ejs @@ -18,7 +18,7 @@
<% if (showUser && user?.username) { %>
- Willkommen, <%= user.username %> + <%=t.global.welcome%>, <%= user.title + " " + user.firstname + " " + user.lastname %>
<% } %> diff --git a/views/patient_edit.ejs b/views/patient_edit.ejs index db00eaf..10bac58 100644 --- a/views/patient_edit.ejs +++ b/views/patient_edit.ejs @@ -1,7 +1,7 @@
- +
diff --git a/views/patients.ejs b/views/patients.ejs index 2c4061a..6cafc55 100644 --- a/views/patients.ejs +++ b/views/patients.ejs @@ -1,6 +1,6 @@ <%- include("partials/page-header", { user, - title: "Patientenübersicht", + title: t.patienteoverview.patienttitle, subtitle: "", showUserName: true }) %> @@ -12,7 +12,7 @@ @@ -26,7 +26,7 @@ type="text" name="firstname" class="form-control" - placeholder="Vorname" + placeholder=<%=t.global.firstname%> value="<%= query?.firstname || '' %>" />
@@ -36,7 +36,7 @@ type="text" name="lastname" class="form-control" - placeholder="Nachname" + placeholder=<%=t.global.lastname%> value="<%= query?.lastname || '' %>" />
@@ -51,9 +51,9 @@
- + - Zurücksetzen + <%=t.global.reset2%>
@@ -65,19 +65,19 @@ ID - Name + <%=t.global.name%> N.I.E. / DNI - Geschlecht - Geburtstag - E-Mail - Telefon - Adresse - Land - Status - Notizen - Erstellt - Geändert - Aktionen + <%=t.global.gender%> + <%=t.global.birthday%> + <%=t.global.email%> + <%=t.global.phone%> + <%=t.global.address%> + <%=t.global.country%> + <%=t.global.status%> + <%=t.global.notice%> + <%=t.global.create%> + <%=t.global.change%> + <%=t.global.action%> @@ -85,7 +85,7 @@ <% if (patients.length === 0) { %> - Keine Patienten gefunden + <%=t.patientoverview.nopatientfound%> <% } %> @@ -161,14 +161,14 @@