Commit graph

49 commits

Author SHA1 Message Date
Tom Hughes
47e6637f18 Fix rubocop warnings 2016-08-16 19:27:14 +01:00
Florian Schäfer
3251cdf5d6 Added fixes for rubocop complaints 2016-07-14 15:22:52 +02:00
Florian M. Schäfer
10cde3bb92 Link the prefixed wikidata-tags to wikidata.org
With this commit, the prefixed wikidata-tags get linked to the
corresponding wikidata.org-page in the current interface-language.

Multiple semicolon-separated wikidata-IDs are shown as multiple
semicolon-separated links to wikidata.

This commit contains also some tests for those links.
2016-07-14 15:22:52 +02:00
Simon Legner
6f144e8b7d Show ref of object when no name is present 2016-03-09 18:47:54 +00:00
Tom Hughes
8fe1899596 Fix rubocop warnings 2016-01-19 09:51:24 +00:00
Tom Hughes
18b8fc60bb Add rel=nofollow to links to tagless nodes in browse pages 2015-12-20 00:19:16 +00:00
Tom Hughes
c9d35839be Fix new rubocopy warnings 2015-08-18 20:57:14 +01:00
Tom Hughes
ca213b873f More improvements to mediawiki fragment escaping
It turns out that the PHP urlencode encodes more characters than
the ruby URI.encode does by default, so specify our own characters
to encode based on http://php.net/manual/en/function.urlencode.php
with the extra exclusion of colon, which the mediawiki code reverses
after the encoding is done.

Fixes #967
2015-05-15 15:34:12 +01:00
Tom Hughes
b40353b9b0 Escape fragment identifiers in wikipedia URLs
Fixes #967
2015-05-14 20:34:25 +01:00
Tom Hughes
2af0840ff3 Fix style issues found by new rubocop version 2015-04-14 09:38:24 +01:00
Tom Hughes
8e404f3a46 Fix some more rubocop style issues 2015-02-20 20:39:52 +00:00
Tom Hughes
dc2a2c8ebd Standardise on double quoted strings 2015-02-20 19:47:26 +00:00
Tom Hughes
5cbd4038ed Fix rubocop style issues 2015-02-20 08:56:16 +00:00
Tom Hughes
ef7f3d800c Fix most auto-correctable rubocop issues 2015-02-20 08:56:16 +00:00
Tom Hughes
c53db246f6 Merge branch 'rails41' 2014-07-21 08:53:44 +01:00
Florian M. Schäfer
7764f6fc28 Added wikidata links to the browse helper
Analogous to wikipedia tags this links any wikidata tag with its item
page on wikidata.

For now it's restricted to the plain wikidata=* tag (namespaces like
operator:wikidata=* and similar are not yet supported) and only accepts
the values with the format Q<number>.
2014-07-20 15:02:01 +01:00
Tom Hughes
88ff6496a1 Sort tags alphabetically for consistent results 2014-07-04 19:24:25 +01:00
Štefan Baebler
75e07dc5b8 Added telephone links into tag detail browser
International phone numbers become links using the official URI scheme
as per http://tools.ietf.org/html/rfc3966.

It is not limited to key=phone, so it can be used in other keys as well.
2014-06-15 09:31:04 +01:00
Tom Hughes
85e61568da Try harder to find a name in the right language 2014-05-24 12:52:09 +01:00
Tom Hughes
e010a326a8 Wrap the ID in <bdi> tags for RTL locales 2014-05-19 00:29:08 +01:00
Tom Hughes
5da273027f Isolate object names from the database with a <bdi> tag
Fixes #743
2014-05-18 17:24:38 +01:00
Tom Hughes
0de7fdb4df Add more tests for BrowseHelper 2014-03-01 16:02:06 +00:00
João G. Packer
18734786a1 Fixed wikipedia link reference to specific sections
When creating  a wikipedia link from a tag, the function
is (correctly) appending "?userlang=#{I18N.lang}" to the URL,
but doing this breaks the reference to a specific section
of a wikipedia article (if there is any).

For example, if the tag is "wikipedia=Article#Section", the function
would create a link to "../Article#Section?uselang=xx", and then the
browser wouldn't be able to correctly find the section. The correct
link result should be "../Article?uselang=xx#Section".

This commit fixes this by verifying if there is a reference to a
specific section of the article, and then putting "?uselang=#{I18N.lang}"
between the article's name and the section name.
2014-03-01 00:26:37 +00:00
John Firebaugh
e670da54cb Rationalize browse translation keys 2013-11-12 12:51:33 -08:00
John Firebaugh
d8cf49f0d7 Improve pagination in changeset details 2013-11-06 17:28:39 -08:00
Paweł Paprota
067ff20504 Match wikipedia language prefixes case insensitively
Without this values like "PL:Article" are linked to the English Wikipedia.
2012-10-07 16:03:10 +01:00
Paweł Paprota
8688edf992 Don't remove language prefixes from wikipedia tags
Removing the language prefix from the displayed value of a wikipedia
tag is confusing, so don't do it. Fixes trac #4135.
2012-10-07 16:01:50 +01:00
Matt Amos
ecf767ee4f Removed early return from printable name method 2012-04-05 13:53:41 +01:00
Matt Amos
c8d3257fa5 Stop the data browser leaking details of redactions
Altered styling of redacted versions in changeset list so that they
appear deleted and don't leak tag information.
2012-04-05 13:50:22 +01:00
Tom Hughes
9f12d24fbd Leave https wikipedia URLs unmolested 2012-02-06 08:54:10 +00:00
Tom Hughes
607d23f6d6 Fixup some string escaping issues in the data browser 2011-11-14 09:42:55 +00:00
Ævar Arnfjörð Bjarmason
4806913e18 browse_helper: Correctly link to wiki pages whose keys or values contain spaces
The update-wiki-pages script normalizes " " to "_" (since MediaWiki
does it by design), but I didn't normalize it back in the
browse_helper.

Consequently objects with tags like "source=Isle of Man Government
aerial imagery (2001)" were never linked to the wiki correctly.
2010-06-17 13:33:01 +00:00
Dan Karran
af217ca140 More historic and tourist-related icons 2010-06-07 22:43:01 +01:00
Dan Karran
2aae01a590 Add strikethrough style to browser when objects are deleted 2010-06-07 22:43:01 +01:00
Tom Hughes
6e145a2f38 Rename css_class to link_class for consistency 2010-05-16 12:57:00 +01:00
Tom Hughes
6d3aa7386b Only include tags which affect the icon in the link title 2010-05-16 12:55:10 +01:00
Dan Karran
10dca1b6df Patch from bug #2787 to add icons to data browser pages 2010-05-16 12:12:59 +01:00
Tom Hughes
90d2ed759f Fix mangling of wikipedia links
Bail out straight away if the tag value is a URL rather than waiting
until we have parsed the key as we may change the value in the process
of parsing the key.
2010-04-28 18:48:56 +01:00
Tom Hughes
d2585ea044 Tweak wikipedia links stuff 2010-04-22 10:41:53 +01:00
Ævar Arnfjörð Bjarmason
9bfa6059be Link to wikipedia articles on wikipedia=* tags
The semantics are as documented on
http://wiki.openstreetmap.org/wiki/Key:wikipedia, i.e.:

    # English Wikipedia article Foobar
    wikipedia=Foobar
    # German Wikipedia article Foobar
    wikipedia:de=Foobar
    wikipedia=de:Foobar

If someone gives a http:// link we just pass it through.
2010-04-21 01:46:50 +00:00
Tom Hughes
546250f60b Load wiki link data at startup and shorten some file names 2010-04-20 21:05:22 +01:00
Tom Hughes
d6755356e0 Improve the browse helper code use to generate wiki links 2010-04-20 19:04:12 +01:00
Tom Hughes
88aa34f61b Update wiki link style to use the current default format 2010-04-20 14:21:23 +01:00
Ævar Arnfjörð Bjarmason
8eead8a870 Ticket #2245: Link from /browse/* pages to the wiki key/value pages 2010-04-20 12:55:14 +00:00
Ævar Arnfjörð Bjarmason
658a34714f When displaying objects in /browse/* and in the JavaScript "Data"
feature use the name key corresponding to the user's
locale. E.g. "name:is" for Icelandic.

This will fall back on "name". The interface will be equivalent unless
the user has selected another language than English in the preferences
and objects with localized name:* tags corresponding to the user's
language are being displayed.
2009-09-17 23:36:54 +00:00
Ævar Arnfjörð Bjarmason
bc66c8adeb Make the printable_name() function call i18n.t to translate its
output. Makes e.g. "#{name}, v#{object.version.to_s}" which is used in
the changeset browser translatable.

I'm still not happy with how the anchor is constructed. we're linking
from /browse/changeset/1234 to e.g. node "[[366672999, v1]]" even
though the page we're linking to might take us to that node at version
2. The link should be "[[366672999]], v1" instead.

But that's something to solve later.
2009-06-28 21:13:27 +00:00
Thomas Wood
22292debda Data browser changes, make links more user friendly, displaying name tag where possible.
Changes to models ok'd (and suggested as temporary solution) by TomH
References #1777
2009-05-02 00:26:37 +00:00
Shaun McDonald
2ed84e26cd Adding pagination to the changesets, thus allowing you to browe large changesets, without MySQL complaining about memory. Probably needs some fine tuning. You currently can only page one of nodes, ways, and relations, without manually setting the relations. Fixing deprection notice for the classic_pagination plugin. 2008-11-27 17:06:43 +00:00
Tom Hughes
b909dc4ab8 Add a stub helper for the browse controller. 2008-04-20 12:21:07 +00:00