]> git.donarmstrong.com Git - debbugs.git/blobdiff - templates/en_US/cgi/bugreport.tmpl
abstract out toggle_elements
[debbugs.git] / templates / en_US / cgi / bugreport.tmpl
index cc8d57ddd5282c71fab93b91cb3ccec7e8b293b4..f814790b395095947983e53e456f114af5e4d3c8 100644 (file)
@@ -1,23 +1,38 @@
 {include(q(html/pre_title))}#{$bug_num} - {html_escape($status{subject})} - {html_escape($config{project})} {html_escape($config{bug})} report logs{include(q(html/post_title.tmpl))}
+<link rel="canonical" href="{html_escape(bug_links{bug=>$bug_num})}">
 <script type="text/javascript">
 <!--
-function toggle_infmessages()
+function toggle_elements(cls,tag)
 \{
-        allDivs=document.getElementsByTagName("div");
+     if (!cls) \{
+        var cls = "infmessage";
+     \}
+     if (!tag) \{
+        var tag = "div";
+     \}
+        allDivs=document.getElementsByTagName(tag);
         for (var i = 0 ; i < allDivs.length ; i++ )
         \{
-                if (allDivs[i].className == "infmessage")
+                if (allDivs[i].className == cls)
                 \{
                         allDivs[i].style.display=(allDivs[i].style.display == 'none' | allDivs[i].style.display == '') ? 'block' : 'none';
                 \}
         \}
 \}
+function toggle_infmessage()
+\{
+     toggle_elements("infmessage","div");
+\}
+function toggle_spamreport()
+\{
+     toggle_elements("spamreport","div");
+\}     
 -->
 </script>
 </head>
 <body>
 <h1>{html_escape($config{project})} {html_escape($config{bug})} report logs - 
-<a href="mailto:{$bug_num}@{html_escape($config{email_domain})}">#{$bug_num}</a><br/>
+<a href="mailto:{$bug_num}@{html_escape($config{email_domain})}">#{$bug_num}</a><br>
 {html_escape($status{subject})}</h1>
 <div class="versiongraph">{$version_graph}</div>
 {include(q(cgi/bugreport_pkginfo))}
@@ -27,9 +42,11 @@ function toggle_infmessages()
      $output .= sprintf qq(<p><a href="%s">Full log</a></p>),html_escape(bug_links(bug=>$bug_num,links_only=>1));
   }
   else {
-     $output .=  qq(<p><a href="mailto:$bug_num\@$config{email_domain}">Reply</a> ).
-         qq(or <a href="mailto:$bug_num-subscribe\@$config{email_domain}">subscribe</a> ).
+     if (not $status{archived}) {
+       $output .=  qq(<p><a href="mailto:$bug_num\@$config{email_domain}">Reply</a> ).
+          qq(or <a href="mailto:$bug_num-subscribe\@$config{email_domain}">subscribe</a> ).
               qq(to this bug.</p>\n);
+     }
      $output .=  qq(<p><a href="javascript:toggle_infmessages();">Toggle useless messages</a></p>);
      $output .= sprintf qq(<div class="msgreceived"><p>View this report as an <a href="%s">mbox folder</a>, ).
          qq(<a href="%s">status mbox</a>, <a href="%s">maintainer mbox</a></p></div>\n),
@@ -41,7 +58,7 @@ function toggle_infmessages()
 }
 {$log}
 <hr>
-<p class="msgreceived">Send a report that <a href="http://{$config{cgi_domain}}/bugspam.cgi">this bug log contains spam</a>.</p>
+<p class="msgreceived">Report that <a href="javascript:toggle_spamreport()">messages in this bug log are spam</a>.</p>
 <hr>
 {include(q(html/html_tail))}
 </body>