[Rt-commit] rt branch, 4.2/user-links-display, created. rt-4.1.8-266-g3ae5071

Alex Vandiver alexmv at bestpractical.com
Thu May 9 16:47:09 EDT 2013


The branch, 4.2/user-links-display has been created
        at  3ae50719e537328d8f4242e30eea92f0923580c8 (commit)

- Log -----------------------------------------------------------------
commit b8b93529ee2411872de61ad1dea2bfbb9af11c3f
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Thu Apr 18 17:30:32 2013 -0700

    Wrap users in a <span> of class "user" and with a data-user-id attribute
    
    Makes user references selectable for styling and provides metadata about
    the reference.

diff --git a/share/html/Elements/ShowUser b/share/html/Elements/ShowUser
index bc40e40..4ddac7b 100644
--- a/share/html/Elements/ShowUser
+++ b/share/html/Elements/ShowUser
@@ -84,6 +84,7 @@ $Address => undef
 $style => undef
 $Link => 1
 </%ARGS>
+<span class="user" <% $User && $User->id ? 'data-user-id="'.$User->id.'"' : "" |n %>>\
 % if ($Link and $User and $User->id and not $system_user{$User->id} and $session{CurrentUser}->Privileged) {
 <a href="<% RT->Config->Get("WebPath") %>/User/Summary.html?id=<% $User->id %>">\
 <% $display %>\
@@ -91,3 +92,4 @@ $Link => 1
 % } else {
 <% $display %>\
 % }
+</span>\
diff --git a/share/static/js/event-registration.js b/share/static/js/event-registration.js
index f8a2184..4a94f46 100644
--- a/share/static/js/event-registration.js
+++ b/share/static/js/event-registration.js
@@ -34,7 +34,7 @@ function ReplaceUserReferences() {
                 if (!json[uid])
                     return
                 user.removeAttr("data-replace")
-                    .html( json[uid]._html );
+                    .html( jQuery(json[uid]._html).html() );
             });
         }
     );
diff --git a/t/web/crypt-gnupg.t b/t/web/crypt-gnupg.t
index a5ec2e5..220a202 100644
--- a/t/web/crypt-gnupg.t
+++ b/t/web/crypt-gnupg.t
@@ -426,8 +426,8 @@ $m->get("$baseurl/Search/Simple.html?q=General");
 my $content = $m->content;
 $content =~ s/(/(/g;
 $content =~ s/)/)/g;
-$content =~ s/<a\b[^>]+>//g;
-$content =~ s/<\/a>//g;
+$content =~ s/<(a|span)\b[^>]+>//g;
+$content =~ s/<\/(a|span)>//g;
 $content =~ s/</</g;
 $content =~ s/>/>/g;
 
diff --git a/t/web/ticket_owner.t b/t/web/ticket_owner.t
index 5d30e15..5663095 100644
--- a/t/web/ticket_owner.t
+++ b/t/web/ticket_owner.t
@@ -390,10 +390,12 @@ diag
         fields    => { Owner => $user_a->id },
         button => 'SubmitTicket',
     );
-    $agent_a->content_like( qr{<a\b[^>]+>user_a</a>\s+-\s+Taken}, 'got user_a Taken message' );
+    like($agent_a->dom->at('.transaction.people .description')->all_text,
+         qr/user_a\s*-\s*Taken/, 'got user_a Taken message' );
 
     $agent_b->goto_ticket($id);
-    $agent_b->content_like( qr{<a\b[^>]+>user_a</a>\s+-\s+Taken}, 'got user_a Taken message for user b ' );
+    like($agent_b->dom->at('.transaction.people .description')->all_text,
+         qr/user_a\s*-\s*Taken/, 'got user_a Taken message for user b' );
 }
 
 diag
@@ -417,10 +419,12 @@ diag
     $agent_a->content_contains( 'Owner changed from Nobody to user_a',
         'got set message in Basics' );
     $agent_a->goto_ticket($id);
-    $agent_a->content_like( qr{<a\b[^>]+>user_a</a>\s+-\s+Taken}, 'got user_a Taken message' );
+    like($agent_a->dom->at('.transaction.people .description')->all_text,
+         qr/user_a\s*-\s*Taken/, 'got user_a Taken message' );
 
     $agent_b->goto_ticket($id);
-    $agent_b->content_like( qr{<a\b[^>]+>user_a</a>\s+-\s+Taken}, 'got user_a Taken message for user b ' );
+    like($agent_b->dom->at('.transaction.people .description')->all_text,
+         qr/user_a\s*-\s*Taken/, 'got user_a Taken message for user b' );
 }
 
 my $agent_c = RT::Test::Web->new;
@@ -446,7 +450,8 @@ diag "user can assign ticket to new owner with ReassignTicket right";
     $agent_a->content_contains( 'Owner changed from Nobody to user_a',
         'got set message in Basics' );
     $agent_a->goto_ticket($id);
-    $agent_a->content_like( qr{<a\b[^>]+>user_a</a>\s+-\s+Taken}, 'got user_a Taken message' );
+    like($agent->dom->at('.transaction.people .description')->all_text,
+         qr{user_a\s*-\s*Taken}, 'got user_a Taken message' );
 
     $agent_c->goto_ticket($id);
     $agent_c->follow_link_ok( { text => 'Basics' }, 'Ticket -> Basics' );

commit a3d609aade6ab422d5a42d61d7289a436b4ddad1
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Thu Apr 18 17:36:09 2013 -0700

    Tone down the visual prominence of user links in search results
    
    By setting the font-weight and color to inherit, they pick up the
    natural look of the search results instead of being bold and the color
    depending on visited status.  For aileron, this means the links are
    normal weight and always black.  Knowing if you've previously visited a
    user summary page is not terribly useful, and the dual-toned links are
    distracting in search results.  HTML in formats, such as <b>, can still
    modify the links' appearance.

diff --git a/share/static/css/base/collection.css b/share/static/css/base/collection.css
index aaa67cb..d690192 100644
--- a/share/static/css/base/collection.css
+++ b/share/static/css/base/collection.css
@@ -6,3 +6,11 @@ table.collection td:first-child, table.collection th:first-child {
     margin-top: 0;
     margin-bottom: 0;
 }
+
+.collection-as-table .user a {
+    font-weight: inherit;
+}
+
+.collection-as-table .user a:visited {
+    color: inherit;
+}

commit 3ae50719e537328d8f4242e30eea92f0923580c8
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Thu Apr 18 17:45:09 2013 -0700

    Adjust CSS layout so the full width is used for requestor accordion content
    
    Floating the user summary link forced the width of the floated element
    (the text "User Summary") to be unused by accordion content, effectively
    producing a large right margin.
    
    Use relative/absolute positioning to place the User Summary link in the
    top right corner and preserve the accordion's full width.  Additionally,
    adjust styles so the link behaves like a normal link and unlike the rest
    of the accordion header.  This helps distinguish that "User Summary"
    isn't just a static part of the header.

diff --git a/share/static/css/base/ticket.css b/share/static/css/base/ticket.css
index 4752888..b074aa8 100644
--- a/share/static/css/base/ticket.css
+++ b/share/static/css/base/ticket.css
@@ -1,5 +1,12 @@
-#requestor-accordion h3 { clear: right }
-#requestor-accordion a.user-summary { float: right; }
+#requestor-accordion h3 {
+    position: relative;
+}
+#requestor-accordion a.user-summary {
+    position: absolute;
+    right: 0;
+    text-decoration: none;
+}
+#requestor-accordion a.user-summary:hover { text-decoration: underline }
 
 #requestor-accordion a.modify-user {
     font-size: 80%;

-----------------------------------------------------------------------


More information about the Rt-commit mailing list