# HG changeset patch # User Gregory Szorc # Date 1497041751 25200 # Node ID 2d93d2159e30e0a19fb23e13d0120e56dda5e8fb # Parent cb5123eff7d1b50b24495f18dc84bd8d8ea3898c hgweb: refresh styling of gitweb's search form gitweb was missing the hint hover box. So that was added. Also, the positioning of the form was absolute and it didn't vertically align on all pages. The element has been moved inline with the navigation links (which now are contained in a div) and flexbox is used to obtain sane alignment of the navigation links and search form. For those new to flexbox, "justify-content: space-between" basically says to maximize space elements. You can use it to easily get left and right justified containers without having to worry about width, floating, etc. "align-items: center" centers all items in a cross-axis. I've literally wasted hours trying to figure out both these problems before flexbox. Flexbox is amazing. Flexbox has been supported by Chrome and Firefox for a few years. But it is only supported by IE 11. I'm willing to wager that people using this either won't be using IE or will be using IE 11. So I'm willing to be a bit aggressive in adopting flexbox because it makes CSS alignment so much easier. diff -r cb5123eff7d1 -r 2d93d2159e30 mercurial/templates/gitweb/bookmarks.tmpl --- a/mercurial/templates/gitweb/bookmarks.tmpl Fri Jun 09 13:45:36 2017 -0700 +++ b/mercurial/templates/gitweb/bookmarks.tmpl Fri Jun 09 13:55:51 2017 -0700 @@ -10,10 +10,10 @@
 
diff -r cb5123eff7d1 -r 2d93d2159e30 mercurial/templates/gitweb/branches.tmpl --- a/mercurial/templates/gitweb/branches.tmpl Fri Jun 09 13:45:36 2017 -0700 +++ b/mercurial/templates/gitweb/branches.tmpl Fri Jun 09 13:55:51 2017 -0700 @@ -10,10 +10,10 @@
 
diff -r cb5123eff7d1 -r 2d93d2159e30 mercurial/templates/gitweb/changelog.tmpl --- a/mercurial/templates/gitweb/changelog.tmpl Fri Jun 09 13:45:36 2017 -0700 +++ b/mercurial/templates/gitweb/changelog.tmpl Fri Jun 09 13:55:51 2017 -0700 @@ -10,10 +10,10 @@ {entries%changelogentry} diff -r cb5123eff7d1 -r 2d93d2159e30 mercurial/templates/gitweb/changeset.tmpl --- a/mercurial/templates/gitweb/changeset.tmpl Fri Jun 09 13:45:36 2017 -0700 +++ b/mercurial/templates/gitweb/changeset.tmpl Fri Jun 09 13:55:51 2017 -0700 @@ -10,10 +10,10 @@
diff -r cb5123eff7d1 -r 2d93d2159e30 mercurial/templates/gitweb/error.tmpl --- a/mercurial/templates/gitweb/error.tmpl Fri Jun 09 13:45:36 2017 -0700 +++ b/mercurial/templates/gitweb/error.tmpl Fri Jun 09 13:55:51 2017 -0700 @@ -10,10 +10,10 @@
diff -r cb5123eff7d1 -r 2d93d2159e30 mercurial/templates/gitweb/fileannotate.tmpl --- a/mercurial/templates/gitweb/fileannotate.tmpl Fri Jun 09 13:45:36 2017 -0700 +++ b/mercurial/templates/gitweb/fileannotate.tmpl Fri Jun 09 13:55:51 2017 -0700 @@ -10,10 +10,10 @@
{file|escape}
diff -r cb5123eff7d1 -r 2d93d2159e30 mercurial/templates/gitweb/filecomparison.tmpl --- a/mercurial/templates/gitweb/filecomparison.tmpl Fri Jun 09 13:45:36 2017 -0700 +++ b/mercurial/templates/gitweb/filecomparison.tmpl Fri Jun 09 13:55:51 2017 -0700 @@ -10,10 +10,10 @@
{file|escape}
diff -r cb5123eff7d1 -r 2d93d2159e30 mercurial/templates/gitweb/filediff.tmpl --- a/mercurial/templates/gitweb/filediff.tmpl Fri Jun 09 13:45:36 2017 -0700 +++ b/mercurial/templates/gitweb/filediff.tmpl Fri Jun 09 13:55:51 2017 -0700 @@ -10,10 +10,10 @@
{file|escape}
diff -r cb5123eff7d1 -r 2d93d2159e30 mercurial/templates/gitweb/filelog.tmpl --- a/mercurial/templates/gitweb/filelog.tmpl Fri Jun 09 13:45:36 2017 -0700 +++ b/mercurial/templates/gitweb/filelog.tmpl Fri Jun 09 13:55:51 2017 -0700 @@ -10,10 +10,10 @@
{file|urlescape}{if(linerange, diff -r cb5123eff7d1 -r 2d93d2159e30 mercurial/templates/gitweb/filerevision.tmpl --- a/mercurial/templates/gitweb/filerevision.tmpl Fri Jun 09 13:45:36 2017 -0700 +++ b/mercurial/templates/gitweb/filerevision.tmpl Fri Jun 09 13:55:51 2017 -0700 @@ -10,10 +10,10 @@
{file|escape}
diff -r cb5123eff7d1 -r 2d93d2159e30 mercurial/templates/gitweb/graph.tmpl --- a/mercurial/templates/gitweb/graph.tmpl Fri Jun 09 13:45:36 2017 -0700 +++ b/mercurial/templates/gitweb/graph.tmpl Fri Jun 09 13:55:51 2017 -0700 @@ -11,10 +11,10 @@
 
diff -r cb5123eff7d1 -r 2d93d2159e30 mercurial/templates/gitweb/help.tmpl --- a/mercurial/templates/gitweb/help.tmpl Fri Jun 09 13:45:36 2017 -0700 +++ b/mercurial/templates/gitweb/help.tmpl Fri Jun 09 13:55:51 2017 -0700 @@ -10,10 +10,10 @@
 
diff -r cb5123eff7d1 -r 2d93d2159e30 mercurial/templates/gitweb/helptopics.tmpl --- a/mercurial/templates/gitweb/helptopics.tmpl Fri Jun 09 13:45:36 2017 -0700 +++ b/mercurial/templates/gitweb/helptopics.tmpl Fri Jun 09 13:55:51 2017 -0700 @@ -10,10 +10,10 @@
 
diff -r cb5123eff7d1 -r 2d93d2159e30 mercurial/templates/gitweb/manifest.tmpl --- a/mercurial/templates/gitweb/manifest.tmpl Fri Jun 09 13:45:36 2017 -0700 +++ b/mercurial/templates/gitweb/manifest.tmpl Fri Jun 09 13:55:51 2017 -0700 @@ -10,10 +10,10 @@
{path|escape} {inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}{bookmarks%bookmarktag}
diff -r cb5123eff7d1 -r 2d93d2159e30 mercurial/templates/gitweb/map --- a/mercurial/templates/gitweb/map Fri Jun 09 13:45:36 2017 -0700 +++ b/mercurial/templates/gitweb/map Fri Jun 09 13:55:51 2017 -0700 @@ -325,9 +325,12 @@ breadcrumb = '> {name|escape} ' searchform = ' -
- {sessionvars%hiddenformentry} - -
' + ' +searchhint = 'Find changesets by keywords (author, files, the commit message), revision + number or hash, or revset expression.' diff -r cb5123eff7d1 -r 2d93d2159e30 mercurial/templates/gitweb/search.tmpl --- a/mercurial/templates/gitweb/search.tmpl Fri Jun 09 13:45:36 2017 -0700 +++ b/mercurial/templates/gitweb/search.tmpl Fri Jun 09 13:55:51 2017 -0700 @@ -10,10 +10,10 @@
searching for {query|escape}
diff -r cb5123eff7d1 -r 2d93d2159e30 mercurial/templates/gitweb/shortlog.tmpl --- a/mercurial/templates/gitweb/shortlog.tmpl Fri Jun 09 13:45:36 2017 -0700 +++ b/mercurial/templates/gitweb/shortlog.tmpl Fri Jun 09 13:55:51 2017 -0700 @@ -10,10 +10,10 @@
 
diff -r cb5123eff7d1 -r 2d93d2159e30 mercurial/templates/gitweb/summary.tmpl --- a/mercurial/templates/gitweb/summary.tmpl Fri Jun 09 13:45:36 2017 -0700 +++ b/mercurial/templates/gitweb/summary.tmpl Fri Jun 09 13:55:51 2017 -0700 @@ -10,10 +10,10 @@
 
diff -r cb5123eff7d1 -r 2d93d2159e30 mercurial/templates/gitweb/tags.tmpl --- a/mercurial/templates/gitweb/tags.tmpl Fri Jun 09 13:45:36 2017 -0700 +++ b/mercurial/templates/gitweb/tags.tmpl Fri Jun 09 13:55:51 2017 -0700 @@ -10,10 +10,10 @@
 
diff -r cb5123eff7d1 -r 2d93d2159e30 mercurial/templates/static/style-gitweb.css --- a/mercurial/templates/static/style-gitweb.css Fri Jun 09 13:45:36 2017 -0700 +++ b/mercurial/templates/static/style-gitweb.css Fri Jun 09 13:55:51 2017 -0700 @@ -4,7 +4,12 @@ div.page_header { height:25px; padding:8px; font-size:18px; font-weight:bold; background-color:#d9d8d1; } div.page_header a:visited { color:#0000cc; } div.page_header a:hover { color:#880000; } -div.page_nav { padding:8px; } +div.page_nav { + padding:8px; + display: flex; + justify-content: space-between; + align-items: center; +} div.page_nav a:visited { color:#0000cc; } div.page_path { padding:8px; border:solid #d9d8d1; border-width:0px 0px 1px} div.page_footer { padding:4px 8px; background-color: #d9d8d1; } @@ -52,7 +57,23 @@ div.pre { font-family:monospace; font-size:12px; white-space:pre; } div.diff_info { font-family:monospace; color:#000099; background-color:#edece6; font-style:italic; } div.index_include { border:solid #d9d8d1; border-width:0px 0px 1px; padding:12px 8px; } -div.search { margin:4px 8px; position:absolute; top:56px; right:12px } + +.search { + margin-right: 8px; +} + +div#hint { + position: absolute; + display: none; + width: 250px; + padding: 5px; + background: #ffc; + border: 1px solid yellow; + border-radius: 5px; +} + +#searchform:hover div#hint { display: block; } + tr.thisrev a { color:#999999; text-decoration: none; } tr.thisrev pre { color:#009900; } td.annotate { diff -r cb5123eff7d1 -r 2d93d2159e30 tests/test-hgweb-commands.t --- a/tests/test-hgweb-commands.t Fri Jun 09 13:45:36 2017 -0700 +++ b/tests/test-hgweb-commands.t Fri Jun 09 13:55:51 2017 -0700 @@ -1533,16 +1533,10 @@
 
@@ -1733,16 +1736,10 @@
 
diff -r cb5123eff7d1 -r 2d93d2159e30 tests/test-hgweb-descend-empties.t --- a/tests/test-hgweb-descend-empties.t Fri Jun 09 13:45:36 2017 -0700 +++ b/tests/test-hgweb-descend-empties.t Fri Jun 09 13:55:51 2017 -0700 @@ -405,16 +405,10 @@
/ default tip
diff -r cb5123eff7d1 -r 2d93d2159e30 tests/test-hgweb-symrev.t --- a/tests/test-hgweb-symrev.t Fri Jun 09 13:45:36 2017 -0700 +++ b/tests/test-hgweb-symrev.t Fri Jun 09 13:55:51 2017 -0700 @@ -482,7 +482,7 @@ files | lessmore - | (0)tip
+ | (0)tiplessmore | (0)tip @@ -572,7 +572,7 @@ files | lessmore - | (0)tip
+ | (0)tiplessmore | (0)tip diff -r cb5123eff7d1 -r 2d93d2159e30 tests/test-hgweb.t --- a/tests/test-hgweb.t Fri Jun 09 13:45:36 2017 -0700 +++ b/tests/test-hgweb.t Fri Jun 09 13:55:51 2017 -0700 @@ -340,7 +340,7 @@ $ get-with-headers.py --twice localhost:$HGPORT 'static/style-gitweb.css' - date etag server 200 Script output follows - content-length: 8012 + content-length: 8265 content-type: text/css body { font-family: sans-serif; font-size: 12px; border:solid #d9d8d1; border-width:1px; margin:10px; background: white; color: black; } @@ -349,7 +349,12 @@ div.page_header { height:25px; padding:8px; font-size:18px; font-weight:bold; background-color:#d9d8d1; } div.page_header a:visited { color:#0000cc; } div.page_header a:hover { color:#880000; } - div.page_nav { padding:8px; } + div.page_nav { + padding:8px; + display: flex; + justify-content: space-between; + align-items: center; + } div.page_nav a:visited { color:#0000cc; } div.page_path { padding:8px; border:solid #d9d8d1; border-width:0px 0px 1px} div.page_footer { padding:4px 8px; background-color: #d9d8d1; } @@ -397,7 +402,23 @@ div.pre { font-family:monospace; font-size:12px; white-space:pre; } div.diff_info { font-family:monospace; color:#000099; background-color:#edece6; font-style:italic; } div.index_include { border:solid #d9d8d1; border-width:0px 0px 1px; padding:12px 8px; } - div.search { margin:4px 8px; position:absolute; top:56px; right:12px } + + .search { + margin-right: 8px; + } + + div#hint { + position: absolute; + display: none; + width: 250px; + padding: 5px; + background: #ffc; + border: 1px solid yellow; + border-radius: 5px; + } + + #searchform:hover div#hint { display: block; } + tr.thisrev a { color:#999999; text-decoration: none; } tr.thisrev pre { color:#009900; } td.annotate {