Commit graph

163 commits

Author SHA1 Message Date
Tom Hughes
f02c753cc4 Use send_data for GPX traces intead of monkey patching send_file 2017-10-09 20:38:08 +01:00
Tom Hughes
8dae890a76 Fix rubocop warnings 2017-10-05 19:18:38 +01:00
Andy Allan
b4be5596f5 Rename xml processing methods with an update_ prefix
They behave differently from the other from_xml methods on other models.
2017-08-30 11:40:54 +01:00
Andy Allan
c647aa3d4d Refactor the from_xml methods to act on existing trace objects.
Setting the new tags with the = operator takes care of removing the
old ones, and is the same approach as taken by the tagstring= method.

Fixes #1600
2017-08-18 10:09:50 +01:00
Andy Allan
6f89da05d1 Use current_user to represent the currently logged in user.
This is already used by the oauth plugin, and is a general rails convention.
2017-07-12 16:10:50 +01:00
Tom Hughes
117f0e8226 Sanitize parameters for various paged views 2017-06-29 10:55:53 +01:00
Tom Hughes
8412ed0bed Replace deprecated Mime::XXX with Mime[:xxx] 2017-06-03 17:33:13 +01:00
Tom Hughes
ff97501ed0 Remove all use of the :text option to render
It doesn't actually do what it says, as it sets the content type
to text/html not text/plain so is just confusing and as a result
has been deprecated in newer rails versions.
2017-06-02 19:12:05 +01:00
Tom Hughes
5b33f3f8e3 Fix rubocop warnings 2017-06-02 00:08:30 +01:00
Tom Hughes
e23541c20f Allow a POST with no arguments to trace#edit to fetch the form 2017-02-13 10:09:43 +00:00
Tom Hughes
c439f957ae Only add traces for POST requests 2017-02-09 21:07:44 +00:00
Tom Hughes
94ab5c3635 Make TraceController#list sort by id instead of timestamp
The effect is much the same but id is guaranteed to give a stable
sort if two traces have the same timestamp.
2017-02-05 16:18:56 +00:00
Andy Allan
41e05f0929 Remove unnecessary controller references from the redirect hashes.
Rails redirect_to uses the current controller by default, so there
is no need to re-iterate this in the code when the redirect targets
the current controller.

The short-form is already used elsewhere, this just tidies up those
which were still using the long-form.
2016-10-12 14:32:49 +01:00
Tom Hughes
5d3ecffa28 Fix new rubocop warnings 2016-02-05 13:35:26 +00:00
Tom Hughes
8fe1899596 Fix rubocop warnings 2016-01-19 09:51:24 +00:00
Tom Hughes
c9d35839be Fix new rubocopy warnings 2015-08-18 20:57:14 +01:00
Tom Hughes
ad3ba427b7 Fix double XML declaration on trace RSS feeds
Fixes #1034
2015-08-18 19:09:11 +01:00
Tom Hughes
fd588cd715 The test train rolls ever onwards... 2015-03-01 17:04:39 +00:00
Tom Hughes
dbe165bbb3 Fix some rubocop rails style issues 2015-02-26 00:12:54 +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
baf10cd392 Fix rubocop lint 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
28bfb9999f Rename Trace#public to Trace#visible_to_all 2014-07-04 19:24:25 +01:00
Tom Hughes
3678e83678 Use gpx as the extension when we ask for /trace/N/data.gpx 2013-10-16 00:46:33 +01:00
Tom Hughes
c3c9d047ba Tidy up trace#edit and trace#delete and make them more consistent 2013-10-15 00:16:53 +01:00
Tom Hughes
63100ae8a0 Convert trace counting to use modern arel methods 2013-09-29 22:33:04 +01:00
Tom Hughes
f0feca800d Replace attr_accessible with strong parameters 2013-09-21 11:35:46 +01:00
Tom Hughes
40b452ac74 Use a view to build the trace RSS feed and get rid of OSM::GeoRSS 2013-09-18 18:23:03 +01:00
Tom Hughes
7e896d758d Return GPX traces as application/gpx+xml instead of text/xml 2013-09-09 16:23:38 +01:00
Tom Hughes
3880ac5de8 Replace :nothing => true with :text => ""
Using `:nothing => true` confusingly actually causes a single space
to be sent as the content by rails.
2013-07-19 11:14:55 +01:00
Tom Hughes
2dc7c505fd Remove remaining action cache usage and related infrastructure 2013-06-25 17:47:54 +01:00
Tom Hughes
a945fc0fcd Fix trace lists to correctly respect tag restrictions 2013-05-10 22:48:26 +01:00
Tom Hughes
164341121d Hide deleted traces in the RSS feeds 2013-05-10 21:35:00 +01:00
Tom Hughes
4c9a3d4803 Disable caching of pages with dynamic layout
Pages now feed back into the layout to set the content of the heading
block so we can't cache any page which has a layout as that would mean
the heading wouldn't appear when the cached page was used.
2013-01-14 22:30:03 +00:00
Tom Hughes
cb6eb65466 Use binary mode for trace files
We don't want to try and do any enoding conversions (or indeed any
newline conversions) on uploaded trace files.
2012-11-04 14:41:01 +00:00
Tom Hughes
a9824dbc2e Use one "no_such_user" view everywhere 2012-03-21 21:47:09 +00:00
Tom Hughes
58d889436f Fix various routing and route generation errors 2012-03-09 23:15:39 +00:00
Tom Hughes
6391ea5a7a Remove method tests that are now enforced by the routes 2012-03-09 20:19:55 +00:00
Tom Hughes
1340fca8f1 Turn on mass assignment protection
Require any attribute that is going to be mass assigned to be
whitelisted, and whitelist those attributes which need it
2012-03-06 08:54:45 +00:00
Tom Hughes
346b097d85 Fix bad database query for RSS feeds of trace file tags 2012-02-19 11:48:33 +00:00
Tom Hughes
a16b45eb6a Add convenience methods to make ACL use simpler 2012-02-08 22:38:02 +00:00
Tom Hughes
cd43529cc8 Add support for domain based ACLs 2012-02-08 21:40:21 +00:00
Tom Hughes
8ba74c581d Add an ACL check to allow trace downloads to be blocked 2012-01-17 17:43:32 +00:00
Tom Hughes
071c3581e9 Disable CSRF token verification for API methods 2011-11-14 09:42:55 +00:00
Tom Hughes
3227f40193 Make more use of named scopes 2011-11-14 09:42:51 +00:00
Tom Hughes
8ae5d94b2f Update some more queries to use AREL in place of deprecated methods 2011-11-14 09:42:51 +00:00
Tom Hughes
7f556f94f1 Temporary fix for postgres enums pending rails 3.0.4 2011-11-14 09:42:46 +00:00
Tom Hughes
226c41be69 Update ActiveRecord queries to use arel 2011-11-14 09:42:44 +00:00
Tom Hughes
59a49a6ef5 Fix problems with database offline mode 2011-06-23 08:30:44 +01:00