BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
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
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
2 deletions
+21
-2
application_helper.rb
app/helpers/application_helper.rb
+19
-0
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
def
show_user_callout?
cookies
[
:user_callout_dismissed
]
==
'true'
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
app/views/users/show.html.haml
View file @
d6697e0b
...
...
@@ -56,11 +56,11 @@
=
icon
(
'skype'
)
-
unless
@user
.
linkedin
.
blank?
.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'
)
-
unless
@user
.
twitter
.
blank?
.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'
)
-
unless
@user
.
website_url
.
blank?
.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