add an email_link() function
authorChristian Thaeter <ct@pipapo.org>
Mon, 7 Jan 2008 21:11:14 +0000 (22:11 +0100)
committerChristian Thaeter <ct@pipapo.org>
Mon, 7 Jan 2008 21:11:14 +0000 (22:11 +0100)
src/object.c
src/webgit.c
src/webgit.h

index cdd10307d642ab9a1ff1f7e86cab6ab7b64c304e..f23751551b841b8b4606a48dccdaee5eb2bbb0d8 100644 (file)
@@ -127,13 +127,7 @@ webgit_object_commit_content_action (struct webgit_query* query, unsigned char*
 
           html_list_append (author, html (
                                           html ( author_text ), /*BUG: libcwa bug, must be wraped in html()*/
-                                          html (
-                                                html_tag("a",
-                                                         html_attr ("href",
-                                                                    html ("mailto:", email))
-                                                         ),
-                                                name
-                                                ),
+                                          webgit_email_link (name, email),
                                           html_strndup (pretty_date, 255)
                                           )
                             );
@@ -156,13 +150,7 @@ webgit_object_commit_content_action (struct webgit_query* query, unsigned char*
               strftime (pretty_date, 255, "%c", &tm);
 
               html_list_append (committer, html ("Committer: ",
-                                                 html(
-                                                      html_tag("a",
-                                                               html_attr("href",
-                                                                         html ("mailto:", email))
-                                                               ),
-                                                      name
-                                                      ),
+                                                 webgit_email_link (name, email),
                                                  html_strndup (pretty_date, 255)
                                                  )
                                 );
index d6c8e3c26e4e7c5c0f37ee93f1486d6e38bbb841..40b23230e40c90768ee219fcdfa1acd4a751b6f9 100644 (file)
@@ -68,6 +68,20 @@ webgit_setup (void)
 }
 
 
+Html
+webgit_email_link (Html name, Html email)
+{
+  return html (
+               html_tag("a",
+                        html_attr ("href",
+                                   html ("mailto:", email))
+                        ),
+               name
+               );
+}
+
+
+
 int
 main (int argc, char**argv)
 {
index f007c16654b45681ac2b49fbcde34c2546fc3d80..96c91a69d804e45917978c710fbb2d6de80cd22e 100644 (file)
@@ -71,4 +71,8 @@ struct webgit_repo_info
   unsigned long age;
 };
 
+
+Html
+webgit_email_link (Html name, Html email);
+
 #endif