Commit Graph

41 Commits

Author SHA1 Message Date
Anton Shestakov
9f3a77930a hgweb: generate last change date for an empty atom-bookmarks feed (issue5022)
RFC 4287 states that atom feeds must have an <updated> element, so let's add
one even when repo doesn't have a single bookmark.
2016-03-31 15:37:21 +08:00
Anton Shestakov
0741a98a71 hgweb: sort bookmarks early
Let's do the same thing that /tags page does. It gets sorted tags and then if
it needs the latest only, it just slices the first item from the list. Since
it's a slice and not a min(), it doesn't throw an exception if the list is
empty. This fixes HTTP 500 error from issue5022.
2016-03-31 14:23:27 +08:00
FUJIWARA Katsunori
cd5e04a455 templates: use canvaswidth instead of fixed width for canvas (issue2683)
Before this patch, template files for "graph" web page use fixed width
size "480" for canvas element.

This causes pruned lanes and invisible vertexes, if there are 16 or
more vertical lanes at once. In such case, part of graph in right side
area over 480 is invisible, even though corresponded summary text
blocks are visible correctly.

This limitation isn't reasonable for workflow using many branches at
once (e.g. "one branch per issue" workflow).

There were changes below related to width of canvas:

  - 6c855f5350cd (templates: widen the graph canvas (issue2683)),
    released as a part of Mercurial 1.8.2

    According to the description, this assumed that 15 parallel
    branches was enough for ordinary workflow, and bumped width of
    canvas up from 224 to 480.

  - f5506d2a674c (hgweb: make graph data suitable for template usage),
    released as a part of Mercurial 2.3

    This introduced "canvaswidth" template keyword as a part of
    refactoring around graph rendering.

    But 'width="480"' of canvas element in template files wasn't
    replaced by 'width="{canvaswidth}"' in it (or subsequent one).

This patch uses dynamic value "{canvaswidth}" instead of fixed width
size "480" for canvas element.

This is posted for "stable", because:

  - this is re-fixing issue2683

  - this is simple enough for stable

  - using "{canvaswidth}" doesn't require any additional cost

    Calculation of canvaswidth is already implied as a part of "graph"
    web command.
2016-01-21 02:42:01 +09:00
Matt Mackall
5e1b4ad958 urls: bulk-change primary website URLs 2015-09-30 15:43:49 -05: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
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
Matt Mackall
3ad28905f6 tests: drop explicit $TESTDIR from executables
$TESTDIR is added to the path, so this is superfluous. Also,
inconsistent use of quotes means we might have broken on tests with
paths containing spaces.
2015-06-08 14:44:30 -05:00
Yuya Nishihara
fe4df27bf6 hgweb: bring back infinite scroll in shortlog of paper style
Since e902e55c3d0b, column headers are wrapped by <thead> element, so the first
and only <tbody> contains changelog data. I got the following error without
this patch:

    Uncaught TypeError: Cannot read property 'lastElementChild' of null
      scrollHandler @ mercurial.js:375
2015-05-07 07:46:39 +09:00
Anton Shestakov
48ec2b2e8f hgweb: replace implicit <tbody> with explicit <thead> where appropriate
Some templates in paper style use <tbody> elements inside <table> to assign a
class to "body" part of that table (in this case, to make rows striped). The
problem is that the <tbody> is preceded by <tr> element, which browsers
understand as an implicit start of table body, so the following exlicit <tbody>
will actually be "nested", which is not valid.

Since that first <tr> contains table headers, wrapping it in <thead> is both
semantically correct and follows the advertised XHTML 1.1 doctype.
2015-02-06 15:52:55 +08:00
Anton Shestakov
cfdab04e6f hgweb: use css margin instead of empty <p> before <div class="atom-logo">
The <p> elements were used to create an empty space between the last menu item
(i.e. "help") and the atom feed icon, but they don't have any semantic meaning,
so it is better to use css instead.

The css rule uses top margin of 10px, which is equal to the top margin of the
menu blocks ("help", "changeset, browse", etc). Previously, with <p> elements,
the margin wasn't set explicitly and was browser-dependent.

This change is a "better version" of e028c221db4e, where <p> elements were
simply properly closed.
2015-02-05 19:24:35 +08:00
Anton Shestakov
298df6419f hgweb: close <img> elements
Templates declare xhtml doctype, which means, in particular, that the document
must also be valid xml. So <img> elements must be closed.
2015-01-10 17:54:24 +08:00
Anton Shestakov
83e4d2ac53 hgweb: close <p> elements
<p> elements can only contain inline elements, so as soon as browser encounters
a block element (e.g. block <div>) "inside" a <p>, it puts an implicit </p>.
It's better to do this explicitly.
2015-01-10 17:52:02 +08:00
Matt Mackall
11be5cc27c tests: replace exit 80 with #require 2014-08-06 11:43:59 -05:00
Takumi IINO
db72b3b5e8 hgweb: avoid invalid infinity scroll request when overwritten web.style
Infinity scroll is broken when you override the web.style in the following ways:

    $ hg --config='web.style=gitweb' serve
    $ open http://localhost:8080/shortlog?style=paper

ajaxScrollInit should use http://localhost:8080/shortlog/%next%?style=paper.
however, http://localhost:8080/shortlog/%next% is used actually.
It is missing style parameter.

This patch add style parameter to request url.
2014-01-08 00:35:03 +09:00
Alexander Plavin
8495f525a8 paper: edit search hint to include new feature description 2013-09-06 13:30:57 +04:00
Alexander Plavin
e94f8da7af paper: define searchhint message in map file and use it in other templates 2013-07-25 01:12:25 +04:00
Alexander Plavin
7837b6944a paper: add infinite scrolling to graph by calling ajaxScrollInit at the page 2013-09-22 14:19:57 +04:00
Alexander Plavin
f0c93d06c2 hgweb: make infinite scroll handling more generic and extensible
Namely, this allows the next page pointer to be not only revision hash given
in page code, but also any value computed from the value for previous page.
2013-09-22 14:18:23 +04:00
Alexander Plavin
fb413116b4 paper: call ajaxScrollInit in shortlog
This just calls ajaxScrollInit at the shortlog page template with all needed
agruments. So, infinite scrolling is working now there.
2013-09-06 13:30:57 +04:00
Alexander Plavin
d54d02c21a hgweb: make stripes in graph with CSS 2013-07-13 18:02:34 +04:00
Alexander Plavin
b7eaff030b hgweb: make stripes in log and search with CSS 2013-07-13 17:59:00 +04:00
Alexander Plavin
d32de28413 hgweb: make stripes in directory view with CSS 2013-07-13 17:44:46 +04:00
Alexander Plavin
b84ced8343 hgweb: show current search query in the input field 2013-07-11 17:01:54 +04:00
Pierre-Yves David
f362d20bef hgweb: fix empty navigation detection
For some obscure reason, changelog.node(0) returns nullid if changelog is empty.
this break empty navigation detection. We fix this code by using the length of
the changelog.

Using the length have some issue with revision filtering but this is a small
step in the right direction. Proper fix comes in later changeset.
2013-04-30 15:11:12 +02:00
Bryan O'Sullivan
a527962b71 tests: update hgweb tests to include breadcrumbs 2013-01-08 16:16:29 -08:00
Angel Ezquerra
4108217b64 hgweb: add (Atom) subscribe link to the main paper template pages
The subscribe link is found at the bottom of the navigation sidebar.
This uses a free icon from http://feedicons.com.
2012-12-04 00:41:29 +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
Mads Kiilerich
1fda0b1af1 tests: prepare get-with-headers.py for MSYS
get-with-headers.py took the http GET parameter as a command line parameter
that had to start with '/'. MSYS on windows will mangle such paths.

Instead of applying a workaround everywhere (such as an extra '/') we let
get-with-headers.py add the mandatory '/'. That is consistent with the
url path handling in the Mercurial url class.

A few tests sent 'GET ?cmd=...' which is invalid. They will now send 'GET
/?cmd=...'.

This will not enable any tests for being run on windows - only remove one
reason they were disabled.
2012-06-21 03:05:02 +02:00
Mads Kiilerich
fa1c4e5ebe tests: add missing trailing 'cd ..'
Many tests didn't change back from subdirectories at the end of the tests ...
and they don't have to. The missing 'cd ..' could always be added when another
test case is added to the test file.

This change do that tests (99.5%) consistently end up in $TESTDIR where they
started, thus making it simpler to extend them or move them around.
2012-06-11 01:40:51 +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
Mads Kiilerich
8415df7277 tests: use 'hghave serve' to guard tests that requires serve daemon management 2011-11-07 03:24:53 +01:00
Matt Mackall
b63b8d693b hgweb: properly check for bookmarks when drawing graph 2011-09-08 18:29:53 -05: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
Dirkjan Ochtman
d961fbf4ea tests: fix failures introduced in 6c855f5350cd 2011-03-13 15:59:24 +01:00
Alexander Solovyov
84912d6eaf hgweb: add separate page with bookmarks listing 2011-03-12 11:20:03 +01:00
Alexander Solovyov
e67bfa95ac hgweb: add display of bookmarks for changelog and changeset 2011-03-12 11:19:44 +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
Augie Fackler
1978da6b24 web: add a help view for getting hg help output 2010-10-09 12:27:14 -05:00
Matt Mackall
fc835388a9 tests: unify test-hgweb-empty 2010-09-26 13:41:32 -05:00