summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordb48x%yahoo.com <>2007-02-27 05:05:22 +0100
committerdb48x%yahoo.com <>2007-02-27 05:05:22 +0100
commit41732933eeb2f25abdd479e5a024cd258c502fd3 (patch)
tree4ee4c6895ed9d25b75aea890a59516bf1ccba3d0
parent4827e4de822cbc33acbf66c1d5b4a392c5a3f90c (diff)
downloadbugzilla-41732933eeb2f25abdd479e5a024cd258c502fd3.tar.gz
bugzilla-41732933eeb2f25abdd479e5a024cd258c502fd3.tar.xz
bug 369429: bug reports should contain microformat markup in order to make the information in them more useable.
r=LpSolit
-rwxr-xr-xBugzilla/Bug.pm1
-rw-r--r--Bugzilla/BugMail.pm6
-rw-r--r--template/en/default/bug/comments.html.tmpl7
-rw-r--r--template/en/default/bug/edit.html.tmpl35
4 files changed, 30 insertions, 19 deletions
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm
index 8591a2f89..8ee0d87e2 100755
--- a/Bugzilla/Bug.pm
+++ b/Bugzilla/Bug.pm
@@ -1475,7 +1475,6 @@ sub GetComments {
my %comment = %$comment_ref;
$comment{'email'} .= Bugzilla->params->{'emailsuffix'};
- $comment{'name'} = $comment{'name'} || $comment{'email'};
# If raw data is requested, do not format 'special' comments.
$comment{'body'} = format_comment(\%comment) unless $raw;
diff --git a/Bugzilla/BugMail.pm b/Bugzilla/BugMail.pm
index fa52464f8..79033dbbe 100644
--- a/Bugzilla/BugMail.pm
+++ b/Bugzilla/BugMail.pm
@@ -704,11 +704,11 @@ sub prepare_comments {
foreach my $comment (@$raw_comments) {
if ($count) {
$result .= "\n\n--- Comment #$count from ";
- if ($comment->{'name'} eq $comment->{'email'}) {
- $result .= $comment->{'email'} . Bugzilla->params->{'emailsuffix'};
- } else {
+ if ($comment->{'name'}) {
$result .= $comment->{'name'} . " <" . $comment->{'email'} .
Bugzilla->params->{'emailsuffix'} . ">";
+ } else {
+ $result .= $comment->{'email'} . Bugzilla->params->{'emailsuffix'};
}
$result .= " " . format_time($comment->{'time'}) . " ---\n";
}
diff --git a/template/en/default/bug/comments.html.tmpl b/template/en/default/bug/comments.html.tmpl
index 5add6d54f..9d05ba4ac 100644
--- a/template/en/default/bug/comments.html.tmpl
+++ b/template/en/default/bug/comments.html.tmpl
@@ -113,8 +113,11 @@
<span class="comment_rule">-------</span> <i>Comment
<a name="c[% count %]" href="show_bug.cgi?id=[% bug.bug_id %]#c[% count %]">
#[% count %]</a> From
- <a href="mailto:[% comment.email FILTER html %]">
- [% comment.name FILTER html %]</a>
+ <span class="vcard">
+ <a class="fn email" href="mailto:[% comment.email FILTER html %]">
+ [% (comment.name || comment.email) FILTER html %]
+ </a>
+ </span>
[%+ comment.time FILTER time %]
</i>
[% IF mode == "edit" %]
diff --git a/template/en/default/bug/edit.html.tmpl b/template/en/default/bug/edit.html.tmpl
index 5389af666..c97077d69 100644
--- a/template/en/default/bug/edit.html.tmpl
+++ b/template/en/default/bug/edit.html.tmpl
@@ -673,8 +673,7 @@
<b>Reporter</b>:
</td>
<td>
- <a href="mailto:[% bug.reporter.email FILTER html %]">
- [% bug.reporter.identity FILTER html %]</a>
+ [% INCLUDE user_identity user => bug.reporter %]
</td>
</tr>
@@ -683,8 +682,7 @@
<b><a href="page.cgi?id=fields.html#assigned_to">Assigned&nbsp;To</a></b>:
</td>
<td>
- <a href="mailto:[% bug.assigned_to.email FILTER html %]">
- [% bug.assigned_to.identity FILTER html %]</a>
+ [% INCLUDE user_identity user => bug.assigned_to %]
</td>
</tr>
@@ -705,15 +703,7 @@
[% ELSE %]
<input type="hidden" name="qa_contact" id="qa_contact"
value="[% bug.qa_contact.login FILTER html %]">
- <a href="mailto:[% bug.qa_contact.email FILTER html %]">
- [% IF bug.qa_contact.login && bug.qa_contact.login.length > 30 %]
- <span title="[% bug.qa_contact.login FILTER html %]">
- [% bug.qa_contact.identity FILTER truncate(30) FILTER html %]
- </span>
- [% ELSE %]
- [% bug.qa_contact.identity FILTER html %]
- [% END %]
- </a>
+ [% INCLUDE user_identity user => bug.qa_contact %]
[% END %]
</td>
</tr>
@@ -837,3 +827,22 @@
[% size = 0 %]
[% value = undef %]
[% END %]
+
+[%############################################################################%]
+[%# Block for user identities. Wraps the information inside of an hCard. #%]
+[%############################################################################%]
+
+[% BLOCK user_identity %]
+ <span class="vcard">
+ [% IF user.name %]
+ <a class="email" href="mailto:[% user.email FILTER html %]">
+ <span class="fn">[% user.name FILTER html %]</span>
+ &lt;[% user.email FILTER html %]&gt;
+ </a>
+ [% ELSE %]
+ <a class="fn email" href="mailto:[% user.email FILTER html %]">
+ [% user.email FILTER html %]
+ </a>
+ [% END %]
+ </span>
+[% END %]