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
d6697e0b
Commit
d6697e0b
authored
May 08, 2017
by
Tim Zallmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Created Application Helpers based on suggestion for easier parsing
parent
d5049022
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
2 deletions
+21
-2
app/helpers/application_helper.rb
app/helpers/application_helper.rb
+19
-0
app/views/users/show.html.haml
app/views/users/show.html.haml
+2
-2
No files found.
app/helpers/application_helper.rb
View file @
d6697e0b
...
@@ -278,4 +278,23 @@ module ApplicationHelper
...
@@ -278,4 +278,23 @@ module ApplicationHelper
def
show_user_callout?
def
show_user_callout?
cookies
[
:user_callout_dismissed
]
==
'true'
cookies
[
:user_callout_dismissed
]
==
'true'
end
end
def
linkedin_url
(
user
)
name
=
user
.
linkedin
if
name
=~
%r{
\A
https?:
\/\/
(www
\.
)?linkedin
\.
com
\/
in
\/
(.*)
\z
}
name
else
"https://www.linkedin.com/in/
#{
name
}
"
end
end
def
twitter_url
(
user
)
name
=
user
.
twitter
if
name
=~
%r{
\A
https?:
\/\/
(www
\.
)?twitter
\.
com
\/
(.*)
\z
}
name
else
"https://www.twitter.com/
#{
name
}
"
end
end
end
end
app/views/users/show.html.haml
View file @
d6697e0b
...
@@ -56,11 +56,11 @@
...
@@ -56,11 +56,11 @@
=
icon
(
'skype'
)
=
icon
(
'skype'
)
-
unless
@user
.
linkedin
.
blank?
-
unless
@user
.
linkedin
.
blank?
.profile-link-holder.middle-dot-divider
.profile-link-holder.middle-dot-divider
=
link_to
"https://www.linkedin.com/in/
#{
@user
.
linkedin
.
gsub
(
/https:\/\/www.linkedin.com\/in\//i
,
''
)
}
"
,
title:
"LinkedIn"
do
=
link_to
linkedin_url
(
@user
)
,
title:
"LinkedIn"
do
=
icon
(
'linkedin-square'
)
=
icon
(
'linkedin-square'
)
-
unless
@user
.
twitter
.
blank?
-
unless
@user
.
twitter
.
blank?
.profile-link-holder.middle-dot-divider
.profile-link-holder.middle-dot-divider
=
link_to
"https://twitter.com/
#{
@user
.
twitter
.
gsub
(
/https:\/\/twitter.com\//i
,
''
)
}
"
,
title:
"Twitter"
do
=
link_to
twitter_url
(
@user
)
,
title:
"Twitter"
do
=
icon
(
'twitter-square'
)
=
icon
(
'twitter-square'
)
-
unless
@user
.
website_url
.
blank?
-
unless
@user
.
website_url
.
blank?
.profile-link-holder.middle-dot-divider
.profile-link-holder.middle-dot-divider
...
...
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