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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
2421cb4f
Commit
2421cb4f
authored
Jun 23, 2021
by
Zhu Shung
Committed by
Mark Chao
Jun 23, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modify some email assets configurations to enable putting images outside assets
parent
450bd790
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
10 deletions
+20
-10
config/application.rb
config/application.rb
+16
-6
spec/helpers/emails_helper_spec.rb
spec/helpers/emails_helper_spec.rb
+4
-4
No files found.
config/application.rb
View file @
2421cb4f
...
...
@@ -385,7 +385,15 @@ module Gitlab
initializer
:correct_precompile_targets
,
after: :set_default_precompile
do
|
app
|
app
.
config
.
assets
.
precompile
.
reject!
{
|
entry
|
entry
==
Sprockets
::
Railtie
::
LOOSE_APP_ASSETS
}
asset_roots
=
[
config
.
root
.
join
(
"app/assets"
).
to_s
]
# if two files in assets are named the same, it'll likely resolve to the normal app/assets version.
# See https://gitlab.com/gitlab-jh/gitlab/-/merge_requests/27#note_609101582 for more details
asset_roots
=
[]
if
Gitlab
.
jh?
asset_roots
<<
config
.
root
.
join
(
"jh/app/assets"
).
to_s
end
asset_roots
<<
config
.
root
.
join
(
"app/assets"
).
to_s
if
Gitlab
.
ee?
asset_roots
<<
config
.
root
.
join
(
"ee/app/assets"
).
to_s
...
...
@@ -413,16 +421,18 @@ module Gitlab
end
end
# Add EE assets. They should take precedence over CE. This means if two files exist, e.g.:
# Add assets for variants of GitLab. They should take precedence over CE.
# This means if multiple files exist, e.g.:
#
# jh/app/assets/stylesheets/example.scss
# ee/app/assets/stylesheets/example.scss
# app/assets/stylesheets/example.scss
#
# The
ee
/ version will be preferred.
initializer
:prefer_
ee
_assets
,
after: :append_assets_path
do
|
app
|
if
Gitlab
.
ee?
# The
jh
/ version will be preferred.
initializer
:prefer_
specialized
_assets
,
after: :append_assets_path
do
|
app
|
Gitlab
.
extensions
.
each
do
|
extension
|
%w[images javascripts stylesheets]
.
each
do
|
path
|
app
.
config
.
assets
.
paths
.
unshift
(
"
#{
config
.
root
}
/
ee
/app/assets/
#{
path
}
"
)
app
.
config
.
assets
.
paths
.
unshift
(
"
#{
config
.
root
}
/
#{
extension
}
/app/assets/
#{
path
}
"
)
end
end
end
...
...
spec/helpers/emails_helper_spec.rb
View file @
2421cb4f
...
...
@@ -238,16 +238,16 @@ RSpec.describe EmailsHelper do
it
'returns the default header logo'
do
create
:appearance
,
header_logo:
nil
expect
(
header_logo
).
to
eq
(
%
{<img alt="GitLab" src="/images/mailers/gitlab_header_logo.gif" width="55" height="50
" />}
expect
(
header_logo
).
to
match
(
%
r{<img alt="GitLab" src="/images/mailers/gitlab_header_logo
\.
(?:gif|png)" width="
\d
+" height="
\d
+
" />}
)
end
end
context
'there is no brand item'
do
it
'returns the default header logo'
do
expect
(
header_logo
).
to
eq
(
%
{<img alt="GitLab" src="/images/mailers/gitlab_header_logo.gif" width="55" height="50
" />}
expect
(
header_logo
).
to
match
(
%
r{<img alt="GitLab" src="/images/mailers/gitlab_header_logo
\.
(?:gif|png)" width="
\d
+" height="
\d
+
" />}
)
end
end
...
...
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