Commit graph

66 commits

Author SHA1 Message Date
Andy Allan
78b9d92207 Prefer keyword arguments when method has optional boolean arguments 2020-11-12 11:24:44 +00:00
Tom Hughes
abca51e4d8 Fix some Style/StringConcatenation warnings 2020-08-09 19:48:16 +01:00
Tom Hughes
4d2ea31516 Don't fall back to name:en if it's not in the user's language list
Fix to #2755
2020-08-06 14:21:30 +01:00
Tom Hughes
39b60219fe Fix new rubocop warnings 2020-06-11 19:21:41 +01:00
Tom Hughes
d6f518f627 More improvements to locale selection for the data browser
Use the browser language preferences for non-logged in users.
2020-06-07 19:10:48 +01:00
Tom Hughes
768a792a61 Improve selection of name to display in data browser
If the user is logged in then consider all their preferred
languages rather than just the UI language, and use the full
locale matching algorithm instead of just checking parents.

Fixes #2636
2020-06-04 17:33:11 +01:00
Andy Allan
061c53ff1d Remove unnecessary requires from helpers 2019-02-06 12:17:54 +01:00
Paul Dexter-Sobkowiak
74d2c4336b Split browse_helper.rb into two modules due to rubocop ModuleLength 2018-11-28 18:18:14 +00:00
Paul Dexter-Sobkowiak
5ba64efd7c Show tel: links for multiple phone numbers separated by ;
Closes #2069
2018-11-27 00:06:28 +00:00
David Abián
ed1f441ef3 Concept URIs for Wikidata entities
Wikidata entities should be linked using concept URIs, which are
permanent. This is the right way of linking web resources according
to the Linked Data principles.

Closes #1884
2018-05-28 13:02:47 +01:00
Štefan Baebler
36a382bb43 Added support for 2 more secondary wikidata tag links
Listed on in https://wiki.openstreetmap.org/wiki/Key:wikidata :
* name:etymology:wikidata
* network:wikidata
2018-03-05 08:38:50 +00:00
Tom Hughes
a83030dab7 Fix new rubocop warnings 2018-01-22 18:55:45 +00:00
Tom Hughes
be86e4824f Convert various URLs to https 2018-01-08 20:18:21 +00:00
Tom Hughes
e16311125e Use Hash#dig to simplify code 2017-10-05 20:22:24 +01:00
Tom Hughes
8dae890a76 Fix rubocop warnings 2017-10-05 19:18:38 +01:00
Tom Hughes
5b33f3f8e3 Fix rubocop warnings 2017-06-02 00:08:30 +01:00
Tom Hughes
5f4dcd34ff Fix some rubocop warnings 2016-09-15 22:41:07 +01:00
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