adds the possibility to add users / developers

Sat, 16 May 2020 13:29:44 +0200

author
Mike Becker <universe@uap-core.de>
date
Sat, 16 May 2020 13:29:44 +0200
changeset 51
dd0a45ae25d7
parent 50
2a90d105edec
child 52
67a02e79b7a1

adds the possibility to add users / developers

setup/postgres/psql_default_data.sql file | annotate | diff | comparison | revisions
src/main/java/de/uapcore/lightpit/LightPITModule.java file | annotate | diff | comparison | revisions
src/main/java/de/uapcore/lightpit/dao/postgres/PGProjectDao.java file | annotate | diff | comparison | revisions
src/main/java/de/uapcore/lightpit/dao/postgres/PGUserDao.java file | annotate | diff | comparison | revisions
src/main/java/de/uapcore/lightpit/entities/User.java file | annotate | diff | comparison | revisions
src/main/java/de/uapcore/lightpit/modules/ProjectsModule.java file | annotate | diff | comparison | revisions
src/main/java/de/uapcore/lightpit/modules/UsersModule.java file | annotate | diff | comparison | revisions
src/main/resources/localization/home.properties file | annotate | diff | comparison | revisions
src/main/resources/localization/home_de.properties file | annotate | diff | comparison | revisions
src/main/resources/localization/language.properties file | annotate | diff | comparison | revisions
src/main/resources/localization/language_de.properties file | annotate | diff | comparison | revisions
src/main/resources/localization/projects.properties file | annotate | diff | comparison | revisions
src/main/resources/localization/projects_de.properties file | annotate | diff | comparison | revisions
src/main/resources/localization/users.properties file | annotate | diff | comparison | revisions
src/main/resources/localization/users_de.properties 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
src/main/webapp/WEB-INF/dynamic_fragments/user-form.jsp file | annotate | diff | comparison | revisions
src/main/webapp/WEB-INF/dynamic_fragments/users.jsp file | annotate | diff | comparison | revisions
src/main/webapp/lightpit.css file | annotate | diff | comparison | revisions
     1.1 --- a/setup/postgres/psql_default_data.sql	Sat May 16 11:37:57 2020 +0200
     1.2 +++ b/setup/postgres/psql_default_data.sql	Sat May 16 13:29:44 2020 +0200
     1.3 @@ -1,6 +0,0 @@
     1.4 -/*
     1.5 - * Some default data.
     1.6 - */
     1.7 -
     1.8 -insert into lpit_user (userid, username)
     1.9 -values (-1, 'Anonymous');
     2.1 --- a/src/main/java/de/uapcore/lightpit/LightPITModule.java	Sat May 16 11:37:57 2020 +0200
     2.2 +++ b/src/main/java/de/uapcore/lightpit/LightPITModule.java	Sat May 16 13:29:44 2020 +0200
     2.3 @@ -68,21 +68,6 @@
     2.4      String modulePath();
     2.5  
     2.6      /**
     2.7 -     * Returns the properties key for the module name.
     2.8 -     *
     2.9 -     * @return the properties key
    2.10 -     */
    2.11 -    String nameKey() default "name";
    2.12 -
    2.13 -    /**
    2.14 -     * Returns the properties key for the module description.
    2.15 -     *
    2.16 -     * @return the properties key
    2.17 -     */
    2.18 -    String descKey() default "description";
    2.19 -
    2.20 -
    2.21 -    /**
    2.22       * Returns the properties key for the menu label.
    2.23       * <p>
    2.24       * Set this string to empty string, if the module should be hidden from
    2.25 @@ -126,15 +111,13 @@
    2.26       * are proxied by this object.
    2.27       */
    2.28      class ELProxy {
    2.29 -        private final String bundleBaseName, modulePath, menuKey, titleKey, nameKey, descKey;
    2.30 +        private final String bundleBaseName, modulePath, menuKey, titleKey;
    2.31  
    2.32          public ELProxy(LightPITModule annotation) {
    2.33              bundleBaseName = annotation.bundleBaseName();
    2.34              modulePath = annotation.modulePath();
    2.35              menuKey = annotation.menuKey();
    2.36              titleKey = annotation.titleKey();
    2.37 -            nameKey = annotation.nameKey();
    2.38 -            descKey = annotation.descKey();
    2.39          }
    2.40  
    2.41          public String getBundleBaseName() {
    2.42 @@ -152,14 +135,5 @@
    2.43          public String getTitleKey() {
    2.44              return titleKey;
    2.45          }
    2.46 -
    2.47 -        public String getNameKey() {
    2.48 -            return nameKey;
    2.49 -        }
    2.50 -
    2.51 -        public String getDescKey() {
    2.52 -            return descKey;
    2.53 -        }
    2.54 -
    2.55      }
    2.56  }
     3.1 --- a/src/main/java/de/uapcore/lightpit/dao/postgres/PGProjectDao.java	Sat May 16 11:37:57 2020 +0200
     3.2 +++ b/src/main/java/de/uapcore/lightpit/dao/postgres/PGProjectDao.java	Sat May 16 13:29:44 2020 +0200
     3.3 @@ -96,7 +96,7 @@
     3.4          insert.setString(1, instance.getName());
     3.5          setStringOrNull(insert, 2, instance.getDescription());
     3.6          setStringOrNull(insert, 3, instance.getRepoUrl());
     3.7 -        setForeignKeyOrNull(insert, 4, instance.getOwner(), User::getUserID);
     3.8 +        setForeignKeyOrNull(insert, 4, instance.getOwner(), User::getId);
     3.9          insert.executeUpdate();
    3.10      }
    3.11  
    3.12 @@ -106,7 +106,7 @@
    3.13          update.setString(1, instance.getName());
    3.14          setStringOrNull(update, 2, instance.getDescription());
    3.15          setStringOrNull(update, 3, instance.getRepoUrl());
    3.16 -        setForeignKeyOrNull(update, 4, instance.getOwner(), User::getUserID);
    3.17 +        setForeignKeyOrNull(update, 4, instance.getOwner(), User::getId);
    3.18          update.setInt(5, instance.getId());
    3.19          return update.executeUpdate() > 0;
    3.20      }
     4.1 --- a/src/main/java/de/uapcore/lightpit/dao/postgres/PGUserDao.java	Sat May 16 11:37:57 2020 +0200
     4.2 +++ b/src/main/java/de/uapcore/lightpit/dao/postgres/PGUserDao.java	Sat May 16 13:29:44 2020 +0200
     4.3 @@ -44,10 +44,6 @@
     4.4  
     4.5  public final class PGUserDao implements UserDao, GenericDao<User> {
     4.6  
     4.7 -    public static final String[] COLUMNS = {
     4.8 -            "id", "username", "lastname", "givenname", "mail"
     4.9 -    };
    4.10 -
    4.11      private final PreparedStatement insert, update, list, find;
    4.12  
    4.13      public PGUserDao(Connection connection) throws SQLException {
    4.14 @@ -89,7 +85,7 @@
    4.15          setStringOrNull(update, 1, instance.getLastname());
    4.16          setStringOrNull(update, 2, instance.getGivenname());
    4.17          setStringOrNull(update, 3, instance.getMail());
    4.18 -        update.setInt(4, instance.getUserID());
    4.19 +        update.setInt(4, instance.getId());
    4.20          return update.executeUpdate() > 0;
    4.21      }
    4.22  
     5.1 --- a/src/main/java/de/uapcore/lightpit/entities/User.java	Sat May 16 11:37:57 2020 +0200
     5.2 +++ b/src/main/java/de/uapcore/lightpit/entities/User.java	Sat May 16 13:29:44 2020 +0200
     5.3 @@ -34,18 +34,18 @@
     5.4  
     5.5      public static final int ANONYMOUS_USERID = -1;
     5.6  
     5.7 -    private final int userID;
     5.8 +    private final int id;
     5.9      private String username;
    5.10      private String mail;
    5.11      private String givenname;
    5.12      private String lastname;
    5.13  
    5.14 -    public User(int userID) {
    5.15 -        this.userID = userID;
    5.16 +    public User(int id) {
    5.17 +        this.id = id;
    5.18      }
    5.19  
    5.20 -    public int getUserID() {
    5.21 -        return userID;
    5.22 +    public int getId() {
    5.23 +        return id;
    5.24      }
    5.25  
    5.26      public String getUsername() {
    5.27 @@ -82,9 +82,11 @@
    5.28  
    5.29      public String getDisplayname() {
    5.30          StringBuilder dn = new StringBuilder();
    5.31 -        dn.append(givenname);
    5.32 +        if (givenname != null)
    5.33 +            dn.append(givenname);
    5.34          dn.append(' ');
    5.35 -        dn.append(lastname);
    5.36 +        if (lastname != null)
    5.37 +            dn.append(lastname);
    5.38          dn.append(' ');
    5.39          if (mail != null && !mail.isBlank()) {
    5.40              dn.append("<"+mail+">");
    5.41 @@ -98,11 +100,11 @@
    5.42          if (this == o) return true;
    5.43          if (o == null || getClass() != o.getClass()) return false;
    5.44          User user = (User) o;
    5.45 -        return userID == user.userID;
    5.46 +        return id == user.id;
    5.47      }
    5.48  
    5.49      @Override
    5.50      public int hashCode() {
    5.51 -        return Objects.hash(userID);
    5.52 +        return Objects.hash(id);
    5.53      }
    5.54  }
     6.1 --- a/src/main/java/de/uapcore/lightpit/modules/ProjectsModule.java	Sat May 16 11:37:57 2020 +0200
     6.2 +++ b/src/main/java/de/uapcore/lightpit/modules/ProjectsModule.java	Sat May 16 13:29:44 2020 +0200
     6.3 @@ -52,16 +52,14 @@
     6.4  
     6.5      @RequestMapping(method = HttpMethod.GET)
     6.6      public ResponseType index(HttpServletRequest req, DataAccessObjects dao) throws SQLException {
     6.7 -        final var projectDao = dao.getProjectDao();
     6.8 -
     6.9 -        req.setAttribute("projects", projectDao.list());
    6.10 +        req.setAttribute("projects", dao.getProjectDao().list());
    6.11          setDynamicFragment(req, "projects");
    6.12  
    6.13          return ResponseType.HTML;
    6.14      }
    6.15  
    6.16      @RequestMapping(requestPath = "edit", method = HttpMethod.GET)
    6.17 -    public ResponseType displayCreateForm(HttpServletRequest req, DataAccessObjects dao) throws SQLException {
    6.18 +    public ResponseType edit(HttpServletRequest req, DataAccessObjects dao) throws SQLException {
    6.19          final var projectDao = dao.getProjectDao();
    6.20  
    6.21          Optional<Integer> id = getParameter(req, Integer.class, "id");
    6.22 @@ -70,6 +68,7 @@
    6.23          } else {
    6.24              req.setAttribute("project", new Project(-1));
    6.25          }
    6.26 +        req.setAttribute("users", dao.getUserDao().list());
    6.27  
    6.28          setDynamicFragment(req, "project-form");
    6.29  
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/src/main/java/de/uapcore/lightpit/modules/UsersModule.java	Sat May 16 13:29:44 2020 +0200
     7.3 @@ -0,0 +1,101 @@
     7.4 +/*
     7.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
     7.6 + *
     7.7 + * Copyright 2018 Mike Becker. All rights reserved.
     7.8 + *
     7.9 + * Redistribution and use in source and binary forms, with or without
    7.10 + * modification, are permitted provided that the following conditions are met:
    7.11 + *
    7.12 + *   1. Redistributions of source code must retain the above copyright
    7.13 + *      notice, this list of conditions and the following disclaimer.
    7.14 + *
    7.15 + *   2. Redistributions in binary form must reproduce the above copyright
    7.16 + *      notice, this list of conditions and the following disclaimer in the
    7.17 + *      documentation and/or other materials provided with the distribution.
    7.18 + *
    7.19 + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    7.20 + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    7.21 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
    7.22 + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
    7.23 + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
    7.24 + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
    7.25 + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
    7.26 + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
    7.27 + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
    7.28 + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
    7.29 + * POSSIBILITY OF SUCH DAMAGE.
    7.30 + *
    7.31 + */
    7.32 +package de.uapcore.lightpit.modules;
    7.33 +
    7.34 +
    7.35 +import de.uapcore.lightpit.*;
    7.36 +import de.uapcore.lightpit.dao.DataAccessObjects;
    7.37 +import de.uapcore.lightpit.entities.User;
    7.38 +
    7.39 +import javax.servlet.annotation.WebServlet;
    7.40 +import javax.servlet.http.HttpServletRequest;
    7.41 +import java.sql.SQLException;
    7.42 +import java.util.Optional;
    7.43 +
    7.44 +@LightPITModule(
    7.45 +        bundleBaseName = "localization.users",
    7.46 +        modulePath = "teams",
    7.47 +        defaultPriority = 100
    7.48 +)
    7.49 +@WebServlet(
    7.50 +        name = "UsersModule",
    7.51 +        urlPatterns = "/teams/*"
    7.52 +)
    7.53 +public final class UsersModule extends AbstractLightPITServlet {
    7.54 +
    7.55 +    @RequestMapping(method = HttpMethod.GET)
    7.56 +    public ResponseType index(HttpServletRequest req, DataAccessObjects dao) throws SQLException {
    7.57 +        final var userDao = dao.getUserDao();
    7.58 +
    7.59 +        req.setAttribute("users", userDao.list());
    7.60 +        setDynamicFragment(req, "users");
    7.61 +
    7.62 +        return ResponseType.HTML;
    7.63 +    }
    7.64 +
    7.65 +    @RequestMapping(requestPath = "edit", method = HttpMethod.GET)
    7.66 +    public ResponseType edit(HttpServletRequest req, DataAccessObjects dao) throws SQLException {
    7.67 +        final var userDao = dao.getUserDao();
    7.68 +
    7.69 +        Optional<Integer> id = getParameter(req, Integer.class, "id");
    7.70 +        if (id.isPresent()) {
    7.71 +            req.setAttribute("user", Optional.ofNullable(userDao.find(id.get())).orElse(new User(-1)));
    7.72 +        } else {
    7.73 +            req.setAttribute("user", new User(-1));
    7.74 +        }
    7.75 +
    7.76 +        setDynamicFragment(req, "user-form");
    7.77 +
    7.78 +        return ResponseType.HTML;
    7.79 +    }
    7.80 +
    7.81 +    @RequestMapping(requestPath = "commit", method = HttpMethod.POST)
    7.82 +    public ResponseType commit(HttpServletRequest req, DataAccessObjects dao) {
    7.83 +
    7.84 +        User user = new User(-1);
    7.85 +        try {
    7.86 +            user = new User(getParameter(req, Integer.class, "userid").orElseThrow());
    7.87 +            user.setUsername(getParameter(req, String.class, "username").orElseThrow());
    7.88 +            getParameter(req, String.class, "givenname").ifPresent(user::setGivenname);
    7.89 +            getParameter(req, String.class, "lastname").ifPresent(user::setLastname);
    7.90 +            getParameter(req, String.class, "mail").ifPresent(user::setMail);
    7.91 +
    7.92 +            dao.getUserDao().saveOrUpdate(user);
    7.93 +
    7.94 +            setRedirectLocation(req, "./teams/");
    7.95 +            setDynamicFragment(req, Constants.DYN_FRAGMENT_COMMIT_SUCCESSFUL);
    7.96 +        } catch (NullPointerException | NumberFormatException | SQLException ex) {
    7.97 +            // TODO: set request attribute with error text
    7.98 +            req.setAttribute("user", user);
    7.99 +            setDynamicFragment(req, "user-form");
   7.100 +        }
   7.101 +
   7.102 +        return ResponseType.HTML;
   7.103 +    }
   7.104 +}
     8.1 --- a/src/main/resources/localization/home.properties	Sat May 16 11:37:57 2020 +0200
     8.2 +++ b/src/main/resources/localization/home.properties	Sat May 16 13:29:44 2020 +0200
     8.3 @@ -21,8 +21,6 @@
     8.4  # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
     8.5  # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
     8.6  
     8.7 -name = Home Page
     8.8 -description = The default page that is displayed when visiting the site.
     8.9  menuLabel = Home
    8.10  
    8.11  version=LightPIT - Version 0.1 (Snapshot) 
    8.12 \ No newline at end of file
     9.1 --- a/src/main/resources/localization/home_de.properties	Sat May 16 11:37:57 2020 +0200
     9.2 +++ b/src/main/resources/localization/home_de.properties	Sat May 16 13:29:44 2020 +0200
     9.3 @@ -21,8 +21,6 @@
     9.4  # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
     9.5  # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
     9.6  
     9.7 -name = Startseite
     9.8 -description = Die Seite, die dem Benutzer standardm\u00e4\u00dfig beim Besuch angezeigt wird.
     9.9  menuLabel = Startseite
    9.10  
    9.11  version=LightPIT - Version 0.1 (Entwicklungsversion) 
    10.1 --- a/src/main/resources/localization/language.properties	Sat May 16 11:37:57 2020 +0200
    10.2 +++ b/src/main/resources/localization/language.properties	Sat May 16 13:29:44 2020 +0200
    10.3 @@ -21,8 +21,6 @@
    10.4  # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    10.5  # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
    10.6  
    10.7 -name = Language Selector
    10.8 -description=Where the user can choose his / her language setting.
    10.9  menuLabel=Language
   10.10  
   10.11  submit = Switch language
    11.1 --- a/src/main/resources/localization/language_de.properties	Sat May 16 11:37:57 2020 +0200
    11.2 +++ b/src/main/resources/localization/language_de.properties	Sat May 16 13:29:44 2020 +0200
    11.3 @@ -21,9 +21,6 @@
    11.4  # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    11.5  # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
    11.6  
    11.7 -name = Sprachauswahl
    11.8 -description = Hier kann der Benutzer die Sprache f\u00fcr die Website ausw\u00e4hlen.
    11.9 -
   11.10  menuLabel = Sprache
   11.11  
   11.12  submit = Sprache ausw\u00e4hlen
    12.1 --- a/src/main/resources/localization/projects.properties	Sat May 16 11:37:57 2020 +0200
    12.2 +++ b/src/main/resources/localization/projects.properties	Sat May 16 13:29:44 2020 +0200
    12.3 @@ -21,8 +21,6 @@
    12.4  # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    12.5  # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    12.6  
    12.7 -name=Project Management
    12.8 -description=Allows the configuration of projects.
    12.9  menuLabel=Projects
   12.10  
   12.11  menu.versions=Versions
    13.1 --- a/src/main/resources/localization/projects_de.properties	Sat May 16 11:37:57 2020 +0200
    13.2 +++ b/src/main/resources/localization/projects_de.properties	Sat May 16 13:29:44 2020 +0200
    13.3 @@ -21,8 +21,6 @@
    13.4  # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    13.5  # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    13.6  
    13.7 -name=Projektverwaltung
    13.8 -description=Erlaubt die Konfiguration von Projekten.
    13.9  menuLabel=Projekte
   13.10  
   13.11  menu.versions=Versionen
    14.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.2 +++ b/src/main/resources/localization/users.properties	Sat May 16 13:29:44 2020 +0200
    14.3 @@ -0,0 +1,35 @@
    14.4 +# Copyright 2018 Mike Becker. All rights reserved.
    14.5 +#
    14.6 +# Redistribution and use in source and binary forms, with or without
    14.7 +# modification, are permitted provided that the following conditions are met:
    14.8 +#
    14.9 +# 1. Redistributions of source code must retain the above copyright
   14.10 +# notice, this list of conditions and the following disclaimer.
   14.11 +#
   14.12 +# 2. Redistributions in binary form must reproduce the above copyright
   14.13 +# notice, this list of conditions and the following disclaimer in the
   14.14 +# documentation and/or other materials provided with the distribution.
   14.15 +#
   14.16 +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
   14.17 +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   14.18 +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   14.19 +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
   14.20 +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   14.21 +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
   14.22 +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
   14.23 +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   14.24 +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   14.25 +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   14.26 +
   14.27 +menuLabel=Developer
   14.28 +
   14.29 +button.create=Add Developer
   14.30 +
   14.31 +no-users=No developers have been configured yet.
   14.32 +
   14.33 +thead.username=User Name
   14.34 +thead.givenname=Given Name
   14.35 +thead.lastname=Last Name
   14.36 +thead.mail=E-Mail
   14.37 +
   14.38 +thead.displayname=Developer
    15.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.2 +++ b/src/main/resources/localization/users_de.properties	Sat May 16 13:29:44 2020 +0200
    15.3 @@ -0,0 +1,35 @@
    15.4 +# Copyright 2018 Mike Becker. All rights reserved.
    15.5 +#
    15.6 +# Redistribution and use in source and binary forms, with or without
    15.7 +# modification, are permitted provided that the following conditions are met:
    15.8 +#
    15.9 +# 1. Redistributions of source code must retain the above copyright
   15.10 +# notice, this list of conditions and the following disclaimer.
   15.11 +#
   15.12 +# 2. Redistributions in binary form must reproduce the above copyright
   15.13 +# notice, this list of conditions and the following disclaimer in the
   15.14 +# documentation and/or other materials provided with the distribution.
   15.15 +#
   15.16 +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
   15.17 +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   15.18 +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   15.19 +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
   15.20 +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   15.21 +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
   15.22 +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
   15.23 +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   15.24 +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   15.25 +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   15.26 +
   15.27 +menuLabel=Entwickler
   15.28 +
   15.29 +button.create=Neuer Entwickler
   15.30 +
   15.31 +no-users=Bislang wurden keine Entwickler hinterlegt.
   15.32 +
   15.33 +thead.username=Benutzername
   15.34 +thead.givenname=Vorname
   15.35 +thead.lastname=Nachname
   15.36 +thead.mail=E-Mail
   15.37 +
   15.38 +thead.displayname=Entwickler
    16.1 --- a/src/main/webapp/WEB-INF/dynamic_fragments/project-form.jsp	Sat May 16 11:37:57 2020 +0200
    16.2 +++ b/src/main/webapp/WEB-INF/dynamic_fragments/project-form.jsp	Sat May 16 13:29:44 2020 +0200
    16.3 @@ -32,6 +32,7 @@
    16.4  <c:set scope="page" var="moduleInfo" value="${requestScope[Constants.REQ_ATTR_MODULE_INFO]}"/>
    16.5  
    16.6  <jsp:useBean id="project" type="de.uapcore.lightpit.entities.Project" scope="request"/>
    16.7 +<jsp:useBean id="users" type="java.util.List<de.uapcore.lightpit.entities.User>" scope="request"/>
    16.8  
    16.9  <form action="./${moduleInfo.modulePath}/commit" method="post">
   16.10      <table class="formtable" style="width: 80ch">
   16.11 @@ -57,7 +58,9 @@
   16.12              <td>
   16.13                  <select name="owner">
   16.14                      <option value="-1"><fmt:message key="placeholder.null-owner" /> </option>
   16.15 -                    <!-- TODO: add user selection -->
   16.16 +                    <c:forEach var="user" items="${users}">
   16.17 +                        <option value="${user.id}">${user.displayname}</option>
   16.18 +                    </c:forEach>
   16.19                  </select>
   16.20              </td>
   16.21          </tr>
    17.1 --- a/src/main/webapp/WEB-INF/dynamic_fragments/projects.jsp	Sat May 16 11:37:57 2020 +0200
    17.2 +++ b/src/main/webapp/WEB-INF/dynamic_fragments/projects.jsp	Sat May 16 13:29:44 2020 +0200
    17.3 @@ -47,10 +47,10 @@
    17.4  <table class="datatable medskip">
    17.5      <colgroup>
    17.6          <col>
    17.7 -        <col style="width: 15%">
    17.8 +        <col style="width: 10%">
    17.9          <col style="width: 35%">
   17.10          <col style="width: 30%">
   17.11 -        <col style="width: 20%">
   17.12 +        <col style="width: 25%">
   17.13      </colgroup>
   17.14      <thead>
   17.15      <tr>
   17.16 @@ -64,7 +64,7 @@
   17.17      <tbody>
   17.18      <c:forEach var="project" items="${projects}">
   17.19          <tr>
   17.20 -            <td><a href="./${moduleInfo.modulePath}/edit?id=${project.id}">&#x270e;</a></td>
   17.21 +            <td style="width: 2em;"><a href="./${moduleInfo.modulePath}/edit?id=${project.id}">&#x270e;</a></td>
   17.22              <td><c:out value="${project.name}"/></td>
   17.23              <td><c:out value="${project.description}"/></td>
   17.24              <td>
    18.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.2 +++ b/src/main/webapp/WEB-INF/dynamic_fragments/user-form.jsp	Sat May 16 13:29:44 2020 +0200
    18.3 @@ -0,0 +1,70 @@
    18.4 +<%--
    18.5 +DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    18.6 +
    18.7 +Copyright 2018 Mike Becker. All rights reserved.
    18.8 +
    18.9 +Redistribution and use in source and binary forms, with or without
   18.10 +modification, are permitted provided that the following conditions are met:
   18.11 +
   18.12 +1. Redistributions of source code must retain the above copyright
   18.13 +notice, this list of conditions and the following disclaimer.
   18.14 +
   18.15 +2. Redistributions in binary form must reproduce the above copyright
   18.16 +notice, this list of conditions and the following disclaimer in the
   18.17 +documentation and/or other materials provided with the distribution.
   18.18 +
   18.19 +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
   18.20 +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   18.21 +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   18.22 +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
   18.23 +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   18.24 +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
   18.25 +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
   18.26 +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   18.27 +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   18.28 +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   18.29 +--%>
   18.30 +<%@page pageEncoding="UTF-8" %>
   18.31 +<%@page import="de.uapcore.lightpit.Constants" %>
   18.32 +<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
   18.33 +<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
   18.34 +
   18.35 +<c:set scope="page" var="moduleInfo" value="${requestScope[Constants.REQ_ATTR_MODULE_INFO]}"/>
   18.36 +
   18.37 +<jsp:useBean id="user" type="de.uapcore.lightpit.entities.User" scope="request"/>
   18.38 +
   18.39 +<form action="./${moduleInfo.modulePath}/commit" method="post">
   18.40 +    <table class="formtable" style="width: 35ch">
   18.41 +        <colgroup>
   18.42 +            <col>
   18.43 +            <col style="width: 100%">
   18.44 +        </colgroup>
   18.45 +        <tbody>
   18.46 +        <tr>
   18.47 +            <th><fmt:message key="thead.username"/></th>
   18.48 +            <td><input name="username" type="text" maxlength="50" required value="${user.username}" <c:if test="${user.id ge 0}">readonly</c:if> /> </td>
   18.49 +        </tr>
   18.50 +        <tr>
   18.51 +            <th><fmt:message key="thead.givenname"/></th>
   18.52 +            <td><input name="givenname" type="text" maxlength="50" value="${user.givenname}"/> </td>
   18.53 +        </tr>
   18.54 +        <tr>
   18.55 +            <th><fmt:message key="thead.lastname"/></th>
   18.56 +            <td><input name="lastname" type="text" maxlength="50" value="${user.lastname}"/> </td>
   18.57 +        </tr>
   18.58 +        <tr>
   18.59 +            <th><fmt:message key="thead.mail"/></th>
   18.60 +            <td><input name="mail" type="email" maxlength="50" value="${user.mail}"/> </td>
   18.61 +        </tr>
   18.62 +        </tbody>
   18.63 +        <tfoot>
   18.64 +        <tr>
   18.65 +            <td colspan="2">
   18.66 +                <input type="hidden" name="userid" value="${user.id}" />
   18.67 +                <a href="./${moduleInfo.modulePath}" class="button"><fmt:message bundle="${lightpit_bundle}" key="button.cancel"/></a>
   18.68 +                <button type="submit"><fmt:message bundle="${lightpit_bundle}" key="button.okay" /></button>
   18.69 +            </td>
   18.70 +        </tr>
   18.71 +        </tfoot>
   18.72 +    </table>
   18.73 +</form>
    19.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    19.2 +++ b/src/main/webapp/WEB-INF/dynamic_fragments/users.jsp	Sat May 16 13:29:44 2020 +0200
    19.3 @@ -0,0 +1,63 @@
    19.4 +<%--
    19.5 +DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    19.6 +
    19.7 +Copyright 2018 Mike Becker. All rights reserved.
    19.8 +
    19.9 +Redistribution and use in source and binary forms, with or without
   19.10 +modification, are permitted provided that the following conditions are met:
   19.11 +
   19.12 +1. Redistributions of source code must retain the above copyright
   19.13 +notice, this list of conditions and the following disclaimer.
   19.14 +
   19.15 +2. Redistributions in binary form must reproduce the above copyright
   19.16 +notice, this list of conditions and the following disclaimer in the
   19.17 +documentation and/or other materials provided with the distribution.
   19.18 +
   19.19 +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
   19.20 +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   19.21 +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   19.22 +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
   19.23 +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   19.24 +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
   19.25 +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
   19.26 +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   19.27 +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   19.28 +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   19.29 +--%>
   19.30 +<%@page pageEncoding="UTF-8" %>
   19.31 +<%@page import="de.uapcore.lightpit.Constants" %>
   19.32 +<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
   19.33 +<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
   19.34 +
   19.35 +<c:set scope="page" var="moduleInfo" value="${requestScope[Constants.REQ_ATTR_MODULE_INFO]}"/>
   19.36 +
   19.37 +<jsp:useBean id="users" type="java.util.List<de.uapcore.lightpit.entities.User>" scope="request"/>
   19.38 +
   19.39 +<c:if test="${empty users}">
   19.40 +    <div class="info-box">
   19.41 +        <fmt:message key="no-users" />
   19.42 +    </div>
   19.43 +</c:if>
   19.44 +
   19.45 +<div id="tool-area">
   19.46 +    <a href="./${moduleInfo.modulePath}/edit" class="button"><fmt:message key="button.create" /></a>
   19.47 +</div>
   19.48 +
   19.49 +<c:if test="${not empty users}">
   19.50 +    <table class="datatable medskip" style="width: auto">
   19.51 +        <thead>
   19.52 +        <tr>
   19.53 +            <th></th>
   19.54 +            <th><fmt:message key="thead.displayname"/></th>
   19.55 +        </tr>
   19.56 +        </thead>
   19.57 +        <tbody>
   19.58 +        <c:forEach var="user" items="${users}">
   19.59 +            <tr>
   19.60 +                <td><a href="./${moduleInfo.modulePath}/edit?id=${user.id}">&#x270e;</a></td>
   19.61 +                <td><c:out value="${user.displayname}"/></td>
   19.62 +            </tr>
   19.63 +        </c:forEach>
   19.64 +        </tbody>
   19.65 +    </table>
   19.66 +</c:if>
    20.1 --- a/src/main/webapp/lightpit.css	Sat May 16 11:37:57 2020 +0200
    20.2 +++ b/src/main/webapp/lightpit.css	Sat May 16 13:29:44 2020 +0200
    20.3 @@ -136,7 +136,7 @@
    20.4  }
    20.5  
    20.6  table.datatable tr:nth-child(2n) {
    20.7 -    background: lightblue;
    20.8 +    background: #f0ffff;
    20.9  }
   20.10  
   20.11  table.formtable {

mercurial