$OpenBSD: patch-base_src_client_browse_Browse_c,v 1.2 2002/08/28 22:23:29 todd Exp $
--- base/src/client/browse/Browse.c.orig	Mon Jul 22 02:02:51 2002
+++ base/src/client/browse/Browse.c	Wed Aug 28 14:26:40 2002
@@ -276,6 +276,11 @@ show_files(SDR_stream *out, Repository *
 
     for (w = 0; w < vec_size(ev); w++) {
       const FileEntry *fe = vec_fetch(ev, w);
+      const char *email = fe->u ? pubkey_GetEmail(fe->u->pubKey) : "??";
+      const char *author = email;
+      if (fe->u)
+	author = format(LINK("/opencm/everyone/%s", CONTENT("%s")),
+			email, email);
 
       if (last && strcmp(fe->name, last) == 0) 
 	continue;
@@ -292,8 +297,7 @@ show_files(SDR_stream *out, Repository *
       stream_printf(out, "<td>" "%c" "</td>", fe->isDir ? ' ' : fe->e->entityType);
       stream_printf(out, "<td>" "%s" "</td>", 
 	      fe->ci ? xlate_time(fe->ci->time) : "");
-      stream_printf(out, "<td>" "%s" "</td>", 
-	      fe->u ? pubkey_GetEmail(fe->u->pubKey) : "??");
+      stream_printf(out, "<td>" "%s" "</td>", author);
 
       stream_printf(out, "</tr>");
     }
@@ -303,6 +307,19 @@ show_files(SDR_stream *out, Repository *
 
 }
 
+static const char *
+page_header(const char *title)
+{
+  return format("<head><title>%s</title>"
+		"<style type=\"text/css\"> <!--"
+		"A { text-decoration: none }"
+		"A:visited { text-decoration: none; color: blue }"
+		"A:hover { text-decoration: none; color: red }"
+		"A:active { text-decoration: none; color: blue }"
+		"--></style>"
+		"</head>\n");
+}
+
 static void
 show_html(SDR_stream *out, Repository *repos, Resolution *res, 
 	  const char *thisPageURI)
@@ -318,7 +335,7 @@ show_html(SDR_stream *out, Repository *r
 	User *u =  (User *) res->tail;
 	const char *u_s = u ? pubkey_GetEmail(u->pubKey) : "??";
 
-	stream_printf(out, "<head><title>User %s</title></head>\n", u_s);
+	stream_printf(out, page_header(format("User %s", u_s)));
 	stream_printf(out, BODY);
 	stream_printf(out, "<center>\n");
 	stream_printf(out, "User<br>%s\n", u_s);
@@ -431,7 +448,7 @@ show_html(SDR_stream *out, Repository *r
 	Directory *dir = (Directory *) res->tail;
 	unsigned u;
 
-	stream_printf(out, "<head><title>Directory %s</title></head>\n", decodedURI);
+	stream_printf(out, page_header(format("Directory %s", decodedURI)));
 	stream_printf(out, BODY);
 	stream_printf(out, "<center>\n");
 	stream_printf(out, "Directory %s<br>", decodedURI);
@@ -473,7 +490,7 @@ show_html(SDR_stream *out, Repository *r
 
 	    stream_printf(out, "<tr valign=\"top\">");
 
-	    stream_printf(out, "<td>%s%s</ty>", 
+	    stream_printf(out, "<td>%s%s</td>", 
 		    (m && (m->flags & MF_FROZEN)) ? "F" : "",
 		    (m && (m->flags & MF_NOTRAIL)) ? "N" : "");
 
@@ -481,11 +498,15 @@ show_html(SDR_stream *out, Repository *r
 		    thisPageURI,
 		    uri_encode(de->key), de->key);
 	    if (s) {
-	      stream_printf(out, "<td>%s</ty>", xunsigned64_str(m->nRevisions));
-	      stream_printf(out, "<td>%s</ty>", s->ser_type->tyName);
-	      stream_printf(out, "<td>%s</ty>", xlate_time(rev->reviseTime));
-	      stream_printf(out, "<td>%s</ty>", 
-		      u ? pubkey_GetEmail(u->pubKey) : "???");
+	      const char *email = u ? pubkey_GetEmail(u->pubKey) : "???";
+	      const char *author = email;
+	      if (u)
+		author = format(LINK("/opencm/everyone/%s", CONTENT("%s")),
+				email, email);
+	      stream_printf(out, "<td>%s</td>", xunsigned64_str(m->nRevisions));
+	      stream_printf(out, "<td>%s</td>", s->ser_type->tyName);
+	      stream_printf(out, "<td>%s</td>", xlate_time(rev->reviseTime));
+	      stream_printf(out, "<td>%s</td>", author);
 	    }
 	    else {
 	      stream_printf(out, "<td colspan='5'><em>inaccessable</em></td>");
@@ -505,7 +526,7 @@ show_html(SDR_stream *out, Repository *r
 	Group *grp = (Group *) res->tail;
 	unsigned u;
 
-	stream_printf(out, "<head><title>Group %s</title></head>\n", decodedURI);
+	stream_printf(out, page_header(format("Group %s", decodedURI)));
 	stream_printf(out, BODY);
 	stream_printf(out, "<center>\n");
 	stream_printf(out, "Group<br>%s\n", decodedURI);
@@ -563,7 +584,7 @@ show_html(SDR_stream *out, Repository *r
 	  (Buffer *)repos_GetEntity(repos, res->m->uri,
 				    e->contentTrueName);
 
-	stream_printf(out, "<head><title>File %s</title></head>\n", res->fp_frag);
+	stream_printf(out, page_header(format("File %s", res->fp_frag)));
 	stream_printf(out, BODY);
 	stream_printf(out, "<center>\n");
 	stream_printf(out, "File %s\n", res->fp_frag);
@@ -599,7 +620,7 @@ show_html(SDR_stream *out, Repository *r
 	oc_uint64_t last = res->m->nRevisions - 1;
 	oc_uint64_t first = (last < 20) ? 0 : last - 19;
 
-	stream_printf(out, "<head><title>Branch %s</title></head>\n", res->fp_frag);
+	stream_printf(out, page_header(format("Branch %s", res->fp_frag)));
 	stream_printf(out, BODY);
 	stream_printf(out, "<center>\n");
 	stream_printf(out, "Branch %s\n", res->fp_frag);
@@ -636,6 +657,8 @@ show_html(SDR_stream *out, Repository *r
 	    TRY {
 	      u = repos_GetEntity(repos, res->m->uri, rev->revisor);
 	      userName = pubkey_GetEmail(u->pubKey);
+	      userName = format(LINK("/opencm/everyone/%s", CONTENT("%s")),
+				userName, userName);
 	    }
 	    DEFAULT(ex) {
 	    }
@@ -669,7 +692,7 @@ show_html(SDR_stream *out, Repository *r
 	  (CommitInfo *)repos_GetEntity(repos, res->m->uri,
 					chg->commitInfoTrueName);
 	
-	stream_printf(out, "<head><title>Commit %s</title></head>\n", res->fp_frag);
+	stream_printf(out, page_header(format("Commit %s", res->fp_frag)));
 	stream_printf(out, BODY);
 	stream_printf(out, "<center>\n");
 	stream_printf(out, "Commit %s (%s)\n", res->fp_frag, xunsigned64_str(ver->rev));
@@ -698,9 +721,8 @@ show_html(SDR_stream *out, Repository *r
 
 	const char *revNo = xunsigned64_str(fsDir->rev);
 
-	stream_printf(out, "<head><title>Commit %s, %s/</title></head>\n", revNo,
-		fsDir->path);
-
+	stream_printf(out, page_header(format("Commit %s, %s/", 
+					      revNo, fsDir->path)));
 	stream_printf(out, BODY);
 	stream_printf(out, "<center>\n");
 	stream_printf(out, "Commit %s, %s/\n", revNo, fsDir->path);
@@ -722,7 +744,8 @@ show_html(SDR_stream *out, Repository *r
       {
 	const char *tname = res->tail->ser_type->tyName;
 
-	stream_printf(out, "<head><title>Unhandled %s</title></head>\n", res->fp_frag);
+	stream_printf(out, page_header(format("Unhandled %s", 
+					      res->fp_frag)));
 	stream_printf(out, BODY);
 	stream_printf(out, "<center>\n");
 	stream_printf(out, "Unhandled type %s\n", tname);
@@ -771,7 +794,7 @@ opencm_browse(WorkSpace *ws, int argc, c
 
   if (v == 0 || vec_size(v) != 1) {
     xprintf("<html>\n");
-    xprintf("<head><title>%s</title></head>\n", arg);
+    xprintf(page_header(arg));
     xprintf("<body BGCOLOR='#ffeedd' text='#000000' link='#0000ee'"
 	    " vlink='#551a8b' alink='#ff0000'>\n");
     xprintf("<center>\n");
@@ -796,9 +819,7 @@ opencm_browse(WorkSpace *ws, int argc, c
       ok = FALSE;
 
       xprintf("<html>");
-      xprintf("<head>");
-      xprintf("<title>EXCEPTION!</title>");
-      xprintf("</head>");
+      xprintf(page_header("EXCEPTION!"));
       xprintf("<body>");
       xprintf("<pre>");
 
