All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: git@vger.kernel.org
Cc: John 'Warthog9' Hawley <warthog9@kernel.org>,
	Jakub Narebski <jnareb@gmail.com>,
	Eric Wong <normalperson@yhbt.net>
Subject: [PATCH 2/2] gitweb: make logo optional
Date: Mon, 3 Jan 2011 23:05:55 -0600	[thread overview]
Message-ID: <20110104050555.GC8280@burratino> (raw)
In-Reply-To: <20110104050206.GA8280@burratino>

Date: Fri, 3 Sep 2010 19:45:09 -0500

Some sites may not want to have a logo at all.  In particular, git
instaweb can benefit from this.

While at it, use $cgi->img to simplify this code.  (CGI.pm learned
most HTML4 tags by version 2.79, so this should be portable to perl
5.8, though I haven't tested.)

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
Eric liked an earlier version of this patch that did not use
$cgi->img.

 gitweb/gitweb.perl |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index c65af1a..064697c 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -3601,10 +3601,15 @@ EOF
 		insert_file($site_header);
 	}
 
-	print "<div class=\"page_header\">\n" .
-	      $cgi->a({-href => esc_url($logo_url),
-	               -title => $logo_label},
-	              qq(<img src=").esc_url($logo).qq(" width="72" height="27" alt="git" class="logo"/>));
+	print "<div class=\"page_header\">\n";
+	if (defined $logo) {
+		print $cgi->a({-href => esc_url($logo_url),
+		               -title => $logo_label},
+		              $cgi->img({-src => esc_url($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.7.4.rc0

  parent reply	other threads:[~2011-01-04  5:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-04  5:02 [PATCH 0/2] gitweb: make logo optional Jonathan Nieder
2011-01-04  5:02 ` [PATCH 1/2] gitweb: skip logo in atom feed when there is none Jonathan Nieder
2011-01-05  0:25   ` Jakub Narebski
2011-01-05  0:45     ` Junio C Hamano
2011-01-04  5:05 ` Jonathan Nieder [this message]
2011-01-04 11:52   ` [PATCH 2/2] gitweb: make logo optional Jakub Narebski
2011-01-04 16:29     ` Jonathan Nieder
2011-01-04 23:24 ` [PATCH 0/2] " Eric Wong

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=20110104050555.GC8280@burratino \
    --to=jrnieder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=jnareb@gmail.com \
    --cc=normalperson@yhbt.net \
    --cc=warthog9@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.