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
d2620faf
Commit
d2620faf
authored
Oct 05, 2017
by
Tim Zallmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updates based on MR comments
parent
27577e8e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
16 deletions
+19
-16
app/helpers/application_helper.rb
app/helpers/application_helper.rb
+9
-6
app/helpers/lazy_image_tag_helper.rb
app/helpers/lazy_image_tag_helper.rb
+7
-5
app/models/concerns/avatarable.rb
app/models/concerns/avatarable.rb
+3
-5
No files found.
app/helpers/application_helper.rb
View file @
d2620faf
...
...
@@ -41,12 +41,15 @@ module ApplicationHelper
end
if
project
.
avatar_url
if
project
.
private?
options
[
:use_original_source
]
=
true
image_tag
project
.
avatar_url
(
use_asset_path:
false
),
options
else
image_tag
project
.
avatar_url
,
options
end
#if project.private?
# options[:use_original_source] = true
# image_tag project.avatar_url(use_asset_path: false), options
#else
# image_tag project.avatar_url, options
#end
image_tag
project
.
avatar_url
(
use_asset_path:
project
.
public?
),
options
else
# generated icon
project_identicon
(
project
,
options
)
end
...
...
app/helpers/lazy_image_tag_helper.rb
View file @
d2620faf
...
...
@@ -9,11 +9,13 @@ module LazyImageTagHelper
unless
options
.
delete
(
:lazy
)
==
false
options
[
:data
]
||=
{}
options
[
:data
][
:src
]
=
if
options
.
delete
(
:use_original_source
)
source
else
path_to_image
(
source
)
end
#options[:data][:src] = if options.delete(:use_original_source)
# source
# else
# path_to_image(source)
# end
options
[
:data
][
:src
]
=
path_to_image
(
source
)
options
[
:class
]
||=
""
options
[
:class
]
<<
" lazy"
...
...
app/models/concerns/avatarable.rb
View file @
d2620faf
...
...
@@ -9,11 +9,9 @@ module Avatarable
asset_host
=
ActionController
::
Base
.
asset_host
gitlab_host
=
only_path
?
gitlab_config
.
relative_url_root
:
gitlab_config
.
url
if
use_asset_path
# If asset_host is set then it is expected that assets are handled by a standalone host.
# That means we do not want to get GitLab's relative_url_root option anymore.
host
=
asset_host
.
present?
?
asset_host
:
gitlab_host
end
host
=
(
asset_host
.
present?
&&
use_asset_path
)
?
asset_host
:
gitlab_host
[
host
,
avatar
.
url
].
join
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