rails.git
8 months agoLocalisation updates from https://translatewiki.net.
translatewiki.net [Mon, 1 Apr 2019 18:44:00 +0000 (20:44 +0200)]
Localisation updates from https://translatewiki.net.

8 months agoUse erb-lint to prohibit inline scripting
Tom Hughes [Sun, 31 Mar 2019 18:06:59 +0000 (19:06 +0100)]
Use erb-lint to prohibit inline scripting

8 months agoFormat closed_at correctly in changeset API responses
Tom Hughes [Sat, 30 Mar 2019 15:35:37 +0000 (15:35 +0000)]
Format closed_at correctly in changeset API responses

Fixes #2195

8 months agoLocalisation updates from https://translatewiki.net.
translatewiki.net [Thu, 28 Mar 2019 18:41:23 +0000 (19:41 +0100)]
Localisation updates from https://translatewiki.net.

8 months agoFix dependencies
Tom Hughes [Thu, 28 Mar 2019 09:35:12 +0000 (09:35 +0000)]
Fix dependencies

8 months agoUpdate to rails 5.2.3
Tom Hughes [Thu, 28 Mar 2019 08:50:49 +0000 (08:50 +0000)]
Update to rails 5.2.3

8 months agoExpect CORS preflight responses to not have a content type
Tom Hughes [Thu, 28 Mar 2019 08:45:58 +0000 (08:45 +0000)]
Expect CORS preflight responses to not have a content type

https://github.com/cyu/rack-cors/pull/180

8 months agoUpdate bundle
Tom Hughes [Thu, 28 Mar 2019 08:37:52 +0000 (08:37 +0000)]
Update bundle

8 months agoMerge remote-tracking branch 'upstream/pull/2190'
Tom Hughes [Thu, 28 Mar 2019 08:24:04 +0000 (08:24 +0000)]
Merge remote-tracking branch 'upstream/pull/2190'

8 months agoerblint: use consistent spacing in HTML tags
Tom Hughes [Thu, 28 Mar 2019 00:30:48 +0000 (00:30 +0000)]
erblint: use consistent spacing in HTML tags

8 months agoerblint: remove leading blank lines
Tom Hughes [Thu, 28 Mar 2019 00:29:04 +0000 (00:29 +0000)]
erblint: remove leading blank lines

8 months agoerblint: avoid dynamic find_by methods
Tom Hughes [Wed, 27 Mar 2019 19:14:16 +0000 (19:14 +0000)]
erblint: avoid dynamic find_by methods

8 months agoerblint: add rel=noopener to links that open in a new tab
Tom Hughes [Wed, 27 Mar 2019 19:11:49 +0000 (19:11 +0000)]
erblint: add rel=noopener to links that open in a new tab

8 months agoerblint: use conditional assignment
Tom Hughes [Wed, 27 Mar 2019 18:59:52 +0000 (18:59 +0000)]
erblint: use conditional assignment

8 months agoerblint: use word arrays
Tom Hughes [Wed, 27 Mar 2019 18:57:04 +0000 (18:57 +0000)]
erblint: use word arrays

8 months agoerblint: use parentheses for nested function calls
Tom Hughes [Wed, 27 Mar 2019 18:55:48 +0000 (18:55 +0000)]
erblint: use parentheses for nested function calls

8 months agoerblint: use symbols as procs
Tom Hughes [Wed, 27 Mar 2019 18:54:16 +0000 (18:54 +0000)]
erblint: use symbols as procs

8 months agoerblint: avoid negated if conditions
Tom Hughes [Wed, 27 Mar 2019 18:49:01 +0000 (18:49 +0000)]
erblint: avoid negated if conditions

8 months agoerblint: prefer symbolic logical operators over and/or/not
Tom Hughes [Wed, 27 Mar 2019 18:46:07 +0000 (18:46 +0000)]
erblint: prefer symbolic logical operators over and/or/not

8 months agoMerge remote-tracking branch 'upstream/pull/2192'
Tom Hughes [Wed, 27 Mar 2019 18:19:08 +0000 (18:19 +0000)]
Merge remote-tracking branch 'upstream/pull/2192'

8 months agoMerge remote-tracking branch 'upstream/pull/2191'
Tom Hughes [Wed, 27 Mar 2019 18:10:09 +0000 (18:10 +0000)]
Merge remote-tracking branch 'upstream/pull/2191'

8 months agoDisentangle the api abilities from the web abilities
Andy Allan [Wed, 27 Mar 2019 17:00:57 +0000 (18:00 +0100)]
Disentangle the api abilities from the web abilities

This will allow us to rename api actions without causing permissions headaches. The choice of
abilities files is made by inheriting from either api_controller or application_controller.

Also rename capabilities to api_capabilites, for consistency.

8 months agoSet image dimensions in order to avoid a reflow after the page is drawn by the browser
Andy Allan [Wed, 27 Mar 2019 16:16:49 +0000 (17:16 +0100)]
Set image dimensions in order to avoid a reflow after the page is drawn by the browser

8 months agoRefactor notes#mine to simplify code
Andy Allan [Wed, 27 Mar 2019 16:15:18 +0000 (17:15 +0100)]
Refactor notes#mine to simplify code

8 months agoerblint: fix remaining single quoted strings
Tom Hughes [Wed, 27 Mar 2019 16:15:19 +0000 (16:15 +0000)]
erblint: fix remaining single quoted strings

8 months agoMerge remote-tracking branch 'upstream/pull/2189'
Tom Hughes [Wed, 27 Mar 2019 12:07:11 +0000 (12:07 +0000)]
Merge remote-tracking branch 'upstream/pull/2189'

8 months agoUse trace jobs by default
Andy Allan [Wed, 27 Mar 2019 10:50:45 +0000 (11:50 +0100)]
Use trace jobs by default

8 months agoMerge remote-tracking branch 'upstream/pull/2188'
Tom Hughes [Wed, 27 Mar 2019 10:43:23 +0000 (10:43 +0000)]
Merge remote-tracking branch 'upstream/pull/2188'

8 months agoUse the trace jobs for creating and destroy traces via the API
Andy Allan [Wed, 27 Mar 2019 10:40:50 +0000 (11:40 +0100)]
Use the trace jobs for creating and destroy traces via the API

8 months agoMerge remote-tracking branch 'upstream/pull/2187'
Tom Hughes [Wed, 27 Mar 2019 10:38:46 +0000 (10:38 +0000)]
Merge remote-tracking branch 'upstream/pull/2187'

8 months agoCheck validity token in changesets controller
Andy Allan [Wed, 27 Mar 2019 10:24:31 +0000 (11:24 +0100)]
Check validity token in changesets controller

It makes no difference today, but prevents problems in future if
methods accepting post requests are added to this controller in future.

8 months agoerblint: avoid parentheses for method calls with no arguments
Andy Allan [Wed, 27 Mar 2019 09:59:10 +0000 (10:59 +0100)]
erblint: avoid parentheses for method calls with no arguments

8 months agoerblint: prefer double quoted strings
Andy Allan [Wed, 27 Mar 2019 09:57:00 +0000 (10:57 +0100)]
erblint: prefer double quoted strings

8 months agoExclude most views from string literal checks
Andy Allan [Wed, 27 Mar 2019 09:42:16 +0000 (10:42 +0100)]
Exclude most views from string literal checks

This allows us to work through them slowly, while preventing errors
from creeping into directories that already pass.

8 months agoerblint: Add or remove curly braces around hash parameters as required
Andy Allan [Wed, 27 Mar 2019 09:30:48 +0000 (10:30 +0100)]
erblint: Add or remove curly braces around hash parameters as required

8 months agoerblint: use hash rocket syntax
Andy Allan [Wed, 27 Mar 2019 09:03:56 +0000 (10:03 +0100)]
erblint: use hash rocket syntax

8 months agoMerge remote-tracking branch 'upstream/pull/2168'
Tom Hughes [Tue, 26 Mar 2019 21:11:51 +0000 (21:11 +0000)]
Merge remote-tracking branch 'upstream/pull/2168'

8 months agoExclude files in the vendor directory from erb-lint rubocop checks
Tom Hughes [Tue, 26 Mar 2019 20:22:32 +0000 (20:22 +0000)]
Exclude files in the vendor directory from erb-lint rubocop checks

8 months agoFix capitalisation of div tag
Tom Hughes [Tue, 26 Mar 2019 19:41:44 +0000 (19:41 +0000)]
Fix capitalisation of div tag

8 months agoUpdate coding style section of the contribution guide to describe our use of rubocop...
Andy Allan [Wed, 6 Mar 2019 10:44:59 +0000 (11:44 +0100)]
Update coding style section of the contribution guide to describe our use of rubocop and erblint

8 months agoAdd erblint to travis
Andy Allan [Wed, 6 Mar 2019 10:38:44 +0000 (11:38 +0100)]
Add erblint to travis

8 months agoIntroduce erb-lint for linting erb files
Andy Allan [Wed, 6 Mar 2019 10:30:40 +0000 (11:30 +0100)]
Introduce erb-lint for linting erb files

This also allows running rubocop on the ruby code within the erb
files.

8 months agoWhitespace fixes to various erb files
Andy Allan [Wed, 6 Mar 2019 10:18:10 +0000 (11:18 +0100)]
Whitespace fixes to various erb files

8 months agoWhitespace fixes for messages erb files
Andy Allan [Wed, 6 Mar 2019 10:13:47 +0000 (11:13 +0100)]
Whitespace fixes for messages erb files

8 months agoWhitespace fixes for layouts erb files
Andy Allan [Wed, 6 Mar 2019 10:11:15 +0000 (11:11 +0100)]
Whitespace fixes for layouts erb files

8 months agoWhitespace fixes for diary_entry erb files
Andy Allan [Wed, 6 Mar 2019 10:02:54 +0000 (11:02 +0100)]
Whitespace fixes for diary_entry erb files

8 months agoWhitespace fixes for browse erb files
Andy Allan [Wed, 6 Mar 2019 09:59:55 +0000 (10:59 +0100)]
Whitespace fixes for browse erb files

8 months agoWhitespace fixes for errors erb files
Andy Allan [Wed, 6 Mar 2019 09:54:13 +0000 (10:54 +0100)]
Whitespace fixes for errors erb files

8 months agoWhitespace fixes for oauth_clients erb files
Andy Allan [Wed, 6 Mar 2019 09:53:57 +0000 (10:53 +0100)]
Whitespace fixes for oauth_clients erb files

8 months agoWhitespace fixes for issues erb files
Andy Allan [Wed, 6 Mar 2019 09:53:40 +0000 (10:53 +0100)]
Whitespace fixes for issues erb files

8 months agoWhitespace fixes for users erb files
Andy Allan [Wed, 6 Mar 2019 09:50:33 +0000 (10:50 +0100)]
Whitespace fixes for users erb files

8 months agoWhitespace fixes for user_blocks erb files
Andy Allan [Wed, 6 Mar 2019 09:42:25 +0000 (10:42 +0100)]
Whitespace fixes for user_blocks erb files

8 months agoWhitespace fixes for notifier erb views
Andy Allan [Wed, 6 Mar 2019 09:34:54 +0000 (10:34 +0100)]
Whitespace fixes for notifier erb views

8 months agoWhitespace fixes for site erb files
Andy Allan [Wed, 6 Mar 2019 09:29:20 +0000 (10:29 +0100)]
Whitespace fixes for site erb files

8 months agoWhitespace fixes in traces erb files
Andy Allan [Wed, 6 Mar 2019 09:17:44 +0000 (10:17 +0100)]
Whitespace fixes in traces erb files

8 months agoPrefer String#match? over butt ugly Regexp#match?
Tom Hughes [Tue, 26 Mar 2019 19:12:18 +0000 (19:12 +0000)]
Prefer String#match? over butt ugly Regexp#match?

8 months agoTarget ruby 2.5.1 to match Ubuntu
Tom Hughes [Tue, 26 Mar 2019 19:08:36 +0000 (19:08 +0000)]
Target ruby 2.5.1 to match Ubuntu

8 months agoRubocop fixes for ruby 2.5
Andy Allan [Wed, 13 Mar 2019 09:33:33 +0000 (10:33 +0100)]
Rubocop fixes for ruby 2.5

8 months agoUpgrade minimum version of ruby to 2.5
Andy Allan [Wed, 13 Mar 2019 09:28:50 +0000 (10:28 +0100)]
Upgrade minimum version of ruby to 2.5

This prepares the way for gems that depend on newer ruby, and also
prepares for the rails 6 upgrade.

8 months agoMerge remote-tracking branch 'upstream/pull/2175'
Tom Hughes [Tue, 26 Mar 2019 19:14:04 +0000 (19:14 +0000)]
Merge remote-tracking branch 'upstream/pull/2175'

8 months agoPrefer String#match? over butt ugly Regexp#match?
Tom Hughes [Tue, 26 Mar 2019 19:12:18 +0000 (19:12 +0000)]
Prefer String#match? over butt ugly Regexp#match?

8 months agoTarget ruby 2.5.1 to match Ubuntu
Tom Hughes [Tue, 26 Mar 2019 19:08:36 +0000 (19:08 +0000)]
Target ruby 2.5.1 to match Ubuntu

8 months agoLocalisation updates from https://translatewiki.net.
translatewiki.net [Mon, 25 Mar 2019 18:07:09 +0000 (19:07 +0100)]
Localisation updates from https://translatewiki.net.

8 months agoQueue trace related jobs in the traces queue
Tom Hughes [Sun, 24 Mar 2019 17:08:57 +0000 (17:08 +0000)]
Queue trace related jobs in the traces queue

8 months agoMerge remote-tracking branch 'upstream/pull/2131'
Tom Hughes [Sat, 23 Mar 2019 12:08:41 +0000 (12:08 +0000)]
Merge remote-tracking branch 'upstream/pull/2131'

8 months agoMerge remote-tracking branch 'upstream/pull/2186'
Tom Hughes [Sat, 23 Mar 2019 12:01:05 +0000 (12:01 +0000)]
Merge remote-tracking branch 'upstream/pull/2186'

8 months agoUse strings consistently for database/api/gpx status
Tom Hughes [Sat, 23 Mar 2019 11:59:42 +0000 (11:59 +0000)]
Use strings consistently for database/api/gpx status

8 months agoLocalisation updates from https://translatewiki.net.
translatewiki.net [Thu, 21 Mar 2019 10:04:08 +0000 (11:04 +0100)]
Localisation updates from https://translatewiki.net.

8 months agoMove more api-only methods into api_controller
Andy Allan [Wed, 20 Mar 2019 13:51:57 +0000 (14:51 +0100)]
Move more api-only methods into api_controller

8 months agoMark all methods in api_controller and application_controller as private
Andy Allan [Wed, 20 Mar 2019 13:37:39 +0000 (14:37 +0100)]
Mark all methods in api_controller and application_controller as private

They aren't designed to be used as request endpoints, so there's no
need for them to be public.

8 months agoUse a lambda in order to pass parameters in before_actions
Andy Allan [Wed, 20 Mar 2019 14:07:33 +0000 (15:07 +0100)]
Use a lambda in order to pass parameters in before_actions

This avoid calling methods on a new instance of the controller, and
therefore allows these methods to be marked as private.

As a bonus, rubocop can now parse them and warn when they refer to
actions that don't exist in the controller.

8 months agoMove the authorize method to api_controller
Andy Allan [Wed, 20 Mar 2019 13:36:43 +0000 (14:36 +0100)]
Move the authorize method to api_controller

8 months agoSimplify deny_access handling
Andy Allan [Wed, 20 Mar 2019 13:27:05 +0000 (14:27 +0100)]
Simplify deny_access handling

Now that we have all api controllers inheriting from a common base,
it's easier to override the deny_access handler without having to
switch between both.

Fixes #2064

8 months agoRefactor api controllers to inherit from a common ApiController
Andy Allan [Wed, 20 Mar 2019 13:16:15 +0000 (14:16 +0100)]
Refactor api controllers to inherit from a common ApiController

8 months agoUse an enumerator for gpx.points, and process the the points in batches
Andy Allan [Wed, 20 Mar 2019 09:14:11 +0000 (10:14 +0100)]
Use an enumerator for gpx.points, and process the the points in batches

8 months agoRaise exception if there is an error, and import tracepoints in batches
Andy Allan [Wed, 6 Mar 2019 08:27:33 +0000 (09:27 +0100)]
Raise exception if there is an error, and import tracepoints in batches

8 months agoUse activerecord-import for bulk importing tracepoint records
Andy Allan [Wed, 23 Jan 2019 17:12:30 +0000 (18:12 +0100)]
Use activerecord-import for bulk importing tracepoint records

Non-rigourous testing shows a significant speedup, even on ssds.

8 months agoFix travis
Tom Hughes [Tue, 19 Mar 2019 14:08:43 +0000 (14:08 +0000)]
Fix travis

8 months agoMerge remote-tracking branch 'upstream/pull/2182'
Tom Hughes [Tue, 19 Mar 2019 13:29:49 +0000 (13:29 +0000)]
Merge remote-tracking branch 'upstream/pull/2182'

8 months agoAdd banner against EU Copyright Directive
Michael Reichert [Mon, 18 Mar 2019 21:16:25 +0000 (22:16 +0100)]
Add banner against EU Copyright Directive

Set end date to 2019-03-26 because the topic is tabled on 26 March
according to the agenda.

8 months agoLocalisation updates from https://translatewiki.net.
translatewiki.net [Mon, 18 Mar 2019 07:57:33 +0000 (08:57 +0100)]
Localisation updates from https://translatewiki.net.

8 months agoMove application.yml check to config initializer
Tom Hughes [Sun, 17 Mar 2019 10:49:21 +0000 (10:49 +0000)]
Move application.yml check to config initializer

8 months agoMove status into the settings object
Tom Hughes [Sat, 16 Mar 2019 16:29:12 +0000 (16:29 +0000)]
Move status into the settings object

Only the very early boot code needs to look at the value
from the environment directly.

8 months agoFix database offline mode
Tom Hughes [Sat, 16 Mar 2019 16:52:08 +0000 (16:52 +0000)]
Fix database offline mode

8 months agoSort gitignore
Tom Hughes [Sat, 16 Mar 2019 15:41:35 +0000 (15:41 +0000)]
Sort gitignore

8 months agoAdd comment
Tom Hughes [Sat, 16 Mar 2019 15:40:23 +0000 (15:40 +0000)]
Add comment

8 months agoMerge remote-tracking branch 'upstream/pull/2177'
Tom Hughes [Sat, 16 Mar 2019 15:39:03 +0000 (15:39 +0000)]
Merge remote-tracking branch 'upstream/pull/2177'

8 months agoMerge remote-tracking branch 'upstream/pull/2164'
Tom Hughes [Sat, 16 Mar 2019 15:31:29 +0000 (15:31 +0000)]
Merge remote-tracking branch 'upstream/pull/2164'

8 months agoRubocop fix
Andy Allan [Wed, 13 Mar 2019 11:14:31 +0000 (12:14 +0100)]
Rubocop fix

8 months agoRubocop fixes
Andy Allan [Wed, 13 Mar 2019 11:06:19 +0000 (12:06 +0100)]
Rubocop fixes

8 months agoMove changeset builder views to the api namespace
Andy Allan [Wed, 13 Mar 2019 11:04:54 +0000 (12:04 +0100)]
Move changeset builder views to the api namespace

8 months agoMove changeset XML generation to a view
Frederik Ramm [Fri, 1 Mar 2019 00:11:19 +0000 (01:11 +0100)]
Move changeset XML generation to a view

8 months agoAdd missing dependency
Tom Hughes [Fri, 15 Mar 2019 10:44:16 +0000 (10:44 +0000)]
Add missing dependency

8 months agoAdd missing dependencies
Tom Hughes [Fri, 15 Mar 2019 10:18:29 +0000 (10:18 +0000)]
Add missing dependencies

8 months agoUpdate to rails 5.2.2.1
Tom Hughes [Fri, 15 Mar 2019 09:30:17 +0000 (09:30 +0000)]
Update to rails 5.2.2.1

8 months agoUpdate bundle
Tom Hughes [Fri, 15 Mar 2019 09:27:38 +0000 (09:27 +0000)]
Update bundle

8 months agoAdd Spanish attribution to copyright page
Tom Hughes [Fri, 15 Mar 2019 09:17:28 +0000 (09:17 +0000)]
Add Spanish attribution to copyright page

Fixes #2179

8 months agoLocalisation updates from https://translatewiki.net.
translatewiki.net [Thu, 14 Mar 2019 12:14:50 +0000 (13:14 +0100)]
Localisation updates from https://translatewiki.net.

8 months agoRemove application.yml step from travis config
Andy Allan [Wed, 13 Mar 2019 17:41:57 +0000 (18:41 +0100)]
Remove application.yml step from travis config

8 months agoProvide a helpful warning if there's an application.yml file detected
Andy Allan [Wed, 13 Mar 2019 17:20:08 +0000 (18:20 +0100)]
Provide a helpful warning if there's an application.yml file detected