Skip to content

Commit

Permalink
added approval lists and made many small modifications
Browse files Browse the repository at this point in the history
  • Loading branch information
alecxcode committed Aug 16, 2022
1 parent 4edb4dc commit 0ee4a10
Show file tree
Hide file tree
Showing 50 changed files with 1,764 additions and 395 deletions.
32 changes: 31 additions & 1 deletion accessories.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,25 @@ func returnFilterRender(Name string, Attri18n string, DisplayName string, UseCal
return FilterRender{Name, Attri18n, DisplayName, UseCalendarInConrols, Currencies}
}

// HeadRender is for rendering frontend for head block in templates
type HeadRender struct {
AppTitle string
PageTitle string
LangCode string
SystemTheme string
}

func returnHeadRender(AppTitle string, PageTitle string, LangCode string, SystemTheme string) HeadRender {
return HeadRender{AppTitle, PageTitle, LangCode, SystemTheme}
}

func isThemeSystem(themeName string) bool {
if strings.HasPrefix(themeName, "system-") {
return true
}
return false
}

func fileExists(name string) bool {
if _, err := os.Stat(name); err != nil {
if os.IsNotExist(err) {
Expand Down Expand Up @@ -110,7 +129,11 @@ func getIDfromURL(path string) (id int, err error) {

func getTextIDfromURL(path string) string {
arrayPathElems := strings.Split(path, "/")
return arrayPathElems[len(arrayPathElems)-1]
res := arrayPathElems[len(arrayPathElems)-1]
if res == "approval" {
res = arrayPathElems[len(arrayPathElems)-2]
}
return res
}

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

return cont
}

func intToBool(v int) bool {
if v != 0 {
return true
}
return false
}
10 changes: 7 additions & 3 deletions assets/functions.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
/* Highlights current website block */
(function(){
let addr = window.location.pathname;
let currentItem;
if (addr.includes("/docs")) {
document.querySelector("#textmenu a[href^='/docs']").classList.add("chosenmenu");
currentItem = document.querySelector("#textmenu a[href^='/docs']");
if (currentItem) currentItem.classList.add("chosenmenu");
} else if (addr.includes("/team")) {
document.querySelector("#textmenu a[href^='/team']").classList.add("chosenmenu");
currentItem = document.querySelector("#textmenu a[href^='/team']");
if (currentItem) currentItem.classList.add("chosenmenu");
} else if (addr.includes("/task")) {
document.querySelector("#textmenu a[href^='/task']").classList.add("chosenmenu");
currentItem = document.querySelector("#textmenu a[href^='/task']");
if (currentItem) currentItem.classList.add("chosenmenu");
}
})();

Expand Down
55 changes: 45 additions & 10 deletions assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"create": "Create",
"edit": "Edit",
"save": "Save",
"close": "Close",
"cancel": "Cancel",
"deleteSelected": "Delete selected",
"delete": "Delete",
Expand All @@ -40,7 +41,6 @@
"sorting": "Sorting",
"ascending": "Ascending",
"descending": "Descending",
"no": "no",
"num": "No.",
"dated": "dated",
"page": "Page",
Expand All @@ -49,6 +49,8 @@
"previousP": "Previous",
"nextP": "Next",
"lastP": "Last",
"yes": "yes",
"no": "no",

"creationCompleted": "Creation completed.",
"configSaved": "Settings saved.",
Expand All @@ -59,6 +61,8 @@
"commentWritten": "Comment saved successfully.",
"commentNotWritten": "Error writing comment.",
"participantAlreadyInList": "This participant is already in the list.",
"approverAlreadyInList": "This approver is already in the list.",
"noData": "No data available.",
"removedElems": "Deleted objects:",
"removalError": "Error deleting objects.",
"updatedElems": "Updated objects:",
Expand Down Expand Up @@ -131,8 +135,8 @@
"user": "User",
"newUser": "New user profile",
"gotoCompaniesPage": "Go to companies list",
"allUsers": "all users",
"userPage": "user page",
"allUsers": "All users",
"userPage": "User page",
"companiesUnitsFilterTitle": "by company unit related to a company",
"noRole": "No role",
"adminRole": "Administrator",
Expand Down Expand Up @@ -184,8 +188,8 @@
],
"newCompany": "New company",
"gotoTeamPage": "Go to team page",
"allCompanies": "all companies",
"companyPage": "company page",
"allCompanies": "All companies",
"companyPage": "Company page",
"companyShort": "Short",
"companyFull": "Full",
"companyForeign": "In a foreign language",
Expand All @@ -208,8 +212,9 @@

"document": "Document",
"newDocument": "New document",
"allDocuments": "all documents",
"documentPage": "document page",
"myDocuments": "My documents",
"allDocuments": "All documents",
"documentPage": "Document page",
"showIncoming": {"text": "Incoming No., date in table", "title": "Show incoming date and number in the table instead of registration date and number"},
"detailsType": "Document details, type",
"registration": "Registration",
Expand All @@ -228,8 +233,38 @@
"sumLabel": "sum: ",
"authors": "Authors",
"addressees": "Addressees",
"docNote": "Note",
"note": "Note",
"docFiles": "Document files",
"myDocsCreated": {"text": "My documents", "title": "Documents for which I am creator"},
"approve": "Approve",
"reject": "Reject",
"saveNote": "Save note",
"approvalList": "Approval list",
"youApproved": "Approved by you.",
"youRejected": "Rejected by you.",
"yourApprovalBroken": "Your approval was broken.",
"approvalDialog": "Approval dialog",
"approval": "Approval",
"signature": "Signature",
"digital": "Digital",
"approvalNote": "Type approval note if you wish or leave empty",
"approver": "Approver",
"approvers": "Approvers",
"selectApproverToAdd": "Select an approver to add",
"addApprover": "Add approver",
"myApprovals": "My approvals",
"approvalBreak": "This will break any approval if present!",
"approvalSign": [
"For approval",
"Approved",
"Rejected",
"Broken"
],
"approvalSignMy": [
"For my approval",
"Approved by me",
"Rejected by me"
],
"categoriesName": "Categories",
"categories": [
"None",
Expand Down Expand Up @@ -257,8 +292,8 @@

"task": "Task",
"newTask": "New task",
"allTasks": "all tasks",
"tasksPage": "task page",
"allTasks": "All tasks",
"tasksPage": "Task page",
"status": "Status",
"statuses": "Statuses",
"taskID": "Task #",
Expand Down
55 changes: 45 additions & 10 deletions assets/i18n/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"create": "Crear",
"edit": "Editar",
"save": "Guardar",
"close": "Cerrar",
"cancel": "Cancelar",
"deleteSelected": "Eliminar seleccionado",
"delete": "Eliminar",
Expand All @@ -40,7 +41,6 @@
"sorting": "Ordenar",
"descending": "Descendente",
"ascending": "Ascendente",
"no": "no",
"num": "n.<sup>o</sup>",
"dated": "de",
"page": "Página",
Expand All @@ -49,6 +49,8 @@
"previousP": "Previa",
"nextP": "Próxima",
"lastP": "Última",
"yes": "",
"no": "no",

"creationCompleted": "Creación completada.",
"configSaved": "Ajustes guardados.",
Expand All @@ -59,6 +61,8 @@
"commentWritten": "Comentario guardado con éxito.",
"commentNotWritten": "Error al escribir el comentario.",
"participantAlreadyInList": "Este participante ya está en la lista.",
"approverAlreadyInList": "Este aprobador ya está en la lista.",
"noData": "Datos no disponibles.",
"removedElems": "Objetos eliminados:",
"removalError": "Error al eliminar objetos.",
"updatedElems": "Objetos actualizados:",
Expand Down Expand Up @@ -131,8 +135,8 @@
"user": "Usuario",
"newUser": "Nuevo usuario",
"gotoCompaniesPage": "Ir a la lista de compañías",
"allUsers": "todos los usuarios",
"userPage": "página de usuario",
"allUsers": "Todos los usuarios",
"userPage": "Página de usuario",
"companiesUnitsFilterTitle": "por unidad relacionada con una compañía",
"noRole": "Sin rol",
"adminRole": "Administrador",
Expand Down Expand Up @@ -184,8 +188,8 @@
],
"newCompany": "Nueva compañia",
"gotoTeamPage": "Ir a la página del equipo",
"allCompanies": "todas las compañias",
"companyPage": "página de la compañía",
"allCompanies": "Todas las compañias",
"companyPage": "Página de la compañía",
"companyShort": "Breve",
"companyFull": "Completo",
"companyForeign": "En un idioma extranjero",
Expand All @@ -208,8 +212,9 @@

"document": "Documento",
"newDocument": "Nuevo documento",
"allDocuments": "todos los documentos",
"documentPage": "página del documento",
"myDocuments": "Mis documentos",
"allDocuments": "Todos los documentos",
"documentPage": "Página del documento",
"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"},
"detailsType": "Detalles del documento, tipo",
"registration": "Registro",
Expand All @@ -228,8 +233,38 @@
"sumLabel": "suma: ",
"authors": "Autores",
"addressees": "Destinatarios",
"docNote": "Nota",
"note": "Nota",
"docFiles": "Archivos del documento",
"myDocsCreated": {"text": "Mis documentos", "title": "Documents for which I am creator"},
"approve": "Aprobar",
"reject": "Rechazar",
"saveNote": "Guardar nota",
"approvalList": "Lista de aprobación",
"youApproved": "Aprobado por usted.",
"youRejected": "Rechazado por usted.",
"yourApprovalBroken": "Tu aprobación se rompió.",
"approvalDialog": "Diálogo de aprobación",
"approval": "Aprobación",
"signature": "Firma",
"digital": "Digital",
"approvalNote": "Escriba aquí la nota de aprobación si lo desea o deje vacío.",
"approver": "Aprobador",
"approvers": "Aprobadores",
"selectApproverToAdd": "Seleccione un aprobador para agregar",
"addApprover": "Agregar aprobador",
"myApprovals": "Mis aprobaciones",
"approvalBreak": "¡Esto romperá cualquier aprobación si está presente!",
"approvalSign": [
"Para aprobación",
"Aprobado",
"Rechazado",
"Roto"
],
"approvalSignMy": [
"Para mi aprobación",
"Aprobado por mi",
"Rechazado por mi"
],
"categoriesName": "Categorías",
"categories": [
"Ninguno",
Expand Down Expand Up @@ -257,8 +292,8 @@

"task": "Tarea",
"newTask": "Nueva tarea",
"allTasks": "todas las tareas",
"tasksPage": "pagina de tarea",
"allTasks": "Todas las tareas",
"tasksPage": "Pagina de tarea",
"status": "Estado",
"statuses": "Estados",
"taskID": "Núm. de tarea",
Expand Down
Loading

0 comments on commit 0ee4a10

Please sign in to comment.