diff --git a/src/main/java/tech/ailef/dbadmin/external/controller/GlobalController.java b/src/main/java/tech/ailef/dbadmin/external/controller/GlobalController.java index 2718174..aa2a530 100644 --- a/src/main/java/tech/ailef/dbadmin/external/controller/GlobalController.java +++ b/src/main/java/tech/ailef/dbadmin/external/controller/GlobalController.java @@ -33,8 +33,8 @@ import tech.ailef.dbadmin.external.exceptions.DbAdminNotFoundException; import tech.ailef.dbadmin.internal.UserConfiguration; /** - * This class registers some ModelAttribute objects that are - * used in all templates. + * This class registers some global ModelAttributes and exception handlers. + * */ @ControllerAdvice public class GlobalController { @@ -50,7 +50,7 @@ public class GlobalController { model.addAttribute("status", "404"); model.addAttribute("error", "Error"); model.addAttribute("message", e.getMessage()); - model.addAttribute("userConf", userConf); + model.addAttribute("dbadmin_userConf", userConf); model.addAttribute("baseUrl", getBaseUrl()); return "other/error"; } @@ -61,7 +61,7 @@ public class GlobalController { * @param request the incoming request * @return multi valued map of request parameters */ - @ModelAttribute("queryParams") + @ModelAttribute("dbadmin_queryParams") public Map getQueryParams(HttpServletRequest request) { return request.getParameterMap(); } @@ -70,7 +70,7 @@ public class GlobalController { * The baseUrl as specified in the properties file by the user * @return */ - @ModelAttribute("baseUrl") + @ModelAttribute("dbadmin_baseUrl") public String getBaseUrl() { return props.getBaseUrl(); } @@ -80,7 +80,7 @@ public class GlobalController { * @param request * @return */ - @ModelAttribute("requestUrl") + @ModelAttribute("dbadmin_requestUrl") public String getRequestUrl(HttpServletRequest request) { return request.getRequestURI(); } @@ -90,7 +90,7 @@ public class GlobalController { * in the settings table. * @return */ - @ModelAttribute("userConf") + @ModelAttribute("dbadmin_userConf") public UserConfiguration getUserConf() { return userConf; } diff --git a/src/main/resources/templates/fragments/data_row.html b/src/main/resources/templates/fragments/data_row.html index e934b25..09a147a 100644 --- a/src/main/resources/templates/fragments/data_row.html +++ b/src/main/resources/templates/fragments/data_row.html @@ -11,10 +11,10 @@ + th:href="|/${dbadmin_baseUrl}/model/${schema.getJavaClass().getName()}/edit/${row.getPrimaryKeyValue()}|">
+ th:action="|/${dbadmin_baseUrl}/model/${schema.getJavaClass().getName()}/delete/${row.getPrimaryKeyValue()}|">
@@ -37,7 +37,7 @@ - +

- + @@ -66,11 +66,11 @@

+ th:src="|/${dbadmin_baseUrl}/download/${schema.getClassName()}/${field.getJavaName()}/${object.getPrimaryKeyValue()}/image|">
+ th:href="|/${dbadmin_baseUrl}/download/${schema.getClassName()}/${field.getJavaName()}/${object.getPrimaryKeyValue()}|"> Download ([[ ${object.get(field).getValue().length} ]] bytes) diff --git a/src/main/resources/templates/fragments/inputs.html b/src/main/resources/templates/fragments/inputs.html index 0ebbf9d..7d94c7d 100644 --- a/src/main/resources/templates/fragments/inputs.html +++ b/src/main/resources/templates/fragments/inputs.html @@ -136,7 +136,7 @@
+ th:src="|/${dbadmin_baseUrl}/download/${schema.getClassName()}/${field.getJavaName()}/${object.getPrimaryKeyValue()}/image|">
File input diff --git a/src/main/resources/templates/fragments/resources.html b/src/main/resources/templates/fragments/resources.html index 0b8382b..442e89f 100644 --- a/src/main/resources/templates/fragments/resources.html +++ b/src/main/resources/templates/fragments/resources.html @@ -14,10 +14,10 @@ - @@ -35,7 +35,7 @@