]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
bug 369429: bug reports should contain microformat markup in order to make the inform...
authordb48x%yahoo.com <>
Tue, 27 Feb 2007 04:05:22 +0000 (04:05 +0000)
committerdb48x%yahoo.com <>
Tue, 27 Feb 2007 04:05:22 +0000 (04:05 +0000)
r=LpSolit

Bugzilla/Bug.pm
Bugzilla/BugMail.pm
template/en/default/bug/comments.html.tmpl
template/en/default/bug/edit.html.tmpl

index 8591a2f89029325967233724f4cdaf7ebd4b2520..8ee0d87e27532f70b91f409064868adb89f93929 100755 (executable)
@@ -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;
index fa52464f839a78a54e42b199307f3c868f45a628..79033dbbe313675c5e62a5bc93d3b363d400181b 100644 (file)
@@ -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";
         }
index 5add6d54f43029d115fb8ecf2b9c8f87d825cc3d..9d05ba4ace741f51171934f38fc760a9d3bd6e55 100644 (file)
           <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" %]
index 5389af666aa322cfc9c2efed808f1224552d9081..c97077d699cc02777db9caafb598fb933d866afe 100644 (file)
         <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>
 
         <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>
 
         [% 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>
   [% 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 %]