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
195295b9
Commit
195295b9
authored
Jul 15, 2019
by
Peter Dave Hello
Committed by
Lin Jen-Shin
Jul 15, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add more file extentions to file type icon class
parent
920fc2e3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
9 deletions
+32
-9
app/helpers/icons_helper.rb
app/helpers/icons_helper.rb
+12
-9
spec/helpers/icons_helper_spec.rb
spec/helpers/icons_helper_spec.rb
+20
-0
No files found.
app/helpers/icons_helper.rb
View file @
195295b9
...
...
@@ -122,27 +122,30 @@ module IconsHelper
icon_class
=
'file-pdf-o'
when
'.jpg'
,
'.jpeg'
,
'.jif'
,
'.jfif'
,
'.jp2'
,
'.jpx'
,
'.j2k'
,
'.j2c'
,
'.png'
,
'.gif'
,
'.tif'
,
'.tiff'
,
'.svg'
,
'.ico'
,
'.bmp'
'.
apng'
,
'.
png'
,
'.gif'
,
'.tif'
,
'.tiff'
,
'.svg'
,
'.ico'
,
'.bmp'
,
'.webp'
icon_class
=
'file-image-o'
when
'.zip'
,
'.zipx'
,
'.tar'
,
'.gz'
,
'.bz'
,
'.bzip'
,
'.xz'
,
'.rar'
,
'.7z'
when
'.zip'
,
'.zipx'
,
'.tar'
,
'.gz'
,
'.gzip'
,
'.tgz'
,
'.bz'
,
'.bzip'
,
'.bz2'
,
'.bzip2'
,
'.car'
,
'.tbz'
,
'.xz'
,
'txz'
,
'.rar'
,
'.7z'
,
'.lz'
,
'.lzma'
,
'.tlz'
icon_class
=
'file-archive-o'
when
'.mp3'
,
'.wma'
,
'.ogg'
,
'.oga'
,
'.wav'
,
'.flac'
,
'.aac'
when
'.mp3'
,
'.wma'
,
'.ogg'
,
'.oga'
,
'.wav'
,
'.flac'
,
'.aac'
,
'.3ga'
,
'.ac3'
,
'.midi'
,
'.m4a'
,
'.ape'
,
'.mpa'
icon_class
=
'file-audio-o'
when
'.mp4'
,
'.m4p'
,
'.m4v'
,
'.mpg'
,
'.mp2'
,
'.mpeg'
,
'.mpe'
,
'.mpv'
,
'.mpg'
,
'.mpeg'
,
'.m2v'
,
'.mpg'
,
'.mpeg'
,
'.m2v'
,
'.m2ts'
,
'.avi'
,
'.mkv'
,
'.flv'
,
'.ogv'
,
'.mov'
,
'.3gp'
,
'.3g2'
icon_class
=
'file-video-o'
when
'.doc'
,
'.dot'
,
'.docx'
,
'.docm'
,
'.dotx'
,
'.dotm'
,
'.docb'
when
'.doc'
,
'.dot'
,
'.docx'
,
'.docm'
,
'.dotx'
,
'.dotm'
,
'.docb'
,
'.odt'
,
'.ott'
,
'.uot'
,
'.rtf'
icon_class
=
'file-word-o'
when
'.xls'
,
'.xlt'
,
'.xlm'
,
'.xlsx'
,
'.xlsm'
,
'.xltx'
,
'.xltm'
,
'.xlsb'
,
'.xla'
,
'.xlam'
,
'.xll'
,
'.xlw'
'.xlsb'
,
'.xla'
,
'.xlam'
,
'.xll'
,
'.xlw'
,
'.ots'
,
'.ods'
,
'.uos'
icon_class
=
'file-excel-o'
when
'.ppt'
,
'.pot'
,
'.pps'
,
'.pptx'
,
'.pptm'
,
'.potx'
,
'.potm'
,
'.ppam'
,
'.ppsx'
,
'.ppsm'
,
'.sldx'
,
'.sldm'
'.ppam'
,
'.ppsx'
,
'.ppsm'
,
'.sldx'
,
'.sldm'
,
'.odp'
,
'.otp'
,
'.uop'
icon_class
=
'file-powerpoint-o'
else
icon_class
=
'file-text-o'
...
...
spec/helpers/icons_helper_spec.rb
View file @
195295b9
...
...
@@ -125,6 +125,14 @@ describe IconsHelper do
expect
(
file_type_icon_class
(
'file'
,
0
,
'filename.png'
)).
to
eq
'file-image-o'
end
it
'returns file-image-o class with .apng'
do
expect
(
file_type_icon_class
(
'file'
,
0
,
'filename.apng'
)).
to
eq
'file-image-o'
end
it
'returns file-image-o class with .webp'
do
expect
(
file_type_icon_class
(
'file'
,
0
,
'filename.webp'
)).
to
eq
'file-image-o'
end
it
'returns file-archive-o class with .tar'
do
expect
(
file_type_icon_class
(
'file'
,
0
,
'filename.tar'
)).
to
eq
'file-archive-o'
end
...
...
@@ -145,6 +153,10 @@ describe IconsHelper do
expect
(
file_type_icon_class
(
'file'
,
0
,
'filename.MP3'
)).
to
eq
'file-audio-o'
end
it
'returns file-audio-o class with .m4a'
do
expect
(
file_type_icon_class
(
'file'
,
0
,
'filename.m4a'
)).
to
eq
'file-audio-o'
end
it
'returns file-audio-o class with .wav'
do
expect
(
file_type_icon_class
(
'file'
,
0
,
'filename.wav'
)).
to
eq
'file-audio-o'
end
...
...
@@ -161,6 +173,10 @@ describe IconsHelper do
expect
(
file_type_icon_class
(
'file'
,
0
,
'filename.mp4'
)).
to
eq
'file-video-o'
end
it
'returns file-word-o class with .odt'
do
expect
(
file_type_icon_class
(
'file'
,
0
,
'filename.odt'
)).
to
eq
'file-word-o'
end
it
'returns file-word-o class with .doc'
do
expect
(
file_type_icon_class
(
'file'
,
0
,
'filename.doc'
)).
to
eq
'file-word-o'
end
...
...
@@ -185,6 +201,10 @@ describe IconsHelper do
expect
(
file_type_icon_class
(
'file'
,
0
,
'filename.xlsx'
)).
to
eq
'file-excel-o'
end
it
'returns file-excel-o class with .odp'
do
expect
(
file_type_icon_class
(
'file'
,
0
,
'filename.odp'
)).
to
eq
'file-powerpoint-o'
end
it
'returns file-excel-o class with .ppt'
do
expect
(
file_type_icon_class
(
'file'
,
0
,
'filename.ppt'
)).
to
eq
'file-powerpoint-o'
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