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
--- a/src/main/kotlin/de/uapcore/lightpit/servlet/ProjectServlet.kt	Tue Jan 03 17:04:39 2023 +0100
+++ b/src/main/kotlin/de/uapcore/lightpit/servlet/ProjectServlet.kt	Tue Jan 03 18:19:40 2023 +0100
@@ -204,6 +204,7 @@
                     component
                 )
                 styleSheets = listOf("projects")
+                javascript = "project-details"
                 render("project-details")
             }
         }
@@ -273,6 +274,7 @@
                 projectInfo
             )
             styleSheets = listOf("projects")
+            javascript = "project-details"
             render("versions")
         }
     }
@@ -373,6 +375,7 @@
                 projectInfo
             )
             styleSheets = listOf("projects")
+            javascript = "project-details"
             render("components")
         }
     }
--- a/src/main/resources/localization/strings.properties	Tue Jan 03 17:04:39 2023 +0100
+++ b/src/main/resources/localization/strings.properties	Tue Jan 03 18:19:40 2023 +0100
@@ -38,6 +38,7 @@
 button.language.submit = Switch language
 button.okay=OK
 button.project.create=New Project
+button.project.details=Project Details
 button.project.edit=Edit Project
 button.remove=Remove
 button.user.create=Add Developer
--- a/src/main/resources/localization/strings_de.properties	Tue Jan 03 17:04:39 2023 +0100
+++ b/src/main/resources/localization/strings_de.properties	Tue Jan 03 18:19:40 2023 +0100
@@ -38,6 +38,7 @@
 button.language.submit = Sprache ausw\u00e4hlen
 button.okay=OK
 button.project.create=Neues Projekt
+button.project.details=Projektdetails
 button.project.edit=Projekt Bearbeiten
 button.remove=Entfernen
 button.user.create=Neuer Entwickler
--- a/src/main/webapp/WEB-INF/changelogs/changelog-de.jspf	Tue Jan 03 17:04:39 2023 +0100
+++ b/src/main/webapp/WEB-INF/changelogs/changelog-de.jspf	Tue Jan 03 18:19:40 2023 +0100
@@ -31,6 +31,7 @@
     <li>Neuer Status: Bereit (als Antwort auf Im Review).</li>
     <li>Mehrfachauswahl für Versionen im Vorgang entfernt.</li>
     <li>RSS Feeds für Projekte hinzugefügt.</li>
+    <li>Vorgangsansicht vereinfacht.</li>
     <li>Möglichkeit zum Deaktivieren einer Komponente hinzugefügt.</li>
     <li>Datum der Veröffentlichung und des Supportendes zu Versionen hinzugefügt.</li>
     <li>Gesamtanzahl der Kommentare wird nun angezeigt.</li>
--- a/src/main/webapp/WEB-INF/changelogs/changelog.jspf	Tue Jan 03 17:04:39 2023 +0100
+++ b/src/main/webapp/WEB-INF/changelogs/changelog.jspf	Tue Jan 03 18:19:40 2023 +0100
@@ -31,6 +31,7 @@
     <li>Add issue status: Ready (following Review).</li>
     <li>Remove multi selection of versions within an issue.</li>
     <li>Add RSS feeds for projects.</li>
+    <li>Simplify issue view.</li>
     <li>Add possibility to deactivate a component.</li>
     <li>Add release and end of life dates to versions.</li>
     <li>Add the total number of comments to the caption.</li>
--- a/src/main/webapp/WEB-INF/jsp/components.jsp	Tue Jan 03 17:04:39 2023 +0100
+++ b/src/main/webapp/WEB-INF/jsp/components.jsp	Tue Jan 03 18:19:40 2023 +0100
@@ -34,9 +34,10 @@
 
 <%@include file="../jspf/project-header.jspf"%>
 
-<div id="tool-area">
+<div>
+    <a href="./projects/${project.node}/issues/-/-/-/create" class="button"><fmt:message key="button.issue.create"/></a>
+    <button onclick="toggleProjectDetails()" id="toggle-details-button"><fmt:message key="button.project.details"/></button>
     <a href="./projects/${project.node}/components/-/create" class="button"><fmt:message key="button.component.create"/></a>
-    <a href="./projects/${project.node}/issues/-/-/-/create" class="button"><fmt:message key="button.issue.create"/></a>
 </div>
 
 <h2><fmt:message key="progress" /></h2>
--- a/src/main/webapp/WEB-INF/jsp/project-details.jsp	Tue Jan 03 17:04:39 2023 +0100
+++ b/src/main/webapp/WEB-INF/jsp/project-details.jsp	Tue Jan 03 18:19:40 2023 +0100
@@ -35,17 +35,9 @@
 <c:set var="version" scope="page" value="${viewmodel.version}"/>
 <%@include file="../jspf/project-header.jspf"%>
 
-<div id="tool-area">
+<div>
     <a href="./projects/${project.node}/issues/${empty version ? '-' : version.node}/${empty component ? '-' : component.node}/-/create" class="button"><fmt:message key="button.issue.create"/></a>
-    <a href="./projects/${project.node}/edit" class="button"><fmt:message key="button.project.edit"/></a>
-    <c:if test="${not empty version}">
-        <a href="./projects/${project.node}/versions/${version.node}/edit" class="button"><fmt:message key="button.version.edit"/></a>
-    </c:if>
-    <a href="./projects/${project.node}/versions/-/create" class="button"><fmt:message key="button.version.create"/></a>
-    <c:if test="${not empty component}">
-        <a href="./projects/${project.node}/components/${component.node}/edit" class="button"><fmt:message key="button.component.edit"/></a>
-    </c:if>
-    <a href="./projects/${project.node}/components/-/create" class="button"><fmt:message key="button.component.create"/></a>
+    <button onclick="toggleProjectDetails()" id="toggle-details-button"><fmt:message key="button.project.details"/></button>
 </div>
 
 <h2><fmt:message key="progress" /></h2>
--- a/src/main/webapp/WEB-INF/jsp/projects.jsp	Tue Jan 03 17:04:39 2023 +0100
+++ b/src/main/webapp/WEB-INF/jsp/projects.jsp	Tue Jan 03 18:19:40 2023 +0100
@@ -36,7 +36,7 @@
     </div>
 </c:if>
 
-<div id="tool-area">
+<div>
     <a href="./projects/-/create" class="button"><fmt:message key="button.project.create"/></a>
 </div>
 
--- a/src/main/webapp/WEB-INF/jsp/site.jsp	Tue Jan 03 17:04:39 2023 +0100
+++ b/src/main/webapp/WEB-INF/jsp/site.jsp	Tue Jan 03 18:19:40 2023 +0100
@@ -31,7 +31,7 @@
 <%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
 
 <%-- Version suffix for forcing browsers to update the CSS / JS files --%>
-<c:set scope="page" var="versionSuffix" value="20221230"/>
+<c:set scope="page" var="versionSuffix" value="20230103"/>
 
 <%-- Make the base href easily available at request scope --%>
 <c:set scope="page" var="baseHref" value="${requestScope[Constants.REQ_ATTR_BASE_HREF]}"/>
--- a/src/main/webapp/WEB-INF/jsp/users.jsp	Tue Jan 03 17:04:39 2023 +0100
+++ b/src/main/webapp/WEB-INF/jsp/users.jsp	Tue Jan 03 18:19:40 2023 +0100
@@ -36,7 +36,7 @@
     </div>
 </c:if>
 
-<div id="tool-area">
+<div>
     <a href="./users/-/create" class="button"><fmt:message key="button.user.create"/></a>
 </div>
 
--- a/src/main/webapp/WEB-INF/jsp/versions.jsp	Tue Jan 03 17:04:39 2023 +0100
+++ b/src/main/webapp/WEB-INF/jsp/versions.jsp	Tue Jan 03 18:19:40 2023 +0100
@@ -33,9 +33,10 @@
 <c:set var="project" scope="page" value="${viewmodel.projectInfo.project}"/>
 <%@include file="../jspf/project-header.jspf" %>
 
-<div id="tool-area">
+<div>
+    <a href="./projects/${project.node}/issues/-/-/-/create" class="button"><fmt:message key="button.issue.create"/></a>
+    <button onclick="toggleProjectDetails()" id="toggle-details-button"><fmt:message key="button.project.details"/></button>
     <a href="./projects/${project.node}/versions/-/create" class="button"><fmt:message key="button.version.create"/></a>
-    <a href="./projects/${project.node}/issues/-/-/-/create" class="button"><fmt:message key="button.issue.create"/></a>
 </div>
 
 <h2><fmt:message key="progress"/></h2>
--- a/src/main/webapp/WEB-INF/jspf/project-header.jspf	Tue Jan 03 17:04:39 2023 +0100
+++ b/src/main/webapp/WEB-INF/jspf/project-header.jspf	Tue Jan 03 18:19:40 2023 +0100
@@ -2,10 +2,28 @@
 project: Project
 component: Component (optional)
 --%>
-<div class="table project-attributes">
+<div id="project-details-header-reduced" style="display:none" class="table project-attributes">
     <div class="row">
         <div class="caption"><fmt:message key="feed"/>:</div>
-        <div class="caption">
+        <div>
+            <a class="rss-feed" href="./feed/${project.node}/issues.rss">
+                <img src="./rss.svg" alt="Feed" style="width: 1em; height: 1em;">
+                RSS
+            </a>
+        </div>
+        <div class="caption"><fmt:message key="project.repoUrl"/>:</div>
+        <div>
+            <c:if test="${not empty project.repoUrl}">
+                <a target="_blank" href="<c:out value="${project.repoUrl}"/>"><c:out
+                        value="${project.repoUrl}"/></a>
+            </c:if>
+        </div>
+    </div>
+</div>
+<div id="project-details-header" class="table project-attributes">
+    <div class="row">
+        <div class="caption"><fmt:message key="feed"/>:</div>
+        <div>
             <a class="rss-feed" href="./feed/${project.node}/issues.rss">
                 <img src="./rss.svg" alt="Feed" style="width: 1em; height: 1em;">
                 RSS
--- a/src/main/webapp/lightpit.css	Tue Jan 03 17:04:39 2023 +0100
+++ b/src/main/webapp/lightpit.css	Tue Jan 03 18:19:40 2023 +0100
@@ -179,6 +179,7 @@
     padding: .25em .5em .25em .5em;
     cursor: default;
     text-decoration: none;
+    text-align: center;
     font-variant-caps: small-caps;
 }
 
@@ -186,6 +187,11 @@
     background: #f0f0ff;
 }
 
+button[data-toggle], a.button[data-toggle] {
+    border-color: #1040a0;
+    background: #d0d0d5;
+}
+
 button[type=submit], a.button.submit {
     background: #20a0ff;
     color: white;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/webapp/project-details.js	Tue Jan 03 18:19:40 2023 +0100
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2023 Mike Becker. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * Hides and shows the project details.
+ *
+ * Following elements are required on the page (element ID):
+ *
+ * - toggle-details-button
+ * - project-details-header-reduced
+ * - project-details-header
+ *
+ */
+projectDetailsVisible = true
+function toggleProjectDetails() {
+    const button = document.getElementById('toggle-details-button')
+    const reduced = document.getElementById('project-details-header-reduced')
+    const full = document.getElementById('project-details-header')
+
+    const v = !window.projectDetailsVisible
+    window.projectDetailsVisible = v
+
+    if (v) {
+        button.dataset.toggle = 'true'
+        reduced.style.display = 'none'
+        full.style.display = 'block'
+    } else {
+        delete button.dataset.toggle
+        reduced.style.display = 'block'
+        full.style.display = 'none'
+    }
+}
+window.addEventListener('load', function() { toggleProjectDetails() }, false)
--- a/src/main/webapp/projects.css	Tue Jan 03 17:04:39 2023 +0100
+++ b/src/main/webapp/projects.css	Tue Jan 03 18:19:40 2023 +0100
@@ -28,7 +28,7 @@
  */
 
 .project-attributes {
-    margin-bottom: 2em;
+    margin-bottom: 1em;
 }
 
 .project-attributes .row > div + div {

mercurial