gitweb: Cleanup Git logo and Git logo target generation
Rename $githelp_url and $githelp_label to $logo_url and $logo_label to be more obvious what they refer to; while at it add commented out previous contents (git documentation at kernel.org). Add comment about logo size. Use $cgi->a(...) to generate Git logo link; it automatically escapes attribute values when it is needed. Escape href attribute using esc_url instead of (incorrect!) esc_html. Move styling of git logo <img> element from "style" attribute to CSS via setting class to "logo". Perhaps we should set it by id rather than by class. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
Jakub Narebski committed
Oct 6, 2006 at 12:31 UTC
9a7a62ff71c436fb5e024ec409ec28fca460a168
2 files changed
+14
-8
gitweb/gitweb.css
+5
@@ -16,6 +16,11 @@ a:hover, a:visited, a:active {
16
color: #880000;
17
}
18
19
+img.logo {
20
+ float: right;
21
+ border-width: 0px;
22
+}
23
+
24
div.page_header {
25
height: 25px;
26
padding: 8px;
gitweb/gitweb.perl
+9
-8
@@ -46,13 +46,16 @@ our $home_text = "++GITWEB_HOMETEXT++";
46
47
# URI of default stylesheet
48
our $stylesheet = "++GITWEB_CSS++";
49
-# URI of GIT logo
49
+# URI of GIT logo (72x27 size)
50
our $logo = "++GITWEB_LOGO++";
51
# URI of GIT favicon, assumed to be image/png type
52
our $favicon = "++GITWEB_FAVICON++";
53
54
-our $githelp_url = "http://git.or.cz/";
55
-our $githelp_label = "git homepage";
54
+# URI and label (title) of GIT logo link
55
+#our $logo_url = "http://www.kernel.org/pub/software/scm/git/docs/";
56
+#our $logo_label = "git documentation";
57
+our $logo_url = "http://git.or.cz/";
58
+our $logo_label = "git homepage";
59
60
# source of projects list
61
our $projects_list = "++GITWEB_LIST++";
@@ -1385,11 +1388,9 @@ EOF
1388
print "</head>\n" .
1389
"<body>\n" .
1390
"<div class=\"page_header\">\n" .
1388
- "<a href=\"" . esc_html($githelp_url) .
1389
- "\" title=\"" . esc_html($githelp_label) .
1390
- "\">" .
1391
- "<img src=\"$logo\" width=\"72\" height=\"27\" alt=\"git\" style=\"float:right; border-width:0px;\"/>" .
1392
- "</a>\n";
1391
+ $cgi->a({-href => esc_url($logo_url),
1392
+ -title => $logo_label},
1393
+ qq(<img src="$logo" width="72" height="27" alt="git" class="logo"/>));
1394
print $cgi->a({-href => esc_url($home_link)}, $home_link_str) . " / ";
1395
if (defined $project) {
1396
print $cgi->a({-href => href(action=>"summary")}, esc_html($project));