From: Jakub Narebski <jnareb@gmail.com>
To: Junio C Hamano <junkio@cox.net>
Cc: git@vger.kernel.org
Subject: [PATCH] gitweb: Cleanup Git logo and Git logo target generation
Date: Fri, 6 Oct 2006 12:31:05 +0200 [thread overview]
Message-ID: <200610061231.06017.jnareb@gmail.com> (raw)
In-Reply-To: <7vac4qs43g.fsf@assigned-by-dhcp.cox.net>
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>
---
Junio C Hamano wrote:
>>> + "<a href=\"" . esc_html($githelp_url) .
>>> + "\" title=\"" . esc_html($githelp_label) .
>>> + "\">" .
>>
>> Why not use $cgi->a_begin({-href=>esc_param($githelp_url),
>> -title=>$githelp_label}); or just plain $cgi->a and $cgi->img?
>
> Be my guest and send in a proper patch please.
>
> I was merely demonstrating my preference on how definition of
> default values and actual use of them are separated.
And here it is. By the way, esc_html was incorrect, I think.
gitweb/gitweb.css | 5 +++++
gitweb/gitweb.perl | 17 +++++++++--------
2 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/gitweb/gitweb.css b/gitweb/gitweb.css
index 668e69a..3f62b6d 100644
--- a/gitweb/gitweb.css
+++ b/gitweb/gitweb.css
@@ -16,6 +16,11 @@ a:hover, a:visited, a:active {
color: #880000;
}
+img.logo {
+ float: right;
+ border-width: 0px;
+}
+
div.page_header {
height: 25px;
padding: 8px;
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 3320069..a966f9f 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -46,13 +46,16 @@ our $home_text = "++GITWEB_HOMETEXT++";
# URI of default stylesheet
our $stylesheet = "++GITWEB_CSS++";
-# URI of GIT logo
+# URI of GIT logo (72x27 size)
our $logo = "++GITWEB_LOGO++";
# URI of GIT favicon, assumed to be image/png type
our $favicon = "++GITWEB_FAVICON++";
-our $githelp_url = "http://git.or.cz/";
-our $githelp_label = "git homepage";
+# URI and label (title) of GIT logo link
+#our $logo_url = "http://www.kernel.org/pub/software/scm/git/docs/";
+#our $logo_label = "git documentation";
+our $logo_url = "http://git.or.cz/";
+our $logo_label = "git homepage";
# source of projects list
our $projects_list = "++GITWEB_LIST++";
@@ -1376,11 +1379,9 @@ EOF
print "</head>\n" .
"<body>\n" .
"<div class=\"page_header\">\n" .
- "<a href=\"" . esc_html($githelp_url) .
- "\" title=\"" . esc_html($githelp_label) .
- "\">" .
- "<img src=\"$logo\" width=\"72\" height=\"27\" alt=\"git\" style=\"float:right; border-width:0px;\"/>" .
- "</a>\n";
+ $cgi->a({-href => esc_url($logo_url),
+ -title => $logo_label},
+ qq(<img src="$logo" width="72" height="27" alt="git" class="logo"/>));
print $cgi->a({-href => esc_url($home_link)}, $home_link_str) . " / ";
if (defined $project) {
print $cgi->a({-href => href(action=>"summary")}, esc_html($project));
--
1.4.2.1
next prev parent reply other threads:[~2006-10-06 10:30 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-19 21:27 [RFC][PATCH] gitweb: Make the Git logo link target to point to the homepage Petr Baudis
2006-09-23 12:57 ` Petr Baudis
2006-09-23 19:36 ` Junio C Hamano
2006-09-23 19:46 ` Petr Baudis
2006-10-05 20:47 ` Petr Baudis
2006-10-05 21:23 ` Junio C Hamano
2006-10-05 21:34 ` Junio C Hamano
2006-10-05 23:57 ` Petr Baudis
2006-09-23 19:54 ` Jakub Narebski
2006-09-23 20:46 ` Junio C Hamano
2006-10-06 10:31 ` Jakub Narebski [this message]
2006-10-07 8:36 ` [PATCH] gitweb: Cleanup Git logo and Git logo target generation Junio C Hamano
2006-10-07 9:58 ` Jakub Narebski
2006-10-07 14:14 ` Alan Chandler
2006-10-08 13:31 ` Jakub Narebski
2006-10-08 19:47 ` Junio C Hamano
2006-10-08 20:10 ` Petr Baudis
2006-10-08 20:33 ` Junio C Hamano
2006-10-08 20:54 ` Jakub Narebski
2006-10-09 0:54 ` Junio C Hamano
2006-10-09 7:14 ` Jakub Narebski
2006-10-09 9:00 ` Junio C Hamano
2006-10-09 9:26 ` Jakub Narebski
2006-10-09 20:36 ` Petr Baudis
2006-10-08 20:17 ` Jakub Narebski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200610061231.06017.jnareb@gmail.com \
--to=jnareb@gmail.com \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).