Commit graph

140 commits

Author SHA1 Message Date
Moriel Schottlender 15a44768f4 Add mark-as-read button to notifications in Special:Notifications
Bug: T115528
Change-Id: I54dba5f86d28a069659d66dede5b7ab9981213aa
2016-05-11 10:41:32 -07:00
Kunal Mehta b6f742bc46 Add plain text email formatter
Formatters based on presentation models for
individual event emails and digest (daily, weekly)
plain text emails.

Bug: T121067
Change-Id: I4eceaf521315adab7429a8a73ffca70ebcddab86
2016-05-04 13:35:37 -04:00
Roan Kattouw 7942a2de79 Replace mark-as-read-on-click with ?markasread= URL parameter
Notifications were being marked as read in response to a click event
in JavaScript, but that causes a jarring effect in the UI, and it's
not reliable (the browser could abort the AJAX request).

Instead, add ?markasread=XYZ to the end of every primary link URL,
where XYZ is the event ID.

Bug: T133975
Depends-On: Icb99d5479836fea25a47451b5a758dd71f642f71
Change-Id: I8047d121584b43e6172463a50ad0e0de5f7fa73c
2016-05-03 00:20:03 -07:00
Roan Kattouw 33124f35a8 Move section methods into a trait
Change-Id: Ief2005918b92945ff93aea85d17e595c7c38adf2
2016-04-28 20:52:09 +00:00
jenkins-bot 56b4f161e4 Merge "Clean up section title handling in mention and edit-user-talk presentation models" 2016-04-27 16:29:49 +00:00
Roan Kattouw 5152385887 Make EchoForeignNotifications::getApiEndpoints() static
It doesn't use $this, except to call getWikiTitle(), so make that
static too. This allows us to use it in EchoForeignPresentationModel
without creating a second instance there.

Change-Id: If778db0852de1cbf5c2190ce50ce561745bb3887
2016-04-26 17:33:30 -07:00
Roan Kattouw c5361da55a Clean up section title handling in mention and edit-user-talk presentation models
They were using different code and different approaches.
I've left getSection() and the code for creating a Title
with a section duplicated for now, and I'll move them
into a trait in the next commit. I wanted to do that
separately because we aren't using traits in this
code base yet.

Change-Id: I56cf745d2cc8a6c43caec08024187de9598cecb8
2016-04-21 18:31:12 -07:00
Roan Kattouw b91360131c Use plaintextParams() for snippets and sections
We ended up double-parsing section titles, which resulted
in strange behavior when the section title was something like
{{tl|infobox}}.

Bug: T132872
Change-Id: I4434624f392cd0e1df39374d45d60f7d83be7161
2016-04-19 16:02:26 +00:00
Roan Kattouw 8b7e5dafe6 RevertedPresentationModel: Don't double-parse summary
formatSummary() was first parsing the summary using the
summary parser, then handing off the resulting HTML to
getTextSnippet() which parsed it again with the normal parser.

Bug: T131087
Change-Id: I2724ccb7c23579b3f02dea57d4fc833079169adf
2016-03-29 22:16:31 -04:00
Matthias Mullie a3d2196851 Notification titles should differentiate subpages of the talk page
Bug: T129686
Change-Id: If3a8eec489cbbea8c2ed7c03b75986ab7fd6c262
2016-03-23 15:19:43 +01:00
jenkins-bot 8b15325346 Merge "Make plural support for large values (100 or more) explicit in l10n" 2016-03-17 21:53:40 +00:00
Matthew Flaschen cac85b635f Make plural support for large values (100 or more) explicit in l10n
This involves:

* Making this value no longer admin-configurable.
* Changing getNotificationCountForOutput to return only a single value
  Since there is no + in the formatted value anymore, we can actually
  use the same value for both.

  This is a B/C break, but hopefully worth it to simplify the method
  call.

  For now, the excess parameter is just marked unused.  It could be
  removed at some point if the translations are updated.

This must be merged at the same time as:
* Flow - Ibfa56b1af9e8c56b4c5f900e0d487bc09688b2a2
* MobileFrontend - Ibf784b279d56773a227ff261b75f2b26125bbb63 (well, MF
  can be merged first)
* translatewiki - I2a4b6938aed49e4101deb6b9351c43656a863490

Also, change 1 to One/one, per Siebrand on the task.  This can easily
be dropped/undone if we don't want it.

Also, remove reference to no-longer-existent notification-page-linked-bundle

Bug: T127288
Change-Id: Iabeaae747f99980c0610d552f6b38f89d940b890
2016-03-16 18:43:16 -04:00
Roan Kattouw 1a4bdbc23a MentionPresentationModel: use Title::equals()
Change-Id: Ib0c5b0f5649edef79cf7ad272eb207711af8608d
2016-03-15 15:50:40 -07:00
Roan Kattouw e0581ecff3 Follow-up 9a1defa5: unbreak mention notifications
Actually pass the required User object to getTruncatedUsername().

Change-Id: I69ad0ea12d4b4785fbfeec801228cae518fd0a05
2016-03-11 22:57:20 +00:00
Matthew Flaschen 07c962e82f thank-you-edit: canRender for deleted page and extra fix
Don't try to render if page was deleted, and fix 'extra' parameter
(was breaking message key and thus rendering)

Bug: T129641
Change-Id: I5d0fdfd3921427993211969eb5793f8e9e7667a8
2016-03-11 13:59:27 -05:00
Roan Kattouw 933eecd2ec Follow-up 9a1defa: fix function name typo
Change-Id: I08466603a08496611ede9c0406d95c25a6a70e03
2016-03-10 19:53:34 -08:00
Moriel Schottlender 9a1defa57f Bidi isolate content items in notification header text
Bug: T127407
Change-Id: I25c426f3d0190bd33c4aa1c2ffb3c97fe1424567
2016-03-09 16:22:52 -08:00
Stephane Bisson ac556cf7c7 Notifications: truncate without adjust length
When $adjustLength is false, truncation will only happen
when the string is longer than the limit + the length of
the ellipsis to avoid the case where the ellipsis make
the string longer than the original.

Bug: T121822
Change-Id: I731a3c38b96ede6c6510f64771be0b9662dcba43
2016-03-03 09:08:10 -05:00
Roan Kattouw c466a5ef5c Move list of wiki names from header to body in cross-wiki notification item
Using wiki names in the header is problematic because the messages
we were using weren't designed to be used in a sentence, only in headings.
This removes the wiki names from the sentence in the header, and
instead puts a comma-separated list (with "and") of wikis in the body.

The messages keep $3 and $4 for backwards compatibility, so translations
of the form "from Commons and 2 other wikis" will keep working.

Bug: T121936
Change-Id: Ideeba794e260b3c388fa29226b53197c050162ef
2016-03-01 10:10:29 -08:00
Roan Kattouw 08a3a92794 Bidi-embed user names and page names in secondary links
Bug: T127407
Change-Id: I50c0363aee2e1f985c5920f869f11675992ecb10
2016-02-29 12:53:42 -08:00
Roan Kattouw ff4a54d7f1 MentionPresentationModel: Remove pageLink from secondary links
It wasn't meant to be there, and flow-mention doesn't have it either.
We also don't have any other notification types with
three prioritized secondary links.

Bug: T125949
Change-Id: Icbffa185b1116b1a6beb9bb3585339fdf7e82cdd
2016-02-26 20:41:13 -05:00
Stephane Bisson 67facac67d Force notification body on a single line
The approach here is to use $msg->escaped() to
remove all markup and then replace new lines
with a single space.

Bug: T128062
Change-Id: I1d5a6e57fbae9b6a441671beff1c60720b9445d5
2016-02-26 07:00:38 -05:00
jenkins-bot cc87b9a35f Merge "Bidi-embed formatter user names (the $1 parameter) in notification messages" 2016-02-25 18:46:02 +00:00
jenkins-bot 04522752ed Merge "Notification: use speechBubbles icon for all talk pages" 2016-02-24 21:43:26 +00:00
Roan Kattouw e7cd68baf1 Bidi-embed formatter user names (the $1 parameter) in notification messages
Bug: T127407
Change-Id: I51fdbdfd0a706f21f36513b1e8beeeddffe8bec7
2016-02-24 13:34:53 -08:00
jenkins-bot 656d6c401c Merge "Handle null user when trying to generate a link for notifications" 2016-02-24 21:29:25 +00:00
Stephane Bisson 3e028b8b1d Add 'Log' link to user-rights notification
Bug: T127249
Change-Id: I0ee20fefa2241d2858e6473bb709dce9519b82d4
2016-02-24 13:23:34 -05:00
Stephane Bisson f1e68f9451 Handle null user when trying to generate a link for notifications
Bug: T127728
Change-Id: I87de2d10887216e3edf53c2972b6bf230191f0ea
2016-02-24 11:42:03 -05:00
jenkins-bot ac952bf5e8 Merge "Add GENDER support to 'View changes'" 2016-02-23 20:45:35 +00:00
Stephane Bisson a73d63d1a4 Echo API returns absolute URLs in notification links
Some notifications return relative urls in their
primary or secondary links. This change makes those
urls absolute so they point to the right wiki
when viewed from another wiki (cross-wiki notifications).

Bug: T125738
Bug: T127697
Change-Id: Ib65337430eb2484f9491668a9998deef70589fb1
2016-02-23 17:54:26 +00:00
Matthias Mullie 4715b55471 Add GENDER support to 'View changes'
Change-Id: I42b8b253b8b865c081ba1aec62848afadd21e0f4
2016-02-23 17:56:16 +01:00
Stephane Bisson 860404eded Notification: use speechBubbles icon for all talk pages
Bug: T56433
Change-Id: I14e1af9dda1c08e1526fde59072f93189ab0b0d0
2016-02-23 06:53:55 -05:00
Matthias Mullie 3979919087 Display human-readable wiki names for cross-wiki notifications
Bug: T121936
Change-Id: Ic14fe65f4ecc6db94fc6774ca0c39d1c2a47db9d
2016-02-22 20:09:53 +01:00
Matthew Flaschen 4b316438a5 Fix 'Undefined index' PHP warning so XDebug doesn't complain
Change-Id: Id8f8113bcdc454d5df09a20175c7698791b71fba
2016-02-19 05:09:45 +00:00
Stephane Bisson 74879c39fb Truncate secondary link labels
Bug: T121822
Change-Id: I3e36a6cd4bc8da96879158e1d7b65fd3a1d582fb
2016-02-18 06:55:36 -05:00
jenkins-bot d1830041af Merge "Include reason in user-rights notification body" 2016-02-16 17:59:12 +00:00
Stephane Bisson dff7e8072b Include reason in user-rights notification body
Bug: T126277
Depends-On: Ib9bb28a7a77602e3e729fd0bf13ab8259e15b006
Change-Id: I4941c4ba16ee95798767d858792090609b47b4e4
2016-02-16 01:51:07 +00:00
Stephane Bisson 98861d059a Truncate section names to 50 char
Bug: T121822
Change-Id: I6220fdfb2ad20cfe9935895a2f5a16727d6cbc01
2016-02-15 15:59:00 -05:00
jenkins-bot 33ee3ebf80 Merge "Have EventPresentationModel implement JsonSerializable" 2016-02-13 07:23:50 +00:00
jenkins-bot 5019802f29 Merge "Introduce congratulatory notifications for reaching edit thresholds" 2016-02-12 22:19:04 +00:00
Kunal Mehta 7f981670a3 Have EventPresentationModel implement JsonSerializable
Change-Id: I25a9ba9371ccf6c246de21fbb2c880441e051090
2016-02-12 14:15:23 -08:00
James D. Forrester 5031539327 Introduce congratulatory notifications for reaching edit thresholds
Bug: T124003
Change-Id: I21c6570e178fd03d969a516bdb31a6da9735d242
2016-02-12 14:11:21 -08:00
Stephane Bisson 09928f1ed2 Add email body preview to emailuser notification
when the subject line is left with the default
generated value, we take the begining of the
email content to add a preview in the
notification.

Bug: T121831
Change-Id: Ib7c646f6709c7100ef51186f84fe14807d6a211a
2016-02-12 14:50:17 -05:00
jenkins-bot 202afb8227 Merge "Truncate usernames to 20 char in notifications" 2016-02-11 19:02:21 +00:00
Stephane Bisson 442f812774 Add subject to email notification body
Bug: T121831
Change-Id: Ib1a9212202d2c84de8d968d043f65e24b2d94fae
2016-02-10 12:34:26 -05:00
Stephane Bisson 961968ff56 Truncate usernames to 20 char in notifications
Bug: T121822
Change-Id: Ie9650b5c72f2224dc6d26b3bfc45f29cbbd23397
2016-02-09 13:46:39 -05:00
jenkins-bot ccebb42186 Merge "Get rid of old flyout formatter code" 2016-02-09 18:34:36 +00:00
jenkins-bot f9b8202f4f Merge "Use current HTML formatter (for special page) instead of previous" 2016-02-09 18:22:33 +00:00
Stephane Bisson f7b0637d59 Fix 'user-rights' notification messages
Bug: T121661
Change-Id: I5b73001f2f748a39c3b28f6b571f076a51f8f785
2016-02-08 08:45:10 -05:00
Matthias Mullie 9fe71a1182 Get rid of old flyout formatter code
This code is completely useless:
* for format=flyout, the new EchoFlyoutFormatter.php will be run
* and even that one has already been deprecated as it was replaced
  by format=model (flyout html is now built in client)

Change-Id: Iea23abb66397ecc4efb575fe33fdbedc5b4e0f70
2016-02-05 06:56:15 +00:00