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
0f785bbc
Commit
0f785bbc
authored
Aug 05, 2015
by
Ben Bodenmiller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ink to configured gravatar host on profile page
parent
88a3cfe1
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
2 deletions
+19
-2
CHANGELOG
CHANGELOG
+1
-0
app/views/profiles/show.html.haml
app/views/profiles/show.html.haml
+2
-2
config/initializers/1_settings.rb
config/initializers/1_settings.rb
+10
-0
features/profile/profile.feature
features/profile/profile.feature
+2
-0
features/steps/profile/profile.rb
features/steps/profile/profile.rb
+4
-0
No files found.
CHANGELOG
View file @
0f785bbc
...
@@ -28,6 +28,7 @@ v 7.14.0 (unreleased)
...
@@ -28,6 +28,7 @@ v 7.14.0 (unreleased)
- Show buttons to add license, changelog and contribution guide if they're missing.
- Show buttons to add license, changelog and contribution guide if they're missing.
- Disabled autocapitalize and autocorrect on login field (Daryl Chan)
- Disabled autocapitalize and autocorrect on login field (Daryl Chan)
- Mention group and project name in creation, update and deletion notices (Achilleas Pipinellis)
- Mention group and project name in creation, update and deletion notices (Achilleas Pipinellis)
- Update gravatar link on profile page to link to configured gravatar host (Ben Bodenmiller)
- Remove redis-store TTL monkey patch
- Remove redis-store TTL monkey patch
v 7.13.2
v 7.13.2
...
...
app/views/profiles/show.html.haml
View file @
0f785bbc
...
@@ -82,12 +82,12 @@
...
@@ -82,12 +82,12 @@
You can change your avatar here
You can change your avatar here
-
if
Gitlab
.
config
.
gravatar
.
enabled
-
if
Gitlab
.
config
.
gravatar
.
enabled
%br
%br
or remove the current avatar to revert to
#{
link_to
"gravatar.com"
,
"http://gravatar.com"
}
or remove the current avatar to revert to
#{
link_to
Gitlab
.
config
.
gravatar
.
host
,
"http://"
+
Gitlab
.
config
.
gravatar
.
host
}
-
else
-
else
You can upload an avatar here
You can upload an avatar here
-
if
Gitlab
.
config
.
gravatar
.
enabled
-
if
Gitlab
.
config
.
gravatar
.
enabled
%br
%br
or change it at
#{
link_to
"gravatar.com"
,
"http://gravatar.com"
}
or change it at
#{
link_to
Gitlab
.
config
.
gravatar
.
host
,
"http://"
+
Gitlab
.
config
.
gravatar
.
host
}
%hr
%hr
%a
.choose-btn.btn.btn-sm.js-choose-user-avatar-button
%a
.choose-btn.btn.btn-sm.js-choose-user-avatar-button
%i
.fa.fa-paperclip
%i
.fa.fa-paperclip
...
...
config/initializers/1_settings.rb
View file @
0f785bbc
...
@@ -8,6 +8,15 @@ class Settings < Settingslogic
...
@@ -8,6 +8,15 @@ class Settings < Settingslogic
def
gitlab_on_standard_port?
def
gitlab_on_standard_port?
gitlab
.
port
.
to_i
==
(
gitlab
.
https
?
443
:
80
)
gitlab
.
port
.
to_i
==
(
gitlab
.
https
?
443
:
80
)
end
end
# get host without www, thanks to http://stackoverflow.com/a/6674363/1233435
def
get_host_without_www
(
url
)
url
=
URI
.
encode
(
url
)
uri
=
URI
.
parse
(
url
)
uri
=
URI
.
parse
(
"http://
#{
url
}
"
)
if
uri
.
scheme
.
nil?
host
=
uri
.
host
.
downcase
host
.
start_with?
(
'www.'
)
?
host
[
4
..-
1
]
:
host
end
private
private
...
@@ -147,6 +156,7 @@ Settings['gravatar'] ||= Settingslogic.new({})
...
@@ -147,6 +156,7 @@ Settings['gravatar'] ||= Settingslogic.new({})
Settings
.
gravatar
[
'enabled'
]
=
true
if
Settings
.
gravatar
[
'enabled'
].
nil?
Settings
.
gravatar
[
'enabled'
]
=
true
if
Settings
.
gravatar
[
'enabled'
].
nil?
Settings
.
gravatar
[
'plain_url'
]
||=
'http://www.gravatar.com/avatar/%{hash}?s=%{size}&d=identicon'
Settings
.
gravatar
[
'plain_url'
]
||=
'http://www.gravatar.com/avatar/%{hash}?s=%{size}&d=identicon'
Settings
.
gravatar
[
'ssl_url'
]
||=
'https://secure.gravatar.com/avatar/%{hash}?s=%{size}&d=identicon'
Settings
.
gravatar
[
'ssl_url'
]
||=
'https://secure.gravatar.com/avatar/%{hash}?s=%{size}&d=identicon'
Settings
.
gravatar
[
'host'
]
=
Settings
.
get_host_without_www
(
Settings
.
gravatar
[
'plain_url'
])
#
#
# GitLab Shell
# GitLab Shell
...
...
features/profile/profile.feature
View file @
0f785bbc
...
@@ -35,6 +35,7 @@ Feature: Profile
...
@@ -35,6 +35,7 @@ Feature: Profile
Then
I change my avatar
Then
I change my avatar
And
I should see new avatar
And
I should see new avatar
And
I should see the
"Remove avatar"
button
And
I should see the
"Remove avatar"
button
And
I should see the gravatar host link
Scenario
:
I
remove my avatar
Scenario
:
I
remove my avatar
Given
I visit profile page
Given
I visit profile page
...
@@ -42,6 +43,7 @@ Feature: Profile
...
@@ -42,6 +43,7 @@ Feature: Profile
When
I remove my avatar
When
I remove my avatar
Then
I should see my gravatar
Then
I should see my gravatar
And
I should not see the
"Remove avatar"
button
And
I should not see the
"Remove avatar"
button
And
I should see the gravatar host link
Scenario
:
My password is expired
Scenario
:
My password is expired
Given
my password is expired
Given
my password is expired
...
...
features/steps/profile/profile.rb
View file @
0f785bbc
...
@@ -59,6 +59,10 @@ class Spinach::Features::Profile < Spinach::FeatureSteps
...
@@ -59,6 +59,10 @@ class Spinach::Features::Profile < Spinach::FeatureSteps
step
'I should not see the "Remove avatar" button'
do
step
'I should not see the "Remove avatar" button'
do
expect
(
page
).
not_to
have_link
(
"Remove avatar"
)
expect
(
page
).
not_to
have_link
(
"Remove avatar"
)
end
end
step
'I should see the gravatar host link'
do
expect
(
page
).
to
have_link
(
"gravatar.com"
)
end
step
'I try change my password w/o old one'
do
step
'I try change my password w/o old one'
do
page
.
within
'.update-password'
do
page
.
within
'.update-password'
do
...
...
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