Opened 11 years ago

Closed 6 years ago

#502 closed Bug/Something is broken (fixed)

make the grey "from" line above each ticket comment contain a black userid

Reported by: https://id.mayfirst.org/dkg Owned by: https://id.mayfirst.org/dkg
Priority: Medium Component: Tech
Keywords: support.mayfirst.org trac Cc:
Sensitive: no

Description

as michelle pointed out, the date/from lines above a ticket comment are grey, and the identity of the author does not stand out.

It would be good to make the identity of the author show up in black instead.

This will probably involve a small modification to the trac ticket display template to wrap a span around that text, and then a change to the ticket.css to change the style of the span.

Change History (4)

comment:1 Changed 6 years ago by https://id.mayfirst.org/dkg

  • Status changed from new to assigned

comment:2 Changed 6 years ago by https://id.mayfirst.org/dkg

I just proposed a change to trac that would make this very easy to do.

comment:3 Changed 6 years ago by https://id.mayfirst.org/dkg

here's some javascript that starts to perform a rough pass (assuming that usernames have no spaces in them) at making the same change without modifying trac:

z = new RegExp(/(.* by\s+)(\S+)(\s*)/)
$('h3.change')[0].innerHTML = $('h3.change')[0].innerHTML.replace(z,"$1<span class='author'>$2</span>$3")

this needs to be looped properly over all such objects, and executed only once per page (at load time). then we can add a line to the local stylesheet:

h3.change span.author { color: black; }

comment:4 Changed 6 years ago by https://id.mayfirst.org/dkg

  • Resolution set to fixed
  • Status changed from assigned to closed

here is the code that fixed it:

diff --git a/htdocs/style.css b/htdocs/style.css
index 864c626..279755b 100644
--- a/htdocs/style.css
+++ b/htdocs/style.css
@@ -26,3 +26,5 @@ label[for="field-owner"] {
 #modify input#field-owner {
     display: none;
 }
+
+h3.change span.author { color: black; }
diff --git a/templates/site.html b/templates/site.html
index e310f60..f3a4952 100644
--- a/templates/site.html
+++ b/templates/site.html
@@ -96,7 +96,22 @@ href="http://creativecommons.org/licenses/by-nc-sa/3.0/us/">CC-BY-NC-SA</a>.
     ${select('*|comment()|text()')}
   </fieldset>
   <script type="text/javascript">
-    (function () { var a = $('#action'); a.parent().parent().before(a); })()
+    (function () { var a = $('#action'); a.parent().parent().before(a);  })();
+  </script>
+</py:match>
+
+
+<py:match path="div[@id='content'][@class='ticket']" once="true">
+  <div py:attrs="select('@*')">
+    ${select('*|comment()|text()')}
+  </div>
+  <script type="text/javascript">
+    (function () {
+        var mapper = new RegExp(/(.* by\s+)(\S+)(\s*)/);
+        $('h3.change').each(function( i ) {
+           this.innerHTML = this.innerHTML.replace(mapper, '$1<span class="author">$2</span>$3');
+         } );
+    })();
   </script>
 </py:match>

Please login to add comments to this ticket.

Note: See TracTickets for help on using tickets.