Commit graph

14 commits

Author SHA1 Message Date
hhoopes
a761c59a6b Add keyword arguments to truncated_diff method
* Added keyword arguments to truncated_diff_lines method to allow for using highlighting or not (html templates vs. text)
* Tweaked templates for consistency and format appropriateness
2016-11-25 15:23:49 +00:00
hhoopes
f928dba99b Change diff highlight/truncate for reusability
Previously the `truncated_diff_lines` method for outputting a discussion diff took in already highlighted lines, which meant it wasn't reuseable for truncating ANY lines. In the way it was used, it also meant that for any email truncation, the whole diff was being highlighted before being truncated, meaning wasted time highlighting lines that wouldn't even be used (granted, they were being memoized, so perhaps this wasn't that great of an issue). I refactored truncation away from highlighting, in order to truncate formatted diffs for text templates in email, using `>`s to designate each line, but otherwise retaining the parsing already done to create `diff_lines`.

Additionally, while notes on merge requests or commits had already been tested, there was no existing test for notes on a diff on an MR or commit. Added mailer tests for such, and a unit test for truncating diff lines.
2016-11-25 15:23:49 +00:00
hhoopes
24070bac45 Add new template to handle both commit & mr notes
Currently comments on commits and merge requests do not require merge request- or commit-specific information, but can use the same template. Rather than change the method which calls the template, I opted to keep the templates separate and create a new template to highlight their identicality, while preserving the option to distinguish them from each other in the future.

Also removed some of the inconsistencies between text and html email versions.

Still needed is a text-only version of git diffs and testing.
2016-11-25 15:23:49 +00:00
Pierre de La Morinerie
edd6028bdb Remove custom link to target in notification emails
Every email has a different way of showing a link to the discussion on
the website. We don't need this anymore, as we now have a standard
"View in GitLab" link in the footer of every email.
2014-03-03 16:58:44 +01:00
Dmitriy Zaporozhets
b1e425511f restyle and cleanup emails 2013-03-12 10:46:04 +02:00
Robert Speicher
7754189187 Fully embrace Ruby 1.9 hash syntax
Didn't bother with files in db/, config/, or features/
2012-08-10 18:25:15 -04:00
Riyad Preukschas
5443021a0e Update notifications mails and notify specs for GFM 2012-08-06 05:08:22 +02:00
RickXing
4c503be0f1 fix bug in mailer 2012-05-17 14:30:24 +08:00
Robb Kidd
0a9a2c2a0b Make Notify#note_commit_email resque friendly
Update method to take ids and then perform #finds itself during mailer
queue worker kick-off. Also, the faux SHA1 cannot have underscores or
it will not match the commit pattern defined in the routes.
2012-05-15 22:37:34 -04:00
gitlabhq
d97a9aa4a4 fixed email markdown 2012-04-23 15:32:56 +03:00
root
3f4eb731df Fixed a typo by the third n in 'commit'. 2012-02-13 20:41:16 +02:00
Dmitriy Zaporozhets
41d439401d enable markdown for email notification 2012-02-13 20:40:39 +02:00
gitlabhq
876ebbd9ad issue #89 2011-10-15 19:46:27 +03:00
gitlabhq
9ba1224867 init commit 2011-10-09 00:36:38 +03:00