Commit graph

912 commits

Author SHA1 Message Date
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
Matt Amos
757a1aaa85 Made rubocop happy by formatting and minor syntax tweaks. 2016-08-22 17:24:10 +01:00
Shrey
ed84930283 UI changes + Redirection after creating report fixed
(cherry picked from commit 987fcf0ba5e7e914dc479e9dc7613400e72148a0)
2016-08-22 16:18:15 +01:00
Shrey
69c1f6d186 Added sortable headers + search + reportable Notes 2016-08-22 16:18:15 +01:00
Shrey
b68b29b43c Added support for reporting Changesets + Deleting issues from the CLI 2016-08-22 16:17:54 +01:00
Shrey
f72c34aaf8 Added Issue Type + Issue Reassigning + Last updated_by 2016-08-22 16:17:54 +01:00
Shrey
c7bc13668b Issue reopens on Reports coming in after instance update 2016-08-22 16:17:54 +01:00
Shrey
d5f02968f6 Fixed tests + Altered migration file + Added reporting strings + Added update method 2016-08-22 16:17:54 +01:00
Shrey
faf4c5aa7a Fixed tests + Added new ones 2016-08-22 16:17:21 +01:00
Shrey
d1d4f8192d DB changes + Related issues added 2016-08-22 16:16:31 +01:00
Shrey
683722ed5c Added IssueComments + ForeignKeys + Indexes 2016-08-22 16:15:12 +01:00
Shrey
d49922eb63 Added authorization + issues dashboard 2016-08-22 16:14:10 +01:00
Shrey
453f758f91 Controllers + a few tests + new notification added. Work pending on the notification view 2016-08-22 16:13:31 +01:00
Shrey
5add3cf671 Basic models set up 2016-08-22 16:12:31 +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
Tom Hughes
a22c3525e4 Add HTML version of friend notification email
Fixes #995
2015-06-25 00:16:15 +01:00
Matt Amos
cf6a5c17ee Fix bug allowing created elements to reference deleted ones
The bug allows a newly-created element to refer to a deleted one
if the transactions for both overlap. Precisely, the issue is that
the check that an element exists does not prevent a concurrent
transaction from altering that row.

Because "deleting" an element in the OSM database does not remove
the row, we cannot rely on FK constraints to ensure the correct
behaviour. Instead, this fix relies on manually locking referenced
elements.

Note that this "fix" is suboptimal, as it does not allow any
updates to the referenced elements. Updates which do not delete
the row could safely be done, but will be prevented.

Also, it's not clear what the negative performance impact of this
change will be.
2015-06-13 10:59:57 +01:00
Tom Hughes
2af0840ff3 Fix style issues found by new rubocop version 2015-04-14 09:38:24 +01:00
Tom Hughes
650adc10b2 Allow space as a language separator
The separator is supposed to be comma, so technically having
space instead is user error, but it seems to be very common.

Fixes #942
2015-03-31 20:53:51 +01:00
Tom Hughes
c0e4394a48 Add extra tests for API and redaction controllers 2015-03-03 00:55:19 +00:00
Tom Hughes
dfc85f089a Test changeset and note comment notification emails 2015-03-02 00:43:07 +00:00