simplify project-details view

Tue, 03 Jan 2023 18:19:40 +0100

author
Mike Becker <universe@uap-core.de>
date
Tue, 03 Jan 2023 18:19:40 +0100
changeset 266
65c72e65ff67
parent 265
6a21bb926e02
child 267
d8ec2d8ffa82

simplify project-details view

src/main/kotlin/de/uapcore/lightpit/servlet/ProjectServlet.kt file | annotate | diff | comparison | revisions
src/main/resources/localization/strings.properties file | annotate | diff | comparison | revisions
src/main/resources/localization/strings_de.properties file | annotate | diff | comparison | revisions
src/main/webapp/WEB-INF/changelogs/changelog-de.jspf file | annotate | diff | comparison | revisions
src/main/webapp/WEB-INF/changelogs/changelog.jspf file | annotate | diff | comparison | revisions
src/main/webapp/WEB-INF/jsp/components.jsp file | annotate | diff | comparison | revisions
src/main/webapp/WEB-INF/jsp/project-details.jsp file | annotate | diff | comparison | revisions
src/main/webapp/WEB-INF/jsp/projects.jsp file | annotate | diff | comparison | revisions
src/main/webapp/WEB-INF/jsp/site.jsp file | annotate | diff | comparison | revisions
src/main/webapp/WEB-INF/jsp/users.jsp file | annotate | diff | comparison | revisions
src/main/webapp/WEB-INF/jsp/versions.jsp file | annotate | diff | comparison | revisions
src/main/webapp/WEB-INF/jspf/project-header.jspf file | annotate | diff | comparison | revisions
src/main/webapp/lightpit.css file | annotate | diff | comparison | revisions
src/main/webapp/project-details.js file | annotate | diff | comparison | revisions
src/main/webapp/projects.css file | annotate | diff | comparison | revisions
     1.1 --- a/src/main/kotlin/de/uapcore/lightpit/servlet/ProjectServlet.kt	Tue Jan 03 17:04:39 2023 +0100
     1.2 +++ b/src/main/kotlin/de/uapcore/lightpit/servlet/ProjectServlet.kt	Tue Jan 03 18:19:40 2023 +0100
     1.3 @@ -204,6 +204,7 @@
     1.4                      component
     1.5                  )
     1.6                  styleSheets = listOf("projects")
     1.7 +                javascript = "project-details"
     1.8                  render("project-details")
     1.9              }
    1.10          }
    1.11 @@ -273,6 +274,7 @@
    1.12                  projectInfo
    1.13              )
    1.14              styleSheets = listOf("projects")
    1.15 +            javascript = "project-details"
    1.16              render("versions")
    1.17          }
    1.18      }
    1.19 @@ -373,6 +375,7 @@
    1.20                  projectInfo
    1.21              )
    1.22              styleSheets = listOf("projects")
    1.23 +            javascript = "project-details"
    1.24              render("components")
    1.25          }
    1.26      }
     2.1 --- a/src/main/resources/localization/strings.properties	Tue Jan 03 17:04:39 2023 +0100
     2.2 +++ b/src/main/resources/localization/strings.properties	Tue Jan 03 18:19:40 2023 +0100
     2.3 @@ -38,6 +38,7 @@
     2.4  button.language.submit = Switch language
     2.5  button.okay=OK
     2.6  button.project.create=New Project
     2.7 +button.project.details=Project Details
     2.8  button.project.edit=Edit Project
     2.9  button.remove=Remove
    2.10  button.user.create=Add Developer
     3.1 --- a/src/main/resources/localization/strings_de.properties	Tue Jan 03 17:04:39 2023 +0100
     3.2 +++ b/src/main/resources/localization/strings_de.properties	Tue Jan 03 18:19:40 2023 +0100
     3.3 @@ -38,6 +38,7 @@
     3.4  button.language.submit = Sprache ausw\u00e4hlen
     3.5  button.okay=OK
     3.6  button.project.create=Neues Projekt
     3.7 +button.project.details=Projektdetails
     3.8  button.project.edit=Projekt Bearbeiten
     3.9  button.remove=Entfernen
    3.10  button.user.create=Neuer Entwickler
     4.1 --- a/src/main/webapp/WEB-INF/changelogs/changelog-de.jspf	Tue Jan 03 17:04:39 2023 +0100
     4.2 +++ b/src/main/webapp/WEB-INF/changelogs/changelog-de.jspf	Tue Jan 03 18:19:40 2023 +0100
     4.3 @@ -31,6 +31,7 @@
     4.4      <li>Neuer Status: Bereit (als Antwort auf Im Review).</li>
     4.5      <li>Mehrfachauswahl für Versionen im Vorgang entfernt.</li>
     4.6      <li>RSS Feeds für Projekte hinzugefügt.</li>
     4.7 +    <li>Vorgangsansicht vereinfacht.</li>
     4.8      <li>Möglichkeit zum Deaktivieren einer Komponente hinzugefügt.</li>
     4.9      <li>Datum der Veröffentlichung und des Supportendes zu Versionen hinzugefügt.</li>
    4.10      <li>Gesamtanzahl der Kommentare wird nun angezeigt.</li>
     5.1 --- a/src/main/webapp/WEB-INF/changelogs/changelog.jspf	Tue Jan 03 17:04:39 2023 +0100
     5.2 +++ b/src/main/webapp/WEB-INF/changelogs/changelog.jspf	Tue Jan 03 18:19:40 2023 +0100
     5.3 @@ -31,6 +31,7 @@
     5.4      <li>Add issue status: Ready (following Review).</li>
     5.5      <li>Remove multi selection of versions within an issue.</li>
     5.6      <li>Add RSS feeds for projects.</li>
     5.7 +    <li>Simplify issue view.</li>
     5.8      <li>Add possibility to deactivate a component.</li>
     5.9      <li>Add release and end of life dates to versions.</li>
    5.10      <li>Add the total number of comments to the caption.</li>
     6.1 --- a/src/main/webapp/WEB-INF/jsp/components.jsp	Tue Jan 03 17:04:39 2023 +0100
     6.2 +++ b/src/main/webapp/WEB-INF/jsp/components.jsp	Tue Jan 03 18:19:40 2023 +0100
     6.3 @@ -34,9 +34,10 @@
     6.4  
     6.5  <%@include file="../jspf/project-header.jspf"%>
     6.6  
     6.7 -<div id="tool-area">
     6.8 +<div>
     6.9 +    <a href="./projects/${project.node}/issues/-/-/-/create" class="button"><fmt:message key="button.issue.create"/></a>
    6.10 +    <button onclick="toggleProjectDetails()" id="toggle-details-button"><fmt:message key="button.project.details"/></button>
    6.11      <a href="./projects/${project.node}/components/-/create" class="button"><fmt:message key="button.component.create"/></a>
    6.12 -    <a href="./projects/${project.node}/issues/-/-/-/create" class="button"><fmt:message key="button.issue.create"/></a>
    6.13  </div>
    6.14  
    6.15  <h2><fmt:message key="progress" /></h2>
     7.1 --- a/src/main/webapp/WEB-INF/jsp/project-details.jsp	Tue Jan 03 17:04:39 2023 +0100
     7.2 +++ b/src/main/webapp/WEB-INF/jsp/project-details.jsp	Tue Jan 03 18:19:40 2023 +0100
     7.3 @@ -35,17 +35,9 @@
     7.4  <c:set var="version" scope="page" value="${viewmodel.version}"/>
     7.5  <%@include file="../jspf/project-header.jspf"%>
     7.6  
     7.7 -<div id="tool-area">
     7.8 +<div>
     7.9      <a href="./projects/${project.node}/issues/${empty version ? '-' : version.node}/${empty component ? '-' : component.node}/-/create" class="button"><fmt:message key="button.issue.create"/></a>
    7.10 -    <a href="./projects/${project.node}/edit" class="button"><fmt:message key="button.project.edit"/></a>
    7.11 -    <c:if test="${not empty version}">
    7.12 -        <a href="./projects/${project.node}/versions/${version.node}/edit" class="button"><fmt:message key="button.version.edit"/></a>
    7.13 -    </c:if>
    7.14 -    <a href="./projects/${project.node}/versions/-/create" class="button"><fmt:message key="button.version.create"/></a>
    7.15 -    <c:if test="${not empty component}">
    7.16 -        <a href="./projects/${project.node}/components/${component.node}/edit" class="button"><fmt:message key="button.component.edit"/></a>
    7.17 -    </c:if>
    7.18 -    <a href="./projects/${project.node}/components/-/create" class="button"><fmt:message key="button.component.create"/></a>
    7.19 +    <button onclick="toggleProjectDetails()" id="toggle-details-button"><fmt:message key="button.project.details"/></button>
    7.20  </div>
    7.21  
    7.22  <h2><fmt:message key="progress" /></h2>
     8.1 --- a/src/main/webapp/WEB-INF/jsp/projects.jsp	Tue Jan 03 17:04:39 2023 +0100
     8.2 +++ b/src/main/webapp/WEB-INF/jsp/projects.jsp	Tue Jan 03 18:19:40 2023 +0100
     8.3 @@ -36,7 +36,7 @@
     8.4      </div>
     8.5  </c:if>
     8.6  
     8.7 -<div id="tool-area">
     8.8 +<div>
     8.9      <a href="./projects/-/create" class="button"><fmt:message key="button.project.create"/></a>
    8.10  </div>
    8.11  
     9.1 --- a/src/main/webapp/WEB-INF/jsp/site.jsp	Tue Jan 03 17:04:39 2023 +0100
     9.2 +++ b/src/main/webapp/WEB-INF/jsp/site.jsp	Tue Jan 03 18:19:40 2023 +0100
     9.3 @@ -31,7 +31,7 @@
     9.4  <%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
     9.5  
     9.6  <%-- Version suffix for forcing browsers to update the CSS / JS files --%>
     9.7 -<c:set scope="page" var="versionSuffix" value="20221230"/>
     9.8 +<c:set scope="page" var="versionSuffix" value="20230103"/>
     9.9  
    9.10  <%-- Make the base href easily available at request scope --%>
    9.11  <c:set scope="page" var="baseHref" value="${requestScope[Constants.REQ_ATTR_BASE_HREF]}"/>
    10.1 --- a/src/main/webapp/WEB-INF/jsp/users.jsp	Tue Jan 03 17:04:39 2023 +0100
    10.2 +++ b/src/main/webapp/WEB-INF/jsp/users.jsp	Tue Jan 03 18:19:40 2023 +0100
    10.3 @@ -36,7 +36,7 @@
    10.4      </div>
    10.5  </c:if>
    10.6  
    10.7 -<div id="tool-area">
    10.8 +<div>
    10.9      <a href="./users/-/create" class="button"><fmt:message key="button.user.create"/></a>
   10.10  </div>
   10.11  
    11.1 --- a/src/main/webapp/WEB-INF/jsp/versions.jsp	Tue Jan 03 17:04:39 2023 +0100
    11.2 +++ b/src/main/webapp/WEB-INF/jsp/versions.jsp	Tue Jan 03 18:19:40 2023 +0100
    11.3 @@ -33,9 +33,10 @@
    11.4  <c:set var="project" scope="page" value="${viewmodel.projectInfo.project}"/>
    11.5  <%@include file="../jspf/project-header.jspf" %>
    11.6  
    11.7 -<div id="tool-area">
    11.8 +<div>
    11.9 +    <a href="./projects/${project.node}/issues/-/-/-/create" class="button"><fmt:message key="button.issue.create"/></a>
   11.10 +    <button onclick="toggleProjectDetails()" id="toggle-details-button"><fmt:message key="button.project.details"/></button>
   11.11      <a href="./projects/${project.node}/versions/-/create" class="button"><fmt:message key="button.version.create"/></a>
   11.12 -    <a href="./projects/${project.node}/issues/-/-/-/create" class="button"><fmt:message key="button.issue.create"/></a>
   11.13  </div>
   11.14  
   11.15  <h2><fmt:message key="progress"/></h2>
    12.1 --- a/src/main/webapp/WEB-INF/jspf/project-header.jspf	Tue Jan 03 17:04:39 2023 +0100
    12.2 +++ b/src/main/webapp/WEB-INF/jspf/project-header.jspf	Tue Jan 03 18:19:40 2023 +0100
    12.3 @@ -2,10 +2,28 @@
    12.4  project: Project
    12.5  component: Component (optional)
    12.6  --%>
    12.7 -<div class="table project-attributes">
    12.8 +<div id="project-details-header-reduced" style="display:none" class="table project-attributes">
    12.9      <div class="row">
   12.10          <div class="caption"><fmt:message key="feed"/>:</div>
   12.11 -        <div class="caption">
   12.12 +        <div>
   12.13 +            <a class="rss-feed" href="./feed/${project.node}/issues.rss">
   12.14 +                <img src="./rss.svg" alt="Feed" style="width: 1em; height: 1em;">
   12.15 +                RSS
   12.16 +            </a>
   12.17 +        </div>
   12.18 +        <div class="caption"><fmt:message key="project.repoUrl"/>:</div>
   12.19 +        <div>
   12.20 +            <c:if test="${not empty project.repoUrl}">
   12.21 +                <a target="_blank" href="<c:out value="${project.repoUrl}"/>"><c:out
   12.22 +                        value="${project.repoUrl}"/></a>
   12.23 +            </c:if>
   12.24 +        </div>
   12.25 +    </div>
   12.26 +</div>
   12.27 +<div id="project-details-header" class="table project-attributes">
   12.28 +    <div class="row">
   12.29 +        <div class="caption"><fmt:message key="feed"/>:</div>
   12.30 +        <div>
   12.31              <a class="rss-feed" href="./feed/${project.node}/issues.rss">
   12.32                  <img src="./rss.svg" alt="Feed" style="width: 1em; height: 1em;">
   12.33                  RSS
    13.1 --- a/src/main/webapp/lightpit.css	Tue Jan 03 17:04:39 2023 +0100
    13.2 +++ b/src/main/webapp/lightpit.css	Tue Jan 03 18:19:40 2023 +0100
    13.3 @@ -179,6 +179,7 @@
    13.4      padding: .25em .5em .25em .5em;
    13.5      cursor: default;
    13.6      text-decoration: none;
    13.7 +    text-align: center;
    13.8      font-variant-caps: small-caps;
    13.9  }
   13.10  
   13.11 @@ -186,6 +187,11 @@
   13.12      background: #f0f0ff;
   13.13  }
   13.14  
   13.15 +button[data-toggle], a.button[data-toggle] {
   13.16 +    border-color: #1040a0;
   13.17 +    background: #d0d0d5;
   13.18 +}
   13.19 +
   13.20  button[type=submit], a.button.submit {
   13.21      background: #20a0ff;
   13.22      color: white;
    14.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.2 +++ b/src/main/webapp/project-details.js	Tue Jan 03 18:19:40 2023 +0100
    14.3 @@ -0,0 +1,55 @@
    14.4 +/*
    14.5 + * Copyright 2023 Mike Becker. All rights reserved.
    14.6 + *
    14.7 + * Redistribution and use in source and binary forms, with or without
    14.8 + * modification, are permitted provided that the following conditions are met:
    14.9 + *
   14.10 + * 1. Redistributions of source code must retain the above copyright
   14.11 + * notice, this list of conditions and the following disclaimer.
   14.12 + *
   14.13 + * 2. Redistributions in binary form must reproduce the above copyright
   14.14 + * notice, this list of conditions and the following disclaimer in the
   14.15 + * documentation and/or other materials provided with the distribution.
   14.16 + *
   14.17 + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
   14.18 + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   14.19 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   14.20 + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
   14.21 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   14.22 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
   14.23 + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
   14.24 + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   14.25 + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   14.26 + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   14.27 + */
   14.28 +
   14.29 +/**
   14.30 + * Hides and shows the project details.
   14.31 + *
   14.32 + * Following elements are required on the page (element ID):
   14.33 + *
   14.34 + * - toggle-details-button
   14.35 + * - project-details-header-reduced
   14.36 + * - project-details-header
   14.37 + *
   14.38 + */
   14.39 +projectDetailsVisible = true
   14.40 +function toggleProjectDetails() {
   14.41 +    const button = document.getElementById('toggle-details-button')
   14.42 +    const reduced = document.getElementById('project-details-header-reduced')
   14.43 +    const full = document.getElementById('project-details-header')
   14.44 +
   14.45 +    const v = !window.projectDetailsVisible
   14.46 +    window.projectDetailsVisible = v
   14.47 +
   14.48 +    if (v) {
   14.49 +        button.dataset.toggle = 'true'
   14.50 +        reduced.style.display = 'none'
   14.51 +        full.style.display = 'block'
   14.52 +    } else {
   14.53 +        delete button.dataset.toggle
   14.54 +        reduced.style.display = 'block'
   14.55 +        full.style.display = 'none'
   14.56 +    }
   14.57 +}
   14.58 +window.addEventListener('load', function() { toggleProjectDetails() }, false)
    15.1 --- a/src/main/webapp/projects.css	Tue Jan 03 17:04:39 2023 +0100
    15.2 +++ b/src/main/webapp/projects.css	Tue Jan 03 18:19:40 2023 +0100
    15.3 @@ -28,7 +28,7 @@
    15.4   */
    15.5  
    15.6  .project-attributes {
    15.7 -    margin-bottom: 2em;
    15.8 +    margin-bottom: 1em;
    15.9  }
   15.10  
   15.11  .project-attributes .row > div + div {

mercurial