Commit Graph

28 Commits

Author SHA1 Message Date
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
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
3fe68bed3d hgweb: clearly outline <tr> block in gitweb and spartan styles
It's easy to miss the closing </tr> tag when it's not on its own line. Some
neighboring blocks also already use this clearer style.

(In 7e841ecf66c5 I didn't even think grepping for this, but this patch should
now cover every occurrence).
2015-05-10 19:02:14 +08:00
Anton Shestakov
ae61ab9707 hgweb: close <th> properly in spartan/filelogentry.tmpl 2015-01-10 17:44:54 +08:00
Anton Shestakov
fa59efaa89 hgweb: allow viewing diffs against p1 or p2 for merge commits (issue3904)
This adds UI portion of the feature that has resided in mercurial since 2012.
Back then the interface was added together with the code, but was shortly
backed out because it was deemed "not ready". Code, however, stayed.

For the original feature and its implementation, see issue2810 and
3ff83729b63f.

In short, the backed-out interface had two outstanding issues:
1. it was introducing an entirely new term (baseline) and
2. it was present on every changeset's page, even for changesets with 1 parent
   (or no parents), which didn't make sense

This patch implements a hopefully better interface because:
1. it uses the usual terms (diff) and
2. it only shows up when there actually are 2 parents.
2015-01-03 17:50:21 +08:00
FUJIWARA Katsunori
4ea3569fd2 hgweb: align entries in "changelog" and "revisions" pages of "spartan" style
Before this patch, each log entries in "changelog" and "revisions"
pages of "spartan" style are not aligned by column, because:

  - each log entries are separated "<table>" entries, and
  - there are no fixed "width" information for each "<th>"/"<td>" entries

This patch aligns entries in "changelog" and "revisions" pages of
"spartan" style by:

  - adding 'label' class to '<th>' for 'age' information, and
  - setting 'width' of '<th class="label">' with fixed size

'class="age"' is not used for this purpose, because it is also used to
set "bold" font-weight

"16em" seems to be wide enough to show date information fully, when
web browser disables (or doesn't support) javascript.
2014-04-17 09:36:09 +09:00
Takumi IINO
95ecbefdae hgweb: infinite scroll support for monoblue style 2014-01-08 00:47:44 +09:00
Angel Ezquerra
e25f843231 hgweb: apply the websub filter to revision descriptions
In order to use this, add a [websub] section to your configuration and add
websub expressions such as:

italic = s/\b_(\S+)_\b/<i>\1<\/i>/
bold = s/\*\b(\S+)\b\*/<b>\1<\/b>/
issues = s|issue(\d+)|<a href="http://bts.example.org/issue\1">issue\1</a>|i
bugzilla = s!((?:bug|b=|(?=#?\d{4,}))(?:\s*#?)(\d+))!<a href="http://bz.selenic.com/\2">\1</a>!i

This also adds documentation (proofed by Kevin!) to the config help section.
2013-02-09 16:48:21 +01:00
Thomas Arendsen Hein
6ca8967a44 hgweb: urlescape all urls, HTML escape repo/tag/branch/... names
Without this, repository paths or names containing e.g. & characters or html
tags yielded strange results, possibly allowing cross-site scripting attacks.
2013-02-01 20:43:35 +01:00
Angel Ezquerra
39f2a199fb hgweb, spartan: link from manifest title to changeset page 2012-12-21 02:41:07 +01:00
Angel Ezquerra
75eabcc2b2 hgweb, spartan: add "URL breadcrumbs"
This change adds a "URL breadcrumb"  to the "title" of the pages on the spartan
template. By title I mean the first line that is shown right below the page
selection row, which shows the name of the page that is being viewed, along with
some additional information.

In doing so it standarizes those "titles" which now follow the pattern:

URL breadcumb / page details
2012-12-21 02:40:12 +01:00
Angel Ezquerra
feab81183f hgweb: add a "URL breadcrumb" to the index and repository pages
The purpose of this change is to make it much easier to navigate up the
repository tree when the hg web server is used to serve more than one
repository.

A "URL breadcrumb" is a path where each of the path items can be clicked to go
to the corresponding path page.

This lets you go up the folder hierarchy very quickly. For example, when showing
the list of repositories in http://myserver/myteams/myprojects, the following
"breadcrumb" will be shown:

Mercurial > myteams > myprojects

Clicking on "myprojects" reloads the page. Clicking on "myteams" goes up one
folder. Clicking on the leftmost "Mercurial" goes to the server root.

This "breadcrumb" also appears on all repository pages. For example on the
summary page of the repository at http://myserver/myteams/myprojects/myrepo the
following will be shown:

Mercurial > myteams > myprojects > myrepo / summary

This change has been applied to all templates that already had a link to the
main repository page (i.e. gitweb, monoblue, paper and coal) plus to the index
page of the spartan template.

In order to make the breadcumb links stand out the some of the template styles
have been customized.
2012-11-28 20:21:26 +01:00
Tim Delaney
0872da322b hgweb: fix incorrect graph padding calculation (issue3626)
hgweb has an incorrect padding calculation, causing the text to move further
away from the graph the more branches there are (issue3626). This patch fixes
all existing templates (gitweb, monoblue, paper and spartan).

Tests updated by Patrick Mezard <patrick@mezard.eu>
2012-09-17 21:33:16 +02:00
Mads Kiilerich
88105479b7 hgweb: avoid bad $$ processing in graph (issue3601)
JavaScript .replace always magically processed $$ $& $' $` in replacement
strings and thus displayed subject lines incorrectly in the graph view.

Instead of regexps and .replace we now just create the strings the right way in
the first place.
2012-08-29 02:09:43 +02:00
Patrick Mezard
23fea18b90 templates: move Graph.edge() implementation in mercurial.js
All implementation in graph.tmpl are the same. It can still be overriden if
necessary. There is no clear reason to keep it separated from mercurial.js.
2012-02-17 16:49:43 +01:00
Brodie Rao
aabbd72d18 hgweb: fix dynamic date calculation not working under Safari
While Chrome, Firefox, and IE 6+ support the current date format being
passed to Date(), Safari doesn't:

> new Date('Mon Oct 24 13:58:01 2011 +0200')
  Invalid Date

However, the rfc822date format--officially supported by
ECMAScript[1]--does work:

> new Date('Mon, 24 Oct 2011 13:58:01 +0200')
  Mon Oct 24 2011 04:58:01 GMT-0700 (PDT)

This change replaces all instances of {date|date} in HTML with
{date|rfc822date}. For elements that only have the "age" class,
there's no outward change for users with JavaScript enabled. For
elements with both the "age" and "date" classes, the full date
displayed uses the new format.

Tested in IE 6, Safari 5.1.1, Google Chrome 15, and Firefox 7.0.1.

[1]: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date/parse
2011-10-27 11:57:08 -07:00
Angel Ezquerra
9f2d3a19a5 hgweb: add a "web/logoimg" setting to customize the web logo image
This change complements the existing web/logourl setting, and lets the user
customize the logo image that is shown on many of the hg server pages.

If this setting is not set, hglogo.png is used.
2011-07-21 15:10:16 +02:00
Benoit Allard
1f65749729 web: Made elapsed time calculation dynamic (javascript).
This allow safe caching of the pages by the browser and still display the right
amount of elapsed time upon page refresh.

If javascript is disabled, absolute time is displayed, leaving it readable.

All the templates have been updated.
2011-04-28 17:02:39 +02:00
Steven Stallion
239482dbab hgweb: support alternate logo url
Clicking on the logo image/text in the hgweb interface brings the
user to the Mercurial project page. The majority of users expect that
this would bring them to the top level index. I have added a new template
variable named `logourl' which allows an administrator to change this
behavior. To stay compatible with existing behavior, `logourl' will
default to http://mercurial.selenic.com/. This change is very useful in
large installations where jumping to the index is common.
2011-04-19 23:37:06 -04:00
Dirkjan Ochtman
a6534a6498 templates: widen the graph canvas (issue2683) 2011-03-13 14:26:32 +01:00
Pradeepkumar Gayam
226f2a834c templates: fix inconsistency in 'help' link 2010-10-26 02:38:14 +05:30
Augie Fackler
954949fd67 hgweb: add help link to templates missed in 333983876439 2010-10-09 17:58:48 -05:00
Matt Mackall
240dfb4940 templates: escape javascript braces 2010-04-05 15:25:08 -05:00
Dan Villiom Podlaski Christiansen
aa6c457f70 templates: rename `Last change' column in hgwebdir repository list.
This patch changes column headers in the templates that previously
said `Last change' to `Last modified'. Neither code nor functionality
are changed other than that.

For some time now, I have been annoyed by the fact the `Last change'
column didn't list the age of the youngest changeset in the
repository, or at least tip. It just occurred to me that this is
because the wording is slightly misleading; what the column in fact
lists is when the repository was last *modified*, that is, when
changesets was last added or removed from it.

The word `change' can be understood as referring to the changeset
itself. Using `changed' would be ever so slightly less
amigous. However, the standard nomenclature in this case is
`modification date' and `Last modified', which is incidentally entirely
unambigous. Hence, `Last modified' is the wording used.
2010-01-24 20:51:53 +01:00
Martin Geisler
5971430b4b Merge with stable 2010-01-23 16:55:46 +01:00
Nicolas Dumazet
9e7e6b1598 hgweb: changenav: separate pages before and after the current position
This should allow styles to customize more precisely navigation bar,
for example inserting a cursor to show where we are in the navigation bar.
2010-01-16 02:33:06 +01:00
Dan Villiom Podlaski Christiansen
238d382291 setup: install translation files as package data
Remove the `install_package_data' subclass of `install_data' and use
the `package_data' functionality provided by distutils instead. As
package data must be located within the package directory, the data
files are now generated in the build directory.

To simplify the functionality of this change, the top-level `doc' and
`templates' directories have been moved into the `mercurial' package
directory.
2009-12-01 16:06:10 +01:00