~jan0sch/smederee

Showing details for patch 26f9bee638e4a66f54a6fa7afa5b8618433cd82e.
2023-03-06 (Mon), 11:52 AM - Jens Grassel - 26f9bee638e4a66f54a6fa7afa5b8618433cd82e

HTML/CSS: Add simple todo highlighting for regular files.

- highlight a code line with a found todo item in the default colour
Summary of changes
2 files modified with 12 lines added and 0 lines removed
  • modules/hub/src/main/resources/assets/css/main.css with 8 added and 0 removed lines
  • modules/hub/src/main/twirl/de/smederee/hub/views/showRepositoryFiles.scala.html with 4 added and 0 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-31 13:54:07.306016075 +0000
+++ new-smederee/modules/hub/src/main/resources/assets/css/main.css	2025-01-31 13:54:07.306016075 +0000
@@ -456,6 +456,14 @@
   vertical-align: top;
 }
 
+tr.code-line-todo {
+  background-color: var(--nord15);
+}
+
+tr.code-line-todo:hover {
+  background-color: transparent;
+}
+
 .left-floated {
   float: left;
 }
diff -rN -u old-smederee/modules/hub/src/main/twirl/de/smederee/hub/views/showRepositoryFiles.scala.html new-smederee/modules/hub/src/main/twirl/de/smederee/hub/views/showRepositoryFiles.scala.html
--- old-smederee/modules/hub/src/main/twirl/de/smederee/hub/views/showRepositoryFiles.scala.html	2025-01-31 13:54:07.306016075 +0000
+++ new-smederee/modules/hub/src/main/twirl/de/smederee/hub/views/showRepositoryFiles.scala.html	2025-01-31 13:54:07.306016075 +0000
@@ -75,7 +75,11 @@
                   @for(tuple <- fileContent.zipWithIndex) {
                     @defining(tuple._1) { content =>
                       @defining(tuple._2) { lineNumber =>
+                        @if(content.matches("(?i)(.*)(DEBUG|FIXME|HACK|TODO):(.*)")) {
+                        <tr class="code-line code-line-todo">
+                        } else {
                         <tr class="code-line">
+                        }
                           <td class="code-line-number" id="L@lineNumber"><a href="#L@lineNumber">@lineNumber</a></td>
                           <td class="code-line"><code class="code-line">@content</code></td>
                         </tr>