Commit graph

716 commits

Author SHA1 Message Date
Andy Allan
4fb775d6d5 Format latitudes and longitudes as %7f in XML output
This matches the double formatting in XML from cgimap. Fixes #341.
2017-03-30 14:30:54 +01:00
Herve Saint-Amand
b69e8b5c42 Included greeting string in changeset_comment_notification email 2017-02-27 22:36:09 +00:00
Simon Poole
7f05783949 Make test for a "zero hour" block more robust 2017-02-18 17:05:36 +01:00
Simon Poole
823f6b4d36 Add functionality to return a specific message for zero hour blocks 2017-02-18 13:53:21 +01:00
Tom Hughes
f435fce007 Link GPX fixture files instead of stubbing 2017-02-05 17:26:31 +00:00
Tom Hughes
a28f264ad1 Fix rubocop warnings 2017-02-05 14:33:48 +00:00
Tom Hughes
c57d2b29fc Merge remote-tracking branch 'openstreetmap/pull/1401' 2017-02-05 13:50:07 +00:00
Tom Hughes
c8671c137a Update rubocop 2017-02-05 11:12:37 +00:00
Tom Hughes
7793cd27ab Merge remote-tracking branch 'openstreetmap/pull/1423' 2017-02-02 17:21:41 +00:00
Andy Allan
c55169659c Add a user_role factory
Naming the association in the model makes the relationship easier
to express in the factory.
2017-02-02 12:35:29 +00:00
Frederik Ramm
ad2b4fe12a Reduce maximum changeset size to 10k changes
Ten thousand changes ought to be enough for any normal mapping activity.

Automatic edits and imports are controlled by scripts anyway so it doesn't
make a difference to them as they just have to adapt the limit.

The reason for my suggestion is that large changesets are becoming
increasingly difficult to handle due to frequent timeouts when trying
to load and process them.

The changeset size limit is returned by the API in the "capabilities" request
so client software that honours that information will automatically pick up
the new limit.

Closes #1259
2017-01-31 18:15:42 +00:00
Herve Saint-Amand
e5152c3931 Move attach_project_logo to be its own before_action filter, as suggested 2017-01-16 21:21:55 +00:00
Herve Saint-Amand
1e19e80d0e Renamed @user_message_author to @author as suggested 2017-01-16 21:13:52 +00:00
Herve Saint-Amand
a0627ec0c6 Revert "Added a greeting to the changeset comment message"
This reverts commit 39c3fa427e.
2017-01-14 21:48:46 +00:00
Herve Saint-Amand
75f96fcc9a Logo was being attached twice on changeset comment notifications 2017-01-13 21:45:52 +00:00
Herve Saint-Amand
7ef57b2fe8 Dressed up note comment messages 2017-01-12 23:02:57 +00:00
Herve Saint-Amand
22f7c1f721 Dressed up friend_notification mail 2017-01-12 22:11:23 +00:00
Herve Saint-Amand
39c3fa427e Added a greeting to the changeset comment message
The greeting includes the recipient's user name (as for the message notification mail), which should increase the recipient's trust that the message isn't spam. Greetings were reused from each language's respective locale flie.
2017-01-12 21:52:17 +00:00
Herve Saint-Amand
3aa69ffbdd Dressed up a few more messages.
email_confirm, message_notification and signup_confirm now use the new templates. This fixes some, but not all, of the currently broken tests.
2017-01-09 23:42:43 +00:00
Herve Saint-Amand
417176f868 Moved message table HTMl to a partial template
Several notifications are about a message having been sent from one user to another via OSM. I've moved the code for the HTML table that holds the actual user message, with the avatar and the body text, to its own partial template, so that it can be reused. I've updated a second notifier message to the new template, diary_comment_notification.
2017-01-08 22:09:10 +00:00
Herve Saint-Amand
ac081305f2 Remove HTML markup from locale file
Rather than including HTML markup in the locale file (which also has the inconvenience of requiring both a plain-text and an HTML duplicate of the same string), move the markup to the template. Also added a helper to reduce clutter in the template slightly.
2017-01-03 22:38:58 +00:00
Herve Saint-Amand
beaa85e21c More compact image paths
Make the file paths to image assets more compact. I investigated using `image_path` but could only get it to return the path for a public URL, which is different and also includes the asset pipeline digest.
2017-01-02 23:48:49 +00:00
Herve Saint-Amand
ab9aaf7e97 Proper way to get path to small avatar
Rather than performing perilous string substitution on paths, just use the built-in way to select the small version of the avatar image file.
2017-01-02 21:35:59 +00:00
Herve Saint-Amand
7a4e13ecad Fixed quotes
Replaced single quotes with double quotes, to comply with rubocop rules.
2017-01-01 23:39:42 +00:00
Herve Saint-Amand
20a74fcbf1 Remove unused variable 2017-01-01 22:39:07 +00:00
Herve Saint-Amand
1d86379a5c Remove unused import 2017-01-01 22:33:22 +00:00
Herve Saint-Amand
b5ef2be021 Better loading of attached images
Got rid of that big ugly base64 blob which was only a temporary crutch anyway. Added a png file instead. Use File.read rather than File.open for a 66% reduction in verbosity.
2017-01-01 22:11:56 +00:00
Herve Saint-Amand
689769cada avatar inline attachment 2016-12-29 23:37:22 +00:00
Herve Saint-Amand
e6d19586df intial commit, for 'en' locale only, for changeset_comment_notification only, doesn't load images properly yet 2016-12-29 21:54:46 +00:00
Tom Hughes
de6c33814b Make sure email replies to diary comments come from the right user 2016-11-29 19:30:23 +00:00
Tom Hughes
e5834016fd Clone objects before saving in case of a retry
If a deadlock occurs then the transaction will be retried so we
need to make sure that the object will still be dirty so that it
will be saved again during the retry but that the version won't
be incremented a second time.
2016-11-28 20:31:04 +00:00
Tom Hughes
e84f0c710d Reject oauth nonces over a day old 2016-11-03 07:14:19 +00:00
Tom Hughes
282ff4936c Fix rubocop warnings 2016-10-31 21:24:10 +00:00
Tom Hughes
20aa4ba31b Merge remote-tracking branch 'openstreetmap/pull/1336' 2016-10-26 15:35:18 +01:00
Andy Allan
f464e2a6e9 Suppress XML parsing errors.
This technique was already used in app/models/changeset.rb

This suppresses the error messages when parsing invalid XML, but
the exceptions are still raised, as tested in test_from_xml_double_lat
in test/models/node_test.rb
2016-10-26 10:35:03 +01:00
Andy Allan
162f04d789 Convert ACL fixture to a factory, and add some tests
The fixture was unused, so I took the opportunity to put in a couple
of basic model tests.
2016-10-26 09:15:56 +01:00
Tom Hughes
e17b89e89f Fix rubocop warnings 2016-10-20 22:35:51 +01:00
Mikel Maron
a32076abd6 fix rubocop warnings 2016-10-07 06:32:05 -04:00
Mikel Maron
3c01d2e80d more idiomatic models for diary entry subscriptions 2016-10-06 20:31:10 -04:00
Mikel Maron
44b08cc35d not api endpoints, moved to button, fixed notifier message, fixed tests 2016-10-03 22:20:04 -04:00
Mikel Maron
443080d7b0 WIP diary comment subscriptions 2016-10-03 15:04:22 -04:00
Tom Hughes
5f4dcd34ff Fix some rubocop warnings 2016-09-15 22:41:07 +01:00
Tom Hughes
d82f9d12ce Fix new rubocop warnings 2016-09-15 19:21:00 +01:00
Tom Hughes
13c2ac5cdb Reorder auth_success handlers
Only treat auth_success as a possible login attempt if we're not
in the middle of validating a new user, or a change to a user.

Also validate the uniqueness of external auth credentials at the
rails level rather than just at the database level, and make sure
any errors are properly reported.

Fixes #1265
2016-08-14 18:30:13 +01:00
Tom Hughes
5d3ecffa28 Fix new rubocop warnings 2016-02-05 13:35:26 +00:00
Tom Hughes
77c25dca8c Validate characters in changeset comments
Fixes #1135
Closes #1139
2016-01-19 09:51:24 +00:00
Tom Hughes
8fe1899596 Fix rubocop warnings 2016-01-19 09:51:24 +00:00
Tom Hughes
4028f4cdb9 Rework locale selection
Implement our own matching algorithm rather than trying to
patch the http_accept_language one and make sure everything is
using it in a consistent way.

Fixes #1125
2016-01-06 18:43:25 +00:00
Tom Hughes
c9d35839be Fix new rubocopy warnings 2015-08-18 20:57:14 +01:00
Tom Hughes
098d1fc235 Allow customer URL schemas for OAuth callback URLs
Fixes #1019
2015-07-28 12:13:18 +01:00