Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kazuhiko Shiozaki
gitlab-ce
Commits
e460e04e
Commit
e460e04e
authored
Jan 16, 2015
by
Hannes Rosenögger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Diff syntax colors for email-on-push notifications
parent
ada6c608
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
3 deletions
+13
-3
CHANGELOG
CHANGELOG
+1
-1
app/helpers/emails_helper.rb
app/helpers/emails_helper.rb
+10
-0
app/views/layouts/notify.html.haml
app/views/layouts/notify.html.haml
+1
-1
app/views/notify/repository_push_email.html.haml
app/views/notify/repository_push_email.html.haml
+1
-1
No files found.
CHANGELOG
View file @
e460e04e
...
@@ -5,7 +5,7 @@ v 7.8.0
...
@@ -5,7 +5,7 @@ v 7.8.0
-
-
-
-
-
-
-
-
Add diff syntax highlighting in email-on-push service notifications (Hannes Rosenögger)
-
-
-
-
-
-
...
...
app/helpers/emails_helper.rb
View file @
e460e04e
...
@@ -29,4 +29,14 @@ module EmailsHelper
...
@@ -29,4 +29,14 @@ module EmailsHelper
end
end
end
end
end
end
def
add_email_highlight_css
Rugments
::
Themes
::
Github
.
render
(
:scope
=>
'.highlight'
)
end
def
color_email_diff
(
diffcontent
)
formatter
=
Rugments
::
Formatters
::
HTML
.
new
(
cssclass:
'highlight'
)
lexer
=
Rugments
::
Lexers
::
Diff
.
new
raw
formatter
.
format
(
lexer
.
lex
(
diffcontent
))
end
end
end
app/views/layouts/notify.html.haml
View file @
e460e04e
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
font-size
:
small
;
font-size
:
small
;
color
:
#777
color
:
#777
}
}
#{
add_email_highlight_css
}
%body
%body
%div
.content
%div
.content
=
yield
=
yield
...
...
app/views/notify/repository_push_email.html.haml
View file @
e460e04e
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
=
diff
.
new_path
||
diff
.
old_path
=
diff
.
new_path
||
diff
.
old_path
%hr
%hr
%pre
%pre
=
diff
.
diff
=
color_email_diff
(
diff
.
diff
)
%br
%br
-
if
@compare
.
timeout
-
if
@compare
.
timeout
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment