Commit Graph

35 Commits

Author SHA1 Message Date
Gregory Szorc
3816d83a29 hgweb: consolidate search form for paper
AFAICT this was mostly a bunch of copy pasta. The only variation is
some pages defined a "value" attribute. The "query" variable will
just be empty on pages that don't accept it. So let's consolidate
the template and remove the redundancy.
2017-06-09 13:59:13 -07:00
Gregory Szorc
49f189afa0 hgweb: call process_dates() via DOM event listener
All the hgweb templates include mercurial.js in their header. All
the hgweb templates have the same <script> boilerplate to run
process_dates(). This patch factors that function call into
mercurial.js as part of a DOMContentLoaded event listener.
2017-01-10 20:47:48 -08: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
Anton Shestakov
820c8ef46a paper: show branch/tags/bookmarks when diffing (issue3559) 2015-05-15 20:02:41 +08:00
Anton Shestakov
dfeb532e8f hgweb: clearly outline <tr> block in paper/changeset.tmpl
This particular <tr> block should use the style of its neighboring blocks,
otherwise it's easy to think that the closing '</tr>' is missing.
2015-01-10 21:37:42 +08:00
Anton Shestakov
c10914bf05 hgweb: use css margin instead of empty <p> before diffstat table
The <p> elements were used to create an empty space between the diffstat link
and the diffstat table, but they don't have any semantic meaning, so it is
better to use css instead.

Default margins for <p> elements can differ depending on the browser, but
usually the margin is 1em (exceptions are IE 6 and 7 with 14pt, which is
comparable). The css rule sets top margin to 1em.

This change is a "better version" of e028c221db4e, where <p> elements were
simply properly closed.
2015-02-05 20:34:30 +08:00
Anton Shestakov
b80745c666 hgweb: fix diffstat links in paper/changeset.tmpl
'<a .../>foo</a>' syntax is incorrect, since the first tag just "tries" to
close itself and then the actual content follows. It doesn't work, either
because web browsers know better than this or because there should be a
whitespace before /: '<a />'. So for the hgweb users the links looked
normal anyway, but now they are correct in code as well.
2015-01-10 18:00:57 +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
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
9e521b740d paper: remove unused occurence of changelogtag in views
This variably isn't passed to these views and it always renders to empty string
for this reason. Other themes don't have this issue.
2013-08-03 00:34:56 +04:00
Alexander Plavin
af42bd5158 hgweb: make stripes in diffstat with CSS 2013-07-13 18:06:57 +04:00
Alexander Plavin
f6368c5d37 hgweb: add line wrapping switch to file diff and changeset views 2013-07-13 00:57:56 +04:00
Alexander Plavin
a55c9084f3 hgweb: file diff and changesets views behave like file source view
This gives all the benefits introduced before for file source view, namely
code selection without line numbers and correct indents, highlighting line
which is linked to, long lines wrapping.

Implementation strategy is also the same as for file source view: all the
lines are put in a sigle pre tag with span's for each line. Correct line
numbering (same as before this patch) is achieved with nested CSS counters.
2013-07-13 00:57:10 +04:00
Alexander Plavin
4b47b3338d hgweb: toggleDiffstat function instead of showDiffstat and hideDiffstat
This eliminates the need of two almost equal functions, makes the code cleaner.
2013-07-12 16:01:11 +04:00
Pierre-Yves David
6c0cbcf3ba hgweb: remove baseline info from paper template
The user interface introduced in 3ff83729b63f is not considered ready
for prime time yet. The internal code stays in place for custom template
usage. The feature is ultimately wanted and will be re-enabled soon. The
current issue is only related to the visual of the current interface.
2013-02-01 05:40:06 +01:00
Bryan O'Sullivan
a527962b71 tests: update hgweb tests to include breadcrumbs 2013-01-08 16:16:29 -08:00
Weiwen
64b5450a1f hgweb: display diff for a changeset against any parents (issue2810)
During merge of branches, it is useful to compare merge results against
the two parents.  This change adds this support to hgweb.  To specify
which parent to compare to, use rev/12300:12345 where 12300 is a
parent changeset number.  Two links are added to changeset web page so
that one can choose which parent to compare to.
2012-11-12 14:05:39 -08:00
wujek srujek
a8963fc179 hgweb: side-by-side comparison functionality
Adds new web command to the core, ``comparison``, which enables colorful
side-by-side change display, which for some might be much easier to work with
than the standard line diff output. The idea how to implement comes from the
SonicHq extension.
The web interface gets a new link to call the comparison functionality. It lets
users configure the amount of context lines around change blocks, or to show
full files - check help (also in this changeset) for details and defaults. The
setting in hgrc can be overridden by adding ``context=<value>`` to the request
query string. The comparison creates addressable lines, so as to enable sharing
links to specific lines, just as standard diff does.
Incorporates updates to all web related styles.

Known limitations:
* the column diff is done against the first parent, just as the standard diff
* this change allows examining diffs for single files only (as I am not sure if
  examining the whole changeset in this way would be helpful)
* syntax highlighting of the output changes is not performed (enabling the
  highlight extension has no influence on it)
2012-07-08 17:17:02 +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
Mads Kiilerich
8415df7277 tests: use 'hghave serve' to guard tests that requires serve daemon management 2011-11-07 03:24:53 +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
Martin Geisler
4ebded65b3 paper/coal: use fixed width for diffstat +/- link
The plus and minus characters are normally not the same width in a
non-monospace font, and this made the line length change when the
diffstat display was toggled.

The square brackets are not rendered in a monospace font to ensure
that they align with the parenthesis on the same line.
2011-06-14 16:38:34 +02:00
Steven Brown
e159db2556 paper, coal: display diffstat on the changeset page
Displayed in a row of the changeset summary table, underneath the list of
files. When the page is loaded, only the diff summary is displayed. The full
diffstat is only displayed when the [+] link is selected.
2011-06-11 21:24:50 +08: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
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
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
eebee9e8b6 tests: unify test-hgweb-removed 2010-09-26 13:41:32 -05:00