[Rt-commit] rt branch, 4.2/user-links-display, created. rt-4.1.8-245-gb02efcd
Alex Vandiver
alexmv at bestpractical.com
Mon May 6 19:41:35 EDT 2013
The branch, 4.2/user-links-display has been created
at b02efcd730ce2cca3486e7ca6f101e5e4cf036ac (commit)
- Log -----------------------------------------------------------------
commit 6b52cd12fa5849562fa4b03ebd85218be11e72b9
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..3c2b990 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;
commit edfe5c348e839c311b7c2d6058649e1c51192b59
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/html/NoAuth/css/base/collection.css b/share/html/NoAuth/css/base/collection.css
index df0381e..10b222c 100644
--- a/share/html/NoAuth/css/base/collection.css
+++ b/share/html/NoAuth/css/base/collection.css
@@ -53,3 +53,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 b02efcd730ce2cca3486e7ca6f101e5e4cf036ac
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/html/NoAuth/css/base/ticket.css b/share/html/NoAuth/css/base/ticket.css
index 5d3c232..3794ca0 100644
--- a/share/html/NoAuth/css/base/ticket.css
+++ b/share/html/NoAuth/css/base/ticket.css
@@ -45,8 +45,15 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-#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