Skip to content

Commit 0ee4a10

Browse files
committed
added approval lists and made many small modifications
1 parent 4edb4dc commit 0ee4a10

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1764
-395
lines changed

accessories.go

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,25 @@ func returnFilterRender(Name string, Attri18n string, DisplayName string, UseCal
2626
return FilterRender{Name, Attri18n, DisplayName, UseCalendarInConrols, Currencies}
2727
}
2828

29+
// HeadRender is for rendering frontend for head block in templates
30+
type HeadRender struct {
31+
AppTitle string
32+
PageTitle string
33+
LangCode string
34+
SystemTheme string
35+
}
36+
37+
func returnHeadRender(AppTitle string, PageTitle string, LangCode string, SystemTheme string) HeadRender {
38+
return HeadRender{AppTitle, PageTitle, LangCode, SystemTheme}
39+
}
40+
41+
func isThemeSystem(themeName string) bool {
42+
if strings.HasPrefix(themeName, "system-") {
43+
return true
44+
}
45+
return false
46+
}
47+
2948
func fileExists(name string) bool {
3049
if _, err := os.Stat(name); err != nil {
3150
if os.IsNotExist(err) {
@@ -110,7 +129,11 @@ func getIDfromURL(path string) (id int, err error) {
110129

111130
func getTextIDfromURL(path string) string {
112131
arrayPathElems := strings.Split(path, "/")
113-
return arrayPathElems[len(arrayPathElems)-1]
132+
res := arrayPathElems[len(arrayPathElems)-1]
133+
if res == "approval" {
134+
res = arrayPathElems[len(arrayPathElems)-2]
135+
}
136+
return res
114137
}
115138

116139
func throwAccessDenied(w http.ResponseWriter, logmsg string, userID int, resourceID int) {
@@ -257,3 +280,10 @@ func replaceBBCodeWithHTML(cont string) string {
257280

258281
return cont
259282
}
283+
284+
func intToBool(v int) bool {
285+
if v != 0 {
286+
return true
287+
}
288+
return false
289+
}

assets/functions.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
/* Highlights current website block */
22
(function(){
33
let addr = window.location.pathname;
4+
let currentItem;
45
if (addr.includes("/docs")) {
5-
document.querySelector("#textmenu a[href^='/docs']").classList.add("chosenmenu");
6+
currentItem = document.querySelector("#textmenu a[href^='/docs']");
7+
if (currentItem) currentItem.classList.add("chosenmenu");
68
} else if (addr.includes("/team")) {
7-
document.querySelector("#textmenu a[href^='/team']").classList.add("chosenmenu");
9+
currentItem = document.querySelector("#textmenu a[href^='/team']");
10+
if (currentItem) currentItem.classList.add("chosenmenu");
811
} else if (addr.includes("/task")) {
9-
document.querySelector("#textmenu a[href^='/task']").classList.add("chosenmenu");
12+
currentItem = document.querySelector("#textmenu a[href^='/task']");
13+
if (currentItem) currentItem.classList.add("chosenmenu");
1014
}
1115
})();
1216

assets/i18n/en.json

Lines changed: 45 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"create": "Create",
2222
"edit": "Edit",
2323
"save": "Save",
24+
"close": "Close",
2425
"cancel": "Cancel",
2526
"deleteSelected": "Delete selected",
2627
"delete": "Delete",
@@ -40,7 +41,6 @@
4041
"sorting": "Sorting",
4142
"ascending": "Ascending",
4243
"descending": "Descending",
43-
"no": "no",
4444
"num": "No.",
4545
"dated": "dated",
4646
"page": "Page",
@@ -49,6 +49,8 @@
4949
"previousP": "Previous",
5050
"nextP": "Next",
5151
"lastP": "Last",
52+
"yes": "yes",
53+
"no": "no",
5254

5355
"creationCompleted": "Creation completed.",
5456
"configSaved": "Settings saved.",
@@ -59,6 +61,8 @@
5961
"commentWritten": "Comment saved successfully.",
6062
"commentNotWritten": "Error writing comment.",
6163
"participantAlreadyInList": "This participant is already in the list.",
64+
"approverAlreadyInList": "This approver is already in the list.",
65+
"noData": "No data available.",
6266
"removedElems": "Deleted objects:",
6367
"removalError": "Error deleting objects.",
6468
"updatedElems": "Updated objects:",
@@ -131,8 +135,8 @@
131135
"user": "User",
132136
"newUser": "New user profile",
133137
"gotoCompaniesPage": "Go to companies list",
134-
"allUsers": "all users",
135-
"userPage": "user page",
138+
"allUsers": "All users",
139+
"userPage": "User page",
136140
"companiesUnitsFilterTitle": "by company unit related to a company",
137141
"noRole": "No role",
138142
"adminRole": "Administrator",
@@ -184,8 +188,8 @@
184188
],
185189
"newCompany": "New company",
186190
"gotoTeamPage": "Go to team page",
187-
"allCompanies": "all companies",
188-
"companyPage": "company page",
191+
"allCompanies": "All companies",
192+
"companyPage": "Company page",
189193
"companyShort": "Short",
190194
"companyFull": "Full",
191195
"companyForeign": "In a foreign language",
@@ -208,8 +212,9 @@
208212

209213
"document": "Document",
210214
"newDocument": "New document",
211-
"allDocuments": "all documents",
212-
"documentPage": "document page",
215+
"myDocuments": "My documents",
216+
"allDocuments": "All documents",
217+
"documentPage": "Document page",
213218
"showIncoming": {"text": "Incoming No., date in table", "title": "Show incoming date and number in the table instead of registration date and number"},
214219
"detailsType": "Document details, type",
215220
"registration": "Registration",
@@ -228,8 +233,38 @@
228233
"sumLabel": "sum: ",
229234
"authors": "Authors",
230235
"addressees": "Addressees",
231-
"docNote": "Note",
236+
"note": "Note",
232237
"docFiles": "Document files",
238+
"myDocsCreated": {"text": "My documents", "title": "Documents for which I am creator"},
239+
"approve": "Approve",
240+
"reject": "Reject",
241+
"saveNote": "Save note",
242+
"approvalList": "Approval list",
243+
"youApproved": "Approved by you.",
244+
"youRejected": "Rejected by you.",
245+
"yourApprovalBroken": "Your approval was broken.",
246+
"approvalDialog": "Approval dialog",
247+
"approval": "Approval",
248+
"signature": "Signature",
249+
"digital": "Digital",
250+
"approvalNote": "Type approval note if you wish or leave empty",
251+
"approver": "Approver",
252+
"approvers": "Approvers",
253+
"selectApproverToAdd": "Select an approver to add",
254+
"addApprover": "Add approver",
255+
"myApprovals": "My approvals",
256+
"approvalBreak": "This will break any approval if present!",
257+
"approvalSign": [
258+
"For approval",
259+
"Approved",
260+
"Rejected",
261+
"Broken"
262+
],
263+
"approvalSignMy": [
264+
"For my approval",
265+
"Approved by me",
266+
"Rejected by me"
267+
],
233268
"categoriesName": "Categories",
234269
"categories": [
235270
"None",
@@ -257,8 +292,8 @@
257292

258293
"task": "Task",
259294
"newTask": "New task",
260-
"allTasks": "all tasks",
261-
"tasksPage": "task page",
295+
"allTasks": "All tasks",
296+
"tasksPage": "Task page",
262297
"status": "Status",
263298
"statuses": "Statuses",
264299
"taskID": "Task #",

assets/i18n/es.json

Lines changed: 45 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"create": "Crear",
2222
"edit": "Editar",
2323
"save": "Guardar",
24+
"close": "Cerrar",
2425
"cancel": "Cancelar",
2526
"deleteSelected": "Eliminar seleccionado",
2627
"delete": "Eliminar",
@@ -40,7 +41,6 @@
4041
"sorting": "Ordenar",
4142
"descending": "Descendente",
4243
"ascending": "Ascendente",
43-
"no": "no",
4444
"num": "n.<sup>o</sup>",
4545
"dated": "de",
4646
"page": "Página",
@@ -49,6 +49,8 @@
4949
"previousP": "Previa",
5050
"nextP": "Próxima",
5151
"lastP": "Última",
52+
"yes": "",
53+
"no": "no",
5254

5355
"creationCompleted": "Creación completada.",
5456
"configSaved": "Ajustes guardados.",
@@ -59,6 +61,8 @@
5961
"commentWritten": "Comentario guardado con éxito.",
6062
"commentNotWritten": "Error al escribir el comentario.",
6163
"participantAlreadyInList": "Este participante ya está en la lista.",
64+
"approverAlreadyInList": "Este aprobador ya está en la lista.",
65+
"noData": "Datos no disponibles.",
6266
"removedElems": "Objetos eliminados:",
6367
"removalError": "Error al eliminar objetos.",
6468
"updatedElems": "Objetos actualizados:",
@@ -131,8 +135,8 @@
131135
"user": "Usuario",
132136
"newUser": "Nuevo usuario",
133137
"gotoCompaniesPage": "Ir a la lista de compañías",
134-
"allUsers": "todos los usuarios",
135-
"userPage": "página de usuario",
138+
"allUsers": "Todos los usuarios",
139+
"userPage": "Página de usuario",
136140
"companiesUnitsFilterTitle": "por unidad relacionada con una compañía",
137141
"noRole": "Sin rol",
138142
"adminRole": "Administrador",
@@ -184,8 +188,8 @@
184188
],
185189
"newCompany": "Nueva compañia",
186190
"gotoTeamPage": "Ir a la página del equipo",
187-
"allCompanies": "todas las compañias",
188-
"companyPage": "página de la compañía",
191+
"allCompanies": "Todas las compañias",
192+
"companyPage": "Página de la compañía",
189193
"companyShort": "Breve",
190194
"companyFull": "Completo",
191195
"companyForeign": "En un idioma extranjero",
@@ -208,8 +212,9 @@
208212

209213
"document": "Documento",
210214
"newDocument": "Nuevo documento",
211-
"allDocuments": "todos los documentos",
212-
"documentPage": "página del documento",
215+
"myDocuments": "Mis documentos",
216+
"allDocuments": "Todos los documentos",
217+
"documentPage": "Página del documento",
213218
"showIncoming": {"text": "Número y fecha entrante en la tabla", "title": "Mostrar la fecha de entrada y el número de entrada en la tabla en lugar de la fecha y el número de registro"},
214219
"detailsType": "Detalles del documento, tipo",
215220
"registration": "Registro",
@@ -228,8 +233,38 @@
228233
"sumLabel": "suma: ",
229234
"authors": "Autores",
230235
"addressees": "Destinatarios",
231-
"docNote": "Nota",
236+
"note": "Nota",
232237
"docFiles": "Archivos del documento",
238+
"myDocsCreated": {"text": "Mis documentos", "title": "Documents for which I am creator"},
239+
"approve": "Aprobar",
240+
"reject": "Rechazar",
241+
"saveNote": "Guardar nota",
242+
"approvalList": "Lista de aprobación",
243+
"youApproved": "Aprobado por usted.",
244+
"youRejected": "Rechazado por usted.",
245+
"yourApprovalBroken": "Tu aprobación se rompió.",
246+
"approvalDialog": "Diálogo de aprobación",
247+
"approval": "Aprobación",
248+
"signature": "Firma",
249+
"digital": "Digital",
250+
"approvalNote": "Escriba aquí la nota de aprobación si lo desea o deje vacío.",
251+
"approver": "Aprobador",
252+
"approvers": "Aprobadores",
253+
"selectApproverToAdd": "Seleccione un aprobador para agregar",
254+
"addApprover": "Agregar aprobador",
255+
"myApprovals": "Mis aprobaciones",
256+
"approvalBreak": "¡Esto romperá cualquier aprobación si está presente!",
257+
"approvalSign": [
258+
"Para aprobación",
259+
"Aprobado",
260+
"Rechazado",
261+
"Roto"
262+
],
263+
"approvalSignMy": [
264+
"Para mi aprobación",
265+
"Aprobado por mi",
266+
"Rechazado por mi"
267+
],
233268
"categoriesName": "Categorías",
234269
"categories": [
235270
"Ninguno",
@@ -257,8 +292,8 @@
257292

258293
"task": "Tarea",
259294
"newTask": "Nueva tarea",
260-
"allTasks": "todas las tareas",
261-
"tasksPage": "pagina de tarea",
295+
"allTasks": "Todas las tareas",
296+
"tasksPage": "Pagina de tarea",
262297
"status": "Estado",
263298
"statuses": "Estados",
264299
"taskID": "Núm. de tarea",

0 commit comments

Comments
 (0)