"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Omar Polo <op@omarpolo.com>
Subject:
gotwebd css: fix hscroll on error
To:
gameoftrees@openbsd.org
Date:
Tue, 03 Jan 2023 17:48:14 +0100

Download raw body.

Thread
This removes the horizontal scrolling bar when an error occurs.  An
error may be rendered for various reason, one of which is viewing the
summary for a repo that doesn't have any tags, or for a genuine error
condition.

I've tested diff below both against repos without tags and with
artificial errors injected like this:

    --- gotwebd/gotweb.c
    +++ gotwebd/gotweb.c
    @@ -156,6 +156,11 @@ gotweb_process_request(struct request *c)
     		goto render;
     	}
     
    +	if (1) {
    +		error2 = got_error(GOT_ERR_QUERYSTRING);
    +		goto render;
    +	}
    +
     	if (qs->action != INDEX) {
     		error = gotweb_init_repo_dir(&repo_dir, qs->path);
     		if (error)

the page seems to be rendered fine in either case.  Make sure to clear
the browser cache when testing.

ok?


diff /home/op/w/got
commit - 3bf00f2542ea6e7825f52c155e5f3f5fecb136e3
path + /home/op/w/got
blob - 7ee40c3b69dbf14194f2d61478622267175c57c1
file + gotwebd/files/htdocs/gotwebd/gotweb.css
--- gotwebd/files/htdocs/gotwebd/gotweb.css
+++ gotwebd/files/htdocs/gotwebd/gotweb.css
@@ -301,7 +301,6 @@ body {
 #err_content {
 	clear: left;
 	float: left;
-	width: 100%;
 	padding-left: 20px;
 	padding-top: 20px;
 	padding-bottom: 20px;