threads / patch / 34392

patchgitweb: Ensure OPML text fits inside its box.

Subject: [PATCH] gitweb: Ensure OPML text fits inside its box.

## tl;dr

12 messages between Jul 2, 2013 and Aug 5, 2013. Diffs are folded; open one to read it.

replies: 11people: 3as markdown or json

Tony Finch· Jul 9, 2013, 16:43 UTC · lore

The rss_logo CSS style has a fixed width which is too narrow for the string "OPML". Replace the fixed width with horizontal padding so the text fits with nice margins. ---

For before/after examples, see http://dotat.at/cgi/git (overflow) and https://git.csx.cam.ac.uk/x/ucs/ (padded).

 gitweb/static/gitweb.css | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
Show changes to gitweb/static/gitweb.css +1 −2
diff --git a/gitweb/static/gitweb.css b/gitweb/static/gitweb.css
index cb86d2d..a869be1 100644
--- a/gitweb/static/gitweb.css
+++ b/gitweb/static/gitweb.css
@@ -548,8 +548,7 @@ a.linenr {
 
 a.rss_logo {
 	float: right;
-	padding: 3px 0px;
-	width: 35px;
+	padding: 3px 5px;
 	line-height: 10px;
 	border: 1px solid;
 	border-color: #fcc7a5 #7d3302 #3e1a01 #ff954e;
-- 
1.8.3.1.605.g85318f5
Tony Finch· Jul 9, 2013, 17:08 UTC · re: Tony Finch · lore

[PATCH] gitweb: vertically centre contents of page footer

---
 gitweb/static/gitweb.css | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Show changes to gitweb/static/gitweb.css +2 −1
diff --git a/gitweb/static/gitweb.css b/gitweb/static/gitweb.css
index a869be1..3b4d833 100644
--- a/gitweb/static/gitweb.css
+++ b/gitweb/static/gitweb.css
@@ -68,12 +68,13 @@ div.page_path {
 }
 
 div.page_footer {
-	height: 17px;
+	height: 22px;
 	padding: 4px 8px;
 	background-color: #d9d8d1;
 }
 
 div.page_footer_text {
+	line-height: 22px;
 	float: left;
 	color: #555555;
 	font-style: italic;
-- 
1.8.3.1.605.g85318f5
Jonathan Nieder· Jul 14, 2013, 23:49 UTC · re: Tony Finch · lore

Re: [PATCH] gitweb: Ensure OPML text fits inside its box.

Tony Finch wrote:
> The rss_logo CSS style has a fixed width which is too narrow for
> the string "OPML". Replace the fixed width with horizontal padding
> so the text fits with nice margins.

Sounds sensible. Can we have your sign-off? (Likewise for the next patch.)

Thanks, Jonathan

Tony Finch· Jul 2, 2013, 16:24 UTC · re: Jonathan Nieder · lore

[PATCH 3/4] gitweb: omit the repository owner when it is unset

On the repository summary page, leave the whole owner line out if the repo does not have an owner, rather than displaying a labelled empty field..

Signed-off-by: Tony Finch <dot@dotat.at>
---
 gitweb/gitweb.perl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Show changes to gitweb/gitweb.perl +1 −1
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 8d69ada..c029b98 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -6463,7 +6463,7 @@ sub git_summary {
 	print "<div class=\"title\">&nbsp;</div>\n";
 	print "<table class=\"projects_list\">\n" .
 	      "<tr id=\"metadata_desc\"><td>description</td><td>" . esc_html($descr) . "</td></tr>\n";
-        unless ($omit_owner) {
+        if ($owner and not $omit_owner) {
 	        print  "<tr id=\"metadata_owner\"><td>owner</td><td>" . esc_html($owner) . "</td></tr>\n";
         }
 	if (defined $cd{'rfc2822'}) {
-- 
1.8.3.1.605.g85318f5
Tony Finch· Jul 9, 2013, 16:43 UTC · re: Jonathan Nieder · lore

[PATCH 1/4] gitweb: Ensure OPML text fits inside its box.

The rss_logo CSS style has a fixed width which is too narrow for the string "OPML". Replace the fixed width with horizontal padding so the text fits with nice margins.

Signed-off-by: Tony Finch <dot@dotat.at>
---
 gitweb/static/gitweb.css | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
Show changes to gitweb/static/gitweb.css +1 −2
diff --git a/gitweb/static/gitweb.css b/gitweb/static/gitweb.css
index cb86d2d..a869be1 100644
--- a/gitweb/static/gitweb.css
+++ b/gitweb/static/gitweb.css
@@ -548,8 +548,7 @@ a.linenr {
 
 a.rss_logo {
 	float: right;
-	padding: 3px 0px;
-	width: 35px;
+	padding: 3px 5px;
 	line-height: 10px;
 	border: 1px solid;
 	border-color: #fcc7a5 #7d3302 #3e1a01 #ff954e;
-- 
1.8.3.1.605.g85318f5
Tony Finch· Jul 9, 2013, 17:08 UTC · re: Jonathan Nieder · lore

[PATCH 2/4] gitweb: vertically centre contents of page footer

Signed-off-by: Tony Finch <dot@dotat.at>
---
 gitweb/static/gitweb.css | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Show changes to gitweb/static/gitweb.css +2 −1
diff --git a/gitweb/static/gitweb.css b/gitweb/static/gitweb.css
index a869be1..3b4d833 100644
--- a/gitweb/static/gitweb.css
+++ b/gitweb/static/gitweb.css
@@ -68,12 +68,13 @@ div.page_path {
 }
 
 div.page_footer {
-	height: 17px;
+	height: 22px;
 	padding: 4px 8px;
 	background-color: #d9d8d1;
 }
 
 div.page_footer_text {
+	line-height: 22px;
 	float: left;
 	color: #555555;
 	font-style: italic;
-- 
1.8.3.1.605.g85318f5
Tony Finch· Jul 9, 2013, 17:15 UTC · re: Jonathan Nieder · lore

[PATCH 4/4] gitweb: make search help link less ugly

The search help link was a superscript question mark right next to a drop-down menu, which looks misaligned and is a cramped and awkward click target. Remove the superscript tags and add some spacing to fix these nits. Add a title attribute to provide an explanatory mouseover.

Signed-off-by: Tony Finch <dot@dotat.at>
---
 gitweb/gitweb.perl | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Show changes to gitweb/gitweb.perl +3 −3
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index c029b98..874c948 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -4029,9 +4029,9 @@ sub print_search_form {
 	      $cgi->input({-name=>"a", -value=>"search", -type=>"hidden"}) . "\n" .
 	      $cgi->input({-name=>"h", -value=>$search_hash, -type=>"hidden"}) . "\n" .
 	      $cgi->popup_menu(-name => 'st', -default => 'commit',
-	                       -values => ['commit', 'grep', 'author', 'committer', 'pickaxe']) .
-	      $cgi->sup($cgi->a({-href => href(action=>"search_help")}, "?")) .
-	      " search:\n",
+			       -values => ['commit', 'grep', 'author', 'committer', 'pickaxe']) .
+	      " " . $cgi->a({-href => href(action=>"search_help"),
+			     -title => "search help" }, "?") . " search:\n",
 	      $cgi->textfield(-name => "s", -value => $searchtext, -override => 1) . "\n" .
 	      "<span title=\"Extended regular expression\">" .
 	      $cgi->checkbox(-name => 'sr', -value => 1, -label => 're',
-- 
1.8.3.1.605.g85318f5
Tony Finch· Jul 15, 2013, 09:15 UTC · re: Jonathan Nieder · lore

Re: [PATCH] gitweb: Ensure OPML text fits inside its box.

Jonathan Nieder <jrnieder@gmail.com> wrote:
>
> Sounds sensible.  Can we have your sign-off?  (Likewise for the next
> patch.)

Doh! Thanks for looking at the patches. I'll post revised versions, plus a couple more tweaks.

Tony.
-- 
f.anthony.n.finch  <dot@dotat.at>  http://dotat.at/
Forties, Cromarty: East, veering southeast, 4 or 5, occasionally 6 at first.
Rough, becoming slight or moderate. Showers, rain at first. Moderate or good,
occasionally poor at first.
Jakub Narębski· Aug 3, 2013, 21:37 UTC · lore

Re: [PATCH 4/4] gitweb: make search help link less ugly

On Tue, Jul 9, 2013 at 7:15 PM, Tony Finch <dot@dotat.at> wrote:
> The search help link was a superscript question mark right next to
> a drop-down menu, which looks misaligned

I think the idea was to simulate footnote explaining search terms (I think, I am not the author of this feature)...

>                                                                and is a cramped and
> awkward click target. Remove the superscript tags and add some
> spacing to fix these nits. Add a title attribute to provide an
> explanatory mouseover.
... but I agree that it makes for poor UI.
Show 18 quoted lines
>
> Signed-off-by: Tony Finch <dot@dotat.at>
> ---
>  gitweb/gitweb.perl | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
> index c029b98..874c948 100755
> --- a/gitweb/gitweb.perl
> +++ b/gitweb/gitweb.perl
> @@ -4029,9 +4029,9 @@ sub print_search_form {
>               $cgi->input({-name=>"a", -value=>"search", -type=>"hidden"}) . "\n" .
>               $cgi->input({-name=>"h", -value=>$search_hash, -type=>"hidden"}) . "\n" .
>               $cgi->popup_menu(-name => 'st', -default => 'commit',
> -                              -values => ['commit', 'grep', 'author', 'committer', 'pickaxe']) .
> -             $cgi->sup($cgi->a({-href => href(action=>"search_help")}, "?")) .
> -             " search:\n",
> +                              -values => ['commit', 'grep', 'author', 'committer', 'pickaxe']) .
Nb. what changed here (in line above)?
Show 7 quoted lines
> +             " " . $cgi->a({-href => href(action=>"search_help"),
> +                            -title => "search help" }, "?") . " search:\n",
>               $cgi->textfield(-name => "s", -value => $searchtext, -override => 1) . "\n" .
>               "<span title=\"Extended regular expression\">" .
>               $cgi->checkbox(-name => 'sr', -value => 1, -label => 're',
> --
> 1.8.3.1.605.g85318f5
Tony Finch· Aug 5, 2013, 11:19 UTC · re: Jakub Narębski · lore

Re: [PATCH 4/4] gitweb: make search help link less ugly

Jakub Narębski <jnareb@gmail.com> wrote:
> > -                              -values => ['commit', 'grep', 'author', 'committer', 'pickaxe']) .
> > +                              -values => ['commit', 'grep', 'author', 'committer', 'pickaxe']) .
>
> Nb. what changed here (in line above)?
Whoops, tab damage. I will re-roll. Thanks for the review.
Tony.
-- 
f.anthony.n.finch  <dot@dotat.at>  http://dotat.at/
Forties, Cromarty: East, veering southeast, 4 or 5, occasionally 6 at first.
Rough, becoming slight or moderate. Showers, rain at first. Moderate or good,
occasionally poor at first.
Jakub Narębski· Aug 3, 2013, 21:40 UTC · lore

Re: [PATCH 3/4] gitweb: omit the repository owner when it is unset

On Tue, Jul 2, 2013 at 6:24 PM, Tony Finch <dot@dotat.at> wrote:
> On the repository summary page, leave the whole owner line out if
> the repo does not have an owner, rather than displaying a labelled
> empty field..
Note that if $omit_owner is true, whole _column_ is skipped.

Is removing cell (instead of leaving it empty) and relying on browser treating nonexistent cell correctly a good idea, that I do not know. Does it looks better? Does it looks better in all web browsers?

Show 21 quoted lines
> Signed-off-by: Tony Finch <dot@dotat.at>
> ---
>  gitweb/gitweb.perl | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
> index 8d69ada..c029b98 100755
> --- a/gitweb/gitweb.perl
> +++ b/gitweb/gitweb.perl
> @@ -6463,7 +6463,7 @@ sub git_summary {
>         print "<div class=\"title\">&nbsp;</div>\n";
>         print "<table class=\"projects_list\">\n" .
>               "<tr id=\"metadata_desc\"><td>description</td><td>" . esc_html($descr) . "</td></tr>\n";
> -        unless ($omit_owner) {
> +        if ($owner and not $omit_owner) {
>                 print  "<tr id=\"metadata_owner\"><td>owner</td><td>" . esc_html($owner) . "</td></tr>\n";
>          }
>         if (defined $cd{'rfc2822'}) {
> --
> 1.8.3.1.605.g85318f5
>
-- 
Jakub Narebski
Tony Finch· Aug 5, 2013, 11:36 UTC · re: Jakub Narębski · lore

Re: [PATCH 3/4] gitweb: omit the repository owner when it is unset

Jakub Narębski <jnareb@gmail.com> wrote:
Show 7 quoted lines
> On Tue, Jul 2, 2013 at 6:24 PM, Tony Finch <dot@dotat.at> wrote:
>
> > On the repository summary page, leave the whole owner line out if
> > the repo does not have an owner, rather than displaying a labelled
> > empty field..
>
> Note that if $omit_owner is true, whole _column_ is skipped.

There are two places where the owner is displayed: on the list of projects, and on each project's summary page. This change affects the summary page (where it removes a row, not a column) and it leaves the projects list alone. I'll make that clearer in the commit message (and fix the extraneous dot).

Tony.
-- 
f.anthony.n.finch  <dot@dotat.at>  http://dotat.at/
Forties, Cromarty: East, veering southeast, 4 or 5, occasionally 6 at first.
Rough, becoming slight or moderate. Showers, rain at first. Moderate or good,
occasionally poor at first.

← back to recent threads