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
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
8633bbc9
Commit
8633bbc9
authored
Jan 28, 2015
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add `icon` helper method
parent
8eb365c0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
5 deletions
+14
-5
app/helpers/icons_helper.rb
app/helpers/icons_helper.rb
+14
-5
No files found.
app/helpers/icons_helper.rb
View file @
8633bbc9
module
IconsHelper
# Creates an icon tag given icon name(s) and possible icon modifiers.
#
# Right now this method simply delegates directly to `fa_icon` from the
# font-awesome-rails gem, but should we ever use a different icon pack in the
# future we won't have to change hundreds of method calls.
def
icon
(
names
,
options
=
{})
fa_icon
(
names
,
options
)
end
def
boolean_to_icon
(
value
)
if
value
.
to_s
==
"true"
content_tag
:i
,
nil
,
class:
'fa fa-circle cgreen'
icon
(
'circle'
,
class:
'cgreen'
)
else
content_tag
:i
,
nil
,
class:
'fa fa-power-off clgray'
icon
(
'power-off'
,
class:
'clgray'
)
end
end
def
public_icon
content_tag
:i
,
nil
,
class:
'fa fa-globe'
icon
(
'globe'
)
end
def
internal_icon
content_tag
:i
,
nil
,
class:
'fa fa-shield'
icon
(
'shield'
)
end
def
private_icon
content_tag
:i
,
nil
,
class:
'fa fa-lock'
icon
(
'lock'
)
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