moves project index to separate sub path

Sun, 17 May 2020 16:38:04 +0200

author
Mike Becker <universe@uap-core.de>
date
Sun, 17 May 2020 16:38:04 +0200
changeset 61
3e287f361c7a
parent 60
ed51c5b1f3e5
child 62
833e0385572a

moves project index to separate sub path

unfortunately the current menu highlighting strategy sucks and this is the easiest way so that everything looks correct

src/main/java/de/uapcore/lightpit/modules/ProjectsModule.java file | annotate | diff | comparison | revisions
src/main/webapp/WEB-INF/dynamic_fragments/project-form.jsp file | annotate | diff | comparison | revisions
src/main/webapp/WEB-INF/dynamic_fragments/projects.jsp file | annotate | diff | comparison | revisions
     1.1 --- a/src/main/java/de/uapcore/lightpit/modules/ProjectsModule.java	Sun May 17 16:28:13 2020 +0200
     1.2 +++ b/src/main/java/de/uapcore/lightpit/modules/ProjectsModule.java	Sun May 17 16:38:04 2020 +0200
     1.3 @@ -63,7 +63,13 @@
     1.4  
     1.5      public static final String SESSION_ATTR_SELECTED_PROJECT = fqn(ProjectsModule.class, "selected-project");
     1.6  
     1.7 -    @RequestMapping(method = HttpMethod.GET, menuKey = "menu.index")
     1.8 +    @RequestMapping(method = HttpMethod.GET)
     1.9 +    public ResponseType indexRedirect(HttpServletResponse resp) throws IOException {
    1.10 +        resp.sendRedirect("index/");
    1.11 +        return ResponseType.NONE;
    1.12 +    }
    1.13 +
    1.14 +    @RequestMapping(requestPath = "index", method = HttpMethod.GET, menuKey = "menu.index")
    1.15      public ResponseType index(HttpServletRequest req, DataAccessObjects dao) throws SQLException {
    1.16          final var projectList = dao.getProjectDao().list();
    1.17          req.setAttribute("projects", projectList);
    1.18 @@ -122,7 +128,7 @@
    1.19  
    1.20              dao.getProjectDao().saveOrUpdate(project);
    1.21  
    1.22 -            setRedirectLocation(req, "./projects/");
    1.23 +            setRedirectLocation(req, "./projects/index/");
    1.24              setDynamicFragment(req, Constants.DYN_FRAGMENT_COMMIT_SUCCESSFUL);
    1.25              LOG.debug("Successfully updated project {}", project.getName());
    1.26          } catch (NoSuchElementException | NumberFormatException | SQLException ex) {
     2.1 --- a/src/main/webapp/WEB-INF/dynamic_fragments/project-form.jsp	Sun May 17 16:28:13 2020 +0200
     2.2 +++ b/src/main/webapp/WEB-INF/dynamic_fragments/project-form.jsp	Sun May 17 16:38:04 2020 +0200
     2.3 @@ -69,7 +69,7 @@
     2.4          <tr>
     2.5              <td colspan="2">
     2.6                  <input type="hidden" name="id" value="${project.id}" />
     2.7 -                <a href="./${moduleInfo.modulePath}/" class="button"><fmt:message bundle="${lightpit_bundle}" key="button.cancel"/></a>
     2.8 +                <a href="./${moduleInfo.modulePath}/index/" class="button"><fmt:message bundle="${lightpit_bundle}" key="button.cancel"/></a>
     2.9                  <button type="submit"><fmt:message bundle="${lightpit_bundle}" key="button.okay" /></button>
    2.10              </td>
    2.11          </tr>
     3.1 --- a/src/main/webapp/WEB-INF/dynamic_fragments/projects.jsp	Sun May 17 16:28:13 2020 +0200
     3.2 +++ b/src/main/webapp/WEB-INF/dynamic_fragments/projects.jsp	Sun May 17 16:38:04 2020 +0200
     3.3 @@ -67,7 +67,7 @@
     3.4      <c:forEach var="project" items="${projects}">
     3.5          <tr class="nowrap" <c:if test="${project eq selectedProject}">data-selected</c:if> >
     3.6              <td style="width: 2em;"><a href="./${moduleInfo.modulePath}/edit?id=${project.id}">&#x270e;</a></td>
     3.7 -            <td><a href="./${moduleInfo.modulePath}/?select=${project.id}"><c:out value="${project.name}"/></a></td>
     3.8 +            <td><a href="./${moduleInfo.modulePath}/index/?select=${project.id}"><c:out value="${project.name}"/></a></td>
     3.9              <td><c:out value="${project.description}"/></td>
    3.10              <td>
    3.11                  <c:if test="${not empty project.repoUrl}">

mercurial