~jan0sch/smederee

Showing details for patch 941f08d70b902da07884a7e4f83db49c70bf999d.
2023-05-16 (Tue), 8:03 AM - Jens Grassel - 941f08d70b902da07884a7e4f83db49c70bf999d

Tickets: Improve ticket listing.

- tidy up html template
- link to submitter
- link from title to ticket detail page
- separate colours for ticket number and title of resolved tickets
- strike through ticket number of resolved tickets
Summary of changes
2 files modified with 18 lines added and 5 lines removed
  • modules/hub/src/main/resources/assets/css/main.css with 9 added and 0 removed lines
  • modules/hub/src/main/twirl/de/smederee/tickets/views/showTickets.scala.html with 9 added and 5 removed lines
diff -rN -u old-smederee/modules/hub/src/main/resources/assets/css/main.css new-smederee/modules/hub/src/main/resources/assets/css/main.css
--- old-smederee/modules/hub/src/main/resources/assets/css/main.css	2025-01-16 12:51:38.969371247 +0000
+++ new-smederee/modules/hub/src/main/resources/assets/css/main.css	2025-01-16 12:51:38.969371247 +0000
@@ -331,6 +331,15 @@
   border-bottom: 1px solid var(--background2);
 }
 
+.ticket-resolved .ticket-number {
+  color: var(--nord3);
+  text-decoration: line-through;
+}
+
+.ticket-resolved a.ticket-title {
+  color: var(--nord3);
+}
+
 .todo-default {
   background-color: var(--nord15);
 }
diff -rN -u old-smederee/modules/hub/src/main/twirl/de/smederee/tickets/views/showTickets.scala.html new-smederee/modules/hub/src/main/twirl/de/smederee/tickets/views/showTickets.scala.html
--- old-smederee/modules/hub/src/main/twirl/de/smederee/tickets/views/showTickets.scala.html	2025-01-16 12:51:38.969371247 +0000
+++ new-smederee/modules/hub/src/main/twirl/de/smederee/tickets/views/showTickets.scala.html	2025-01-16 12:51:38.969371247 +0000
@@ -46,15 +46,19 @@
             <div class="alert alert-info">@Messages("project.tickets.list.empty")</div>
           } else {
             @for(ticket <- tickets) {
-              <div class="pure-g ticket">
+              <div class="pure-g @if(ticket.status === TicketStatus.Resolved){ticket-resolved}else{ticket}">
                 <div class="pure-u-1-24"><input id="ticket-@ticket.number" type="checkbox"/></div>
-                <div class="pure-u-1-24"><span @if(ticket.status === TicketStatus.Resolved){style="text-decoration: line-through;"}else{}>@ticket.number</span></div>
-                <div class="pure-u-20-24"><a href="#">@ticket.title</a></div>
+                <div class="pure-u-1-24"><div class="ticket-number">@ticket.number</div></div>
+                <div class="pure-u-20-24"><a class="ticket-title" href="@projectBaseUri.addSegment("tickets").addSegment(ticket.number.toString)">@ticket.title</a></div>
                 <div class="pure-u-4-24"></div>
               </div>
               <div class="pure-g ticket-content">
                 <div class="pure-u-1-24"></div>
-                <div class="pure-u-20-24">@if(ticket.content.exists(_.toString.length < 180)) { @ticket.content } else { @ticket.content.map(_.toString.take(176)) ...} </div>
+                <div class="pure-u-20-24">
+                @for(content <- ticket.content) {
+                  @if(content.toString.length < 180) { @content } else { @content.toString.take(176)) ...}
+                }
+                </div>
                 <div class="pure-u-3-24"></div>
               </div>
               <div class="pure-g ticket-details" style="font-size: 14px;">
@@ -62,7 +66,7 @@
                 <div class="pure-u-8-24"></div>
                 <div class="pure-u-3-24">@ticket.status</div>
                 <div class="pure-u-3-24">@ticket.resolution</div>
-                <div class="pure-u-3-24">@ticket.submitter</div>
+                <div class="pure-u-3-24">@for(submitter <- ticket.submitter){<a href="@{baseUri.addSegment(s"~${submitter.name}")}">@submitter.name</a>}</div>
                 <div class="pure-u-6-24">@formatDateTime(ticket.updatedAt)</div>
               </div>
             }