Commit Graph

286 Commits

Author SHA1 Message Date
Gijs Kruitbosch
5b5d0b9759 hgweb: fix border-radius for standards-based browsers
While here, remove an old gecko-specific property, as gecko has
supported the unprefixed version for many years.
2015-10-07 20:19:20 +01:00
Matt Mackall
5e1b4ad958 urls: bulk-change primary website URLs 2015-09-30 15:43:49 -05:00
Anton Shestakov
22d1cd552d monoblue: provide links to branches, tags and bookmarks by name
This is adapted from 635285e0a942, that was added to paper for 3.5 release.

It adds another way to refer to branches, tags and bookmarks in urls: by name.
It's still possible to navigate to a specific changeset hash, but now you can
get more descriptive urls straight from /summary page, for example.

branchentry template (and so the whole branches table on /summary and
/branches) lost the column that had a plain changeset hash, because tags and
bookmarks don't have this column and also because there is already a way to
address branch by its changeset hash (changeset link just next to it). Maybe we
can instead bring this column with a plain changeset hash to tags and
bookmarks, but this, more terse, new look feels fine.
2015-09-26 17:24:12 +08:00
Anton Shestakov
c3abc3de29 gitweb: provide links to branches, tags and bookmarks by name
This is adapted from 635285e0a942, that was added to paper for 3.5 release.

It adds another way to refer to branches, tags and bookmarks in urls: by name.
It's still possible to navigate to a specific changeset hash, but now you can
get more descriptive urls straight from /summary page, for example.

branchentry template (and so the whole branches table on /summary and
/branches) lost the column that had a plain changeset hash, because tags and
bookmarks don't have this column and also because there is already a way to
address branch by its changeset hash (changeset link just next to it). Maybe we
can instead bring this column with a plain changeset hash to tags and
bookmarks, but this, more terse, new look feels fine.
2015-09-26 17:15:58 +08:00
Anton Shestakov
e295b5a51b gitweb, monoblue: port highlighting linked lines from paper
This is adapted from a9c9f5ef6abf, 38b0132204f4 and 1555d017cac7.
2015-09-25 12:38:20 +08:00
Anton Shestakov
9643ca35f2 gitweb, monoblue: fix vertical align of spans in .sourcelines
Empty lines in file view could produce an inexplicable margin before the next
line (most noticeable in browsers on webkit/blink engine). That was making
empty lines seem taller than the rest.

Instead of using default vertical align, let's set it to 'top'.

This issue is actually present in paper, and only recently got into gitweb
(0609781075c1) and monoblue (b7a7757577fb). There's a bit more to it in paper,
so that will be dealt with in a future patch.

Recipe to see live: preferably using a webkit/blink browser, such as chromium,
browse a file with empty lines, e.g. https://selenic.com/hg/file/3.5/README#l8
Selecting a block of text that includes empty lines will reveal white "breaks"
in the selection. Highlighted line (#l8) also shows such a break below itself.
2015-09-25 03:02:38 +08:00
Anton Shestakov
386f39d602 monoblue: port code selection without line numbers from gitweb
This is adapted from 0609781075c1.

It also fixes issue4790 in monoblue; tab characters now have meaningful width on
the modified pages (file view, file diff, changeset).
2015-09-23 16:02:35 +08:00
Anton Shestakov
de245a8121 gitweb: port code selection without line numbers from paper
This is adapted from a46863946982 and 8d7bff75072d.

It also fixes issue4790 in gitweb; tab characters now have meaningful width on
the modified pages (file view, file diff, changeset).
2015-09-22 02:09:10 +08:00
Anton Shestakov
4de10bfe5d coal: reuse style-paper.css and use a separate css file for visual tweaks
To remove another big chunk of duplication from coal hgweb style, we can move
all visual tweaks to style-extra-coal.css and include it together with
style-paper.css.
2015-09-18 14:03:32 +08:00
Anton Shestakov
e8f1879f80 coal: reuse all templates from paper/map by %including the file
Before, coal/map simply had all the templates copied and pasted from paper/map
file. It was easy to make a change to paper that would get into coal only
partially and just sit there until something like 216a95e6094f happened.

Let's remove this duplication from coal/map by using %include to reuse
templates from paper/map directly.
2015-09-18 01:06:27 +08:00
Anton Shestakov
a80c2de885 gitweb: add author to filelogentry
The line is copied from shortlogentry template.
2015-09-18 14:24:53 +08:00
Anton Shestakov
66ab769443 monoblue: add author to filelogentry
The line is copied from shortlogentry template.
2015-09-18 14:24:38 +08:00
Anton Shestakov
b1908a7d13 monoblue: split a long line in filelogentry template
The whole td has a nowrap class, which disallows breaking the line, so it's not
required to use non-breakable spaces.
2015-09-18 14:23:44 +08:00
Anton Shestakov
d1c17dc442 hgweb: replace .sourcelast with .bottomline that does the same
In paper and Coal, basically, div.sourcelast was only used to make a 1px border
on the bottom of file source view (and only there). It's better to use
bottomline class, that also exists for the same purpose (visually), but is used
more widely and works without needing an empty <div>.
2015-09-14 18:41:09 +08:00
Anton Shestakov
166a086d20 coal: copy newer things from paper
Basically, coal style in hgweb is intended to be functionally equivalent (just
different in style) to paper, and does this by reusing almost all templates
from paper (except header.tmpl, where it specifies a different css file). Looks
like everybody forgot this and so many improvements to paper templates, that
should've also made it into coal, were often only half-done there (usually
thanks to template reuse). Let's fix this by bulk-copying missing things from
paper/map and style-paper.css to coal/map and style-coal.css.

There were many improvements to paper that didn't touch coal, and that makes it
hard to untangle the code and split this patch into many, but here are some of
the changes (paper-only), that now get into coal:

a9c9f5ef6abf - hgweb: color line which is linked to in file source view
1555d017cac7 - hgweb: highlight line which is linked to at annotate view
a46863946982 - hgweb: code selection without line numbers in file source view
636594df4244 - hgweb: add line wrapping switch to file source view
cc6bee069ce6 - hgweb: use css margin instead of empty <p> before diffstat table

It also fixes line anchor in annotateline template (#42 vs #l42).
2015-09-13 21:01:34 +08:00
Matt Mackall
5b498724ca templater: add new docheader/footer components for XML (issue4135)
The existing header/footer components were templated per-changeset,
and thus couldn't be correctly printed for an empty log
2015-08-26 16:27:14 -05:00
Matt Mackall
78dbeac869 merge with stable 2015-09-03 18:32:17 -05:00
Anton Shestakov
4a776abb59 monoblue: fix page subtitle on help pages 2015-09-03 22:25:16 +08:00
Anton Shestakov
172281a2a9 monoblue: add a margin for help text container 2015-09-04 02:51:57 +08:00
Anton Shestakov
4133df384f gitweb: add a margin for help text container 2015-09-03 23:46:31 +08:00
Anton Shestakov
6076d5ac3f monoblue: add archive links on summary page 2015-08-19 21:43:13 +08:00
Anton Shestakov
e2a7644272 monoblue: link to branches on summary page
"Tags" and "Bookmarks" sections on this page already have the similar links,
and so does the "Branches" on summary page in gitweb, so let's do the same in
monoblue.
2015-07-26 18:05:10 +08:00
Anton Shestakov
4547637785 monoblue: fix branches link on help topics page 2015-07-26 17:18:42 +08:00
Anton Shestakov
2bbb11440f hgweb: show ages in repos' Last modified column in monoblue and gitweb
Index page, which shows the list of available repositories, has a column where
the last modification date for each repo is shown. paper, coal and spartan
already show the dates in relative format (e.g. "2 weeks ago"), because these
styles have the required process_dates() js function call in their footer
templates, which are included on every page. But monoblue and gitweb styles
have more things in the footer templates, such as repo name and its atom/rss
links, so they don't include the footer on index page (as this page doesn't
have a single repo context).

Let's call process_dates() without including the footer.
2015-07-26 00:11:23 +08:00
Anton Shestakov
00364f383f monoblue: show relative age of bookmarks
In 064b658181dd, age calculation was made dynamic (i.e. in javascript), but for
some reason bookmarkentry template in monoblue/map got a wrong class. It
resulted in /summary and /bookmarks pages always showing exact dates for
bookmarks, no age calculation was performed. Let's fix this by using "age"
class that is already used in branchentry and tagentry templates in the same
map file.

As usual, the exact date for such elements is still available in title
attribute, so it shows in a tooltip on hover.
2015-07-13 13:13:17 +08:00
Anton Shestakov
69b6eb9543 monoblue: remove duplicate font-family property from td.source 2015-08-11 13:48:57 +08:00
Anton Shestakov
23dddb305b monoblue: remove unused elements and related css
Since f9c487618909 and 9d5bd0e29076, when monoblue was introduced, the code
this patch removes was untouched. Presumably, there supposed to be nice
graphics in the screen corners, but there never were due to:

- the css being commented out
- ids of the elements and of the css selectors being different
- and the png files absent

The "corner" elements were unstyled and didn't affect the rest of the page, so
I think it's safe to remove all this.
2015-08-11 13:45:54 +08:00
Anton Shestakov
f8c9284f5c spartan: don't drop current revision in log/graph links
Just to be consistent with log and shortlog links, graph links should have a
revision context too. And the same goes for the graph page, where it's log and
shortlog links that should have context.
2015-07-12 01:51:01 +08:00
Anton Shestakov
dc749de111 hgweb: provide links to branches, tags and bookmarks by name (paper and coal)
It's sometimes handy to, say, have a url always point to branch head, not just
at the current branch head by node hash. Previously, this was only possible by
manually editing url and replacing node hash with branch/tag/bookmark name. It
wasn't very convenient, or easy - in case the name contained special
characters that needed to be urlencoded.

Let's have /branches, /tags and /bookmarks pages in paper and coal style
provide links both to symbolic revisions and to node hashes.

This feature was wished for in issue3594.
2015-07-12 18:04:48 +08:00
Anton Shestakov
59afbb0eb8 monoblue: use padding instead of position for text in footer
Some installations alter monoblue style and remove margins from body element
(these margins have that dark gray background) to adapt hgweb instance to an
already existing site design. However, the margins hid a quirk in page footer:
a block of text needlessly popped out of the footer, and when margins were
gone, the whole page got a vertical scroll bar because of that.

Live example: https://hg.prosody.im/prosody-modules/

To remove the potential scroll bar, this block of text now uses left padding,
which doesn't make it overflow the footer, but makes it achieve the otherwise
same result visually.
2015-07-06 01:38:37 +08:00
Anton Shestakov
cda29716f9 monoblue: don't try to show repo on hgwebdir index page
Index page shows a list of accessible repositories, it doesn't have a
single-repo context.
2015-07-06 01:22:23 +08:00
Anton Shestakov
ef2faddd7f hgweb: don't try to show repo on repo-not-found page in monoblue 2015-06-30 23:34:12 +08:00
Anton Shestakov
0fef35aa40 hgweb: fix help pages title in gitweb and monoblue
Help pages in gitweb and monoblue were setting a completely inappropriate
title: "Branches". Let's have a proper title (copy-pasted from paper style).
2015-06-30 23:31:19 +08:00
Anton Shestakov
749eb6196d hgweb: don't show summary link as active on error pages in monoblue
These two error pages in monoblue think they are the summary page, when they
clearly aren't.
2015-06-30 22:15:58 +08:00
Anton Shestakov
f9942be78e hgweb: use css for stripey background in coal
Since "fd4945970469 or b7c98f01667e::be1d0b03b11a" paper style used css for
stripes in background for browsing files, for listing branches/tags/bookmarks,
and so on.

Since coal borrows many paper templates (e.g. shortlogentry.tmpl), it actually
tried to do the same, but it didn't have the needed css classes. You can
compare https://selenic.com/hg?style=coal with
https://selenic.com/hg?style=paper and see how log view in coal style has plain
white background, unlike the one in paper style. This wasn't intended.

Let's copy css classes directly from style-paper.css and remove parity classes
from elements that don't need them anymore. This makes plain white background
have stripes again and makes coal/map even more similar to paper/map (which can
ease porting changes or %including paper/map in future).
2015-06-25 20:27:36 +08:00
Yuya Nishihara
35e047f889 templates: fix missing closing brace in map-cmdline.status
Currently the parser does not validate the last closing brace, but future
patches will make it less permissive for this kind of syntax errors.
2015-06-18 23:08:27 +09:00
Anton Shestakov
d76c5b8c5a hgweb: link to revision by node hash in paper & coal
Unlike other styles, paper and coal had only one link to current revision: in
the sidebar. Since those links now use symbolic revisions after 4b263b99440b,
it's nice to have a link that allows going from /rev/tip to /rev/<tip hash>,
for instance. Let's make the node hash in the page header that new link.
2015-06-18 17:06:18 +08:00
Anton Shestakov
fa79758539 hgweb: link to revision by node hash in gitweb & monoblue
This allows going from /rev/tip to /rev/<tip hash> with ease.
2015-06-18 16:14:10 +08:00
Anton Shestakov
eb4bfc238e hgweb: don't dereference symbolic revision in paper & coal style (issue2296)
Let's make paper (and coal, since it borrows so much from paper) templates use
symbolic revision in navigation links.

The majority of links (log, filelog, annotate, etc) still use node hashes.

Some pages don't have permanent links to current node hash (so it's not very
easy to go from /rev/tip to /rev/<tip hash>), this will be addressed in future
patches.
2015-06-16 16:07:39 +08:00
Anton Shestakov
1ae5a3b17f hgweb: don't dereference symbolic revision in gitweb style
Let's make gitweb templates use symbolic revision in navigation links.

The majority of links (log, filelog, annotate, etc) still use node hashes.

Some pages don't have permanent links to current node hash (so it's not very
easy to go from /rev/tip to /rev/<tip hash>), this will be addressed in future
patches.
2015-06-16 14:37:53 +08:00
Anton Shestakov
8daea28f61 hgweb: don't dereference symbolic revision in monoblue style
Let's make monoblue templates use symbolic revision in navigation links.

The majority of links (log, filelog, annotate, etc) still use node hashes.

Some pages don't have permanent links to current node hash (so it's not very
easy to go from /rev/tip to /rev/<tip hash>), this will be addressed in future
patches.
2015-06-16 13:59:49 +08:00
Anton Shestakov
781227ef89 hgweb: don't dereference symbolic revision in spartan style
Let's make spartan templates use symbolic revision in navigation links.

The majority of links (log, filelog, annotate, etc) still use node hashes, and
many pages also have permanent link to current node hash (i.e. you can go from
/rev/tip to /rev/<tip hash> without manual url editing), so it's safe to
update navigation.
2015-06-16 11:52:10 +08:00
Anton Shestakov
ad43ca849f hgweb: don't point file links at tip hash where it doesn't make sense
Some pages, e.g. bookmarks, help and summary don't have a meaningful revision
context: they always either show information about tip or about the whole repo
(and not about any specific changeset). And error pages can just show hgweb
error messages, not related to any repo or changeset.

Having a hash in the links worked (even when '{node|short}' resolved to an
empty string on error pages), but seeing pages without revision context provide
links with hashes is a bit confusing (unless you keep current tip hash in your
head at all times) and not consistent with other template styles and other
links on the same page: they don't have a hash.

Let's just link to '/file', which is equal to '/file/tip'.
2015-06-12 18:34:10 +08:00
Anton Shestakov
4687d63f4f hgweb: don't point graph links at tip hash where it doesn't make sense
Some pages, e.g. bookmarks, help and summary don't have a meaningful revision
context: they always either show information about tip or about the whole repo
(and not about any specific changeset). And error pages can just show hgweb
error messages, not related to any repo or changeset.

When monoblue style was added in f9c487618909, however, all graph links had
tried to point at some hash, and on such pages as described above it didn't
make sense. On error pages '{node|short}' is empty string anyway.

Of course, it worked, but seeing such pages without revision context provide
links with hashes is a bit confusing (unless you keep current tip hash in your
head at all times) and wasn't consistent with other template styles, other
pages in monoblue and even other links on the same page.

Let's just link to '/graph', which is equal to '/graph/tip'.
2015-06-12 16:09:59 +08:00
Anton Shestakov
f6202490e9 hgweb: put help link in paper/search.tmpl separately for consistency
Just a cosmetic markup change, no .css changes required.
2015-06-12 15:29:12 +08:00
Matt Mackall
affc570ed5 templates: add a default template style for status
Color doesn't work yet, so no labels here.
2015-06-10 14:35:05 -05:00
Anton Shestakov
92450420bb hgweb: descend empty directories in monoblue
The ability to "skip" a chain of empty directories in hgweb was added in
5c045b277096, but monoblue style wasn't updated.

This block is copied from gitweb/map file and just works.
2015-05-21 19:52:36 +08:00
Anton Shestakov
8f816680f5 hgweb: remove artificial width constraint from header in monoblue
This width property comes from the beginning of the monoblue theme itself, and
was used to stop the action header ("summary", "shortlog", "changelog", etc)
from clashing with the search form. But it still was happening (on smaller
screens, and with more actions added to hgweb over time).

Effectively, the hardcoded width was preventing the header from fitting into
the available screen space, since it always tried to be 900px wide, even if
that meant horizontal scroll on smaller screens and having the actions on two
lines where one should've been enough. For example,
http://selenic.com/hg/log?style=monoblue has the last two actions ("gz" and
"help") in the header on the second line, even when there seems to be enough
space on the first.

This patch makes the form float, which prevents it from overlaying/clashing
with the action header, and allows the latter to resize itself in the best
possible way.
2015-05-21 00:27:12 +08:00
Anton Shestakov
4451d363dd paper: show branch/tags/bookmarks when blaming (issue3559) 2015-05-15 20:04:24 +08:00
Anton Shestakov
fba3cc6630 paper: show branch/tags/bookmarks when comparing (issue3559) 2015-05-15 20:03:42 +08:00