Merge pull request #2974 from aignatov-bio/ai-sci-5230-fix-icon-for-assets

Add new icons for assets [SCI-5230]
This commit is contained in:
aignatov-bio 2020-11-25 09:27:09 +01:00 committed by GitHub
commit fa8b7d28f9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 264 additions and 17 deletions

View file

@ -0,0 +1,61 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24">
<g clip-path="url(#clip0)">
<path fill="#fff" d="M19.715 20.571H6.857V3.43h9l3.858 3.857V20.57z"/>
<path fill="#949494" d="M15.857 3H6.428v18h13.715V7.286L15.857 3zm0 .643L19.5 7.286h-3.643V3.643zm3.857 16.928H6.857V3.43h8.572v4.285h4.285v12.857z"/>
<path fill="#C8C8C8" d="M18.428 9h-6.857v.428h6.857V9zM18.428 10.286h-6.857v.428h6.857v-.428zM18.428 11.571h-6.857V12h6.857v-.429zM18.428 12.857h-6.857v.429h6.857v-.429zM18.428 14.143h-6.857v.428h6.857v-.428zM18.428 15.429h-6.857v.428h6.857v-.428zM18.428 16.714h-6.857v.429h6.857v-.429zM18.428 18h-6.857v.428h6.857V18zM11.571 4.714H8.143v.429h3.428v-.429z"/>
<path fill="#2B579A" d="M3 9l8.571-1.286v11.143L3 17.571V9z"/>
<path fill="#fff" d="M10.286 11.143l-1.124 4.286H8.099l-.706-2.75c-.038-.143-.06-.304-.068-.481h-.012c-.018.195-.044.355-.077.481l-.724 2.75H5.405l-1.119-4.286h1.048l.599 2.854c.026.122.045.285.056.49h.018c.008-.153.037-.32.086-.502l.772-2.842H7.89l.698 2.878c.025.106.048.259.068.46h.012c.008-.157.028-.317.062-.478l.588-2.86h.967z"/>
<path fill="url(#paint0_linear)" d="M11.571 7.714L3 9v8.571l8.571 1.286V7.714z"/>
<path fill="url(#paint1_linear)" d="M11.571 20.143H6.428v-2.057l5.143.771v1.286z"/>
<path fill="url(#paint2_linear)" d="M20.143 7.286L15.857 3H6.428v18h13.715V7.286z"/>
<path fill="url(#paint3_linear)" d="M19.714 7.714H15.43V9h4.285V7.714z"/>
<path fill="url(#paint4_linear)" d="M6.428 3v.429h9v4.285h4.286v6h.429V7.286L15.857 3H6.428z"/>
</g>
<defs>
<linearGradient id="paint0_linear" x1="7.286" x2="7.286" y1="18.509" y2="8.039" gradientUnits="userSpaceOnUse">
<stop stop-color="#fff" stop-opacity="0"/>
<stop offset=".859" stop-color="#fff" stop-opacity=".155"/>
<stop offset="1" stop-color="#fff" stop-opacity=".18"/>
</linearGradient>
<linearGradient id="paint1_linear" x1="8.894" x2="9.076" y1="20.108" y2="18.398" gradientUnits="userSpaceOnUse">
<stop stop-color="#828282" stop-opacity="0"/>
<stop offset=".17" stop-color="#7E7E7E" stop-opacity=".034"/>
<stop offset=".346" stop-color="#717171" stop-opacity=".069"/>
<stop offset=".525" stop-color="#5D5D5D" stop-opacity=".105"/>
<stop offset=".706" stop-color="#404040" stop-opacity=".141"/>
<stop offset=".886" stop-color="#1B1B1B" stop-opacity=".178"/>
<stop offset=".997" stop-opacity=".2"/>
</linearGradient>
<linearGradient id="paint2_linear" x1="4.966" x2="19.495" y1="4.227" y2="21.543" gradientUnits="userSpaceOnUse">
<stop stop-color="#fff" stop-opacity="0"/>
<stop offset=".226" stop-color="#FCFCFC" stop-opacity=".023"/>
<stop offset=".363" stop-color="#F4F4F4" stop-opacity=".036"/>
<stop offset=".475" stop-color="#E6E6E6" stop-opacity=".048"/>
<stop offset=".574" stop-color="#D1D1D1" stop-opacity=".057"/>
<stop offset=".665" stop-color="#B7B7B7" stop-opacity=".067"/>
<stop offset=".75" stop-color="#979797" stop-opacity=".075"/>
<stop offset=".83" stop-color="#707070" stop-opacity=".083"/>
<stop offset=".906" stop-color="#444" stop-opacity=".091"/>
<stop offset=".976" stop-color="#121212" stop-opacity=".098"/>
<stop offset="1" stop-opacity=".1"/>
</linearGradient>
<linearGradient id="paint3_linear" x1="17.571" x2="17.571" y1="8.96" y2="7.752" gradientUnits="userSpaceOnUse">
<stop stop-color="#828282" stop-opacity="0"/>
<stop offset=".281" stop-color="#7F7F7F" stop-opacity=".028"/>
<stop offset=".45" stop-color="#777" stop-opacity=".045"/>
<stop offset=".59" stop-color="#696969" stop-opacity=".059"/>
<stop offset=".713" stop-color="#545454" stop-opacity=".071"/>
<stop offset=".826" stop-color="#3A3A3A" stop-opacity=".083"/>
<stop offset=".929" stop-color="#1A1A1A" stop-opacity=".093"/>
<stop offset="1" stop-opacity=".1"/>
</linearGradient>
<linearGradient id="paint4_linear" x1="14.687" x2="17.244" y1="6.956" y2="4.399" gradientUnits="userSpaceOnUse">
<stop stop-color="#fff" stop-opacity="0"/>
<stop offset=".854" stop-color="#fff" stop-opacity=".213"/>
<stop offset="1" stop-color="#fff" stop-opacity=".25"/>
</linearGradient>
<clipPath id="clip0">
<path fill="#fff" d="M0 0H24V24H0z"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 4.6 KiB

View file

@ -0,0 +1,10 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24">
<g clip-path="url(#clip0)">
<path fill="#0ECDC0" fill-rule="evenodd" d="M12.875 3v4.781c0 .492.352.844.844.844H18.5v11.531c0 .492-.387.844-.844.844H5.844C5.352 21 5 20.648 5 20.156V3.844C5 3.387 5.352 3 5.844 3h7.031zm5.379 3.691c.14.176.246.387.246.598V7.5H14V3h.21c.212 0 .423.105.599.246l3.445 3.445zm-8.97 5.602l2.613-1.508 2.612 1.508v1.338c0 .084.037.165.1.22l.197.172c.19.167.488.032.488-.22v-1.51c0-.28-.15-.54-.393-.68l-2.612-1.508c-.243-.14-.542-.14-.784 0l-2.613 1.508c-.242.14-.392.4-.392.68v3.016c0 .28.15.54.392.68l1.725.995c.204.118.467.03.558-.189.076-.182.005-.392-.166-.49l-1.725-.996v-3.016zm.393.135l.392-.196v3.138l-.392-.196v-2.746zm4.502.584l.026-.438-2.378-1.373-.366.242 2.718 1.569zm-.58 3.339v-1.962c0-.108-.088-.196-.196-.196-.108 0-.196.088-.196.196v3.138c0 .109-.088.196-.196.196-.108 0-.196-.087-.196-.196v-.246l-.166-.1c-.286-.184-.635-.038-.79.2-.043.067-.006.15.065.186.472.236.832.51.995.746.154.222.262.392.288.777.007.108-.082.197-.19.196-.108 0-.194-.088-.202-.196-.023-.329-.115-.568-.37-.777-.233-.192-.439-.356-.894-.587-.113-.058-.117-.244-.09-.334.133-.448.79-.873 1.354-.568v-2.435c0-.324.263-.588.588-.588.325 0 .588.264.588.588v1.373h.157c.264 0 .49.162.582.392h.203c.263 0 .489.163.582.393h.045c.434 0 .785.35.785.784v.98c0 .11-.088.197-.196.197-.108 0-.196-.088-.196-.196v-.98c0-.217-.176-.393-.393-.393v.196c0 .108-.087.196-.196.196-.108 0-.196-.088-.196-.196v-.353c0-.13-.105-.235-.235-.235h-.157v.196c0 .108-.088.196-.196.196-.108 0-.196-.088-.196-.196v-.353c0-.13-.106-.236-.236-.236h-.156v.197c0 .108-.088.196-.197.196-.108 0-.196-.088-.196-.196z" clip-rule="evenodd"/>
</g>
<defs>
<clipPath id="clip0">
<path fill="#fff" d="M0 0H24V24H0z"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

View file

@ -0,0 +1,62 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24">
<g clip-path="url(#clip0)">
<path fill="#fff" d="M19.715 20.571H6.857V3.43h9l3.858 3.857V20.57z"/>
<path fill="#F5BA9D" d="M13.714 6c1.894 0 3.429 1.535 3.429 3.429h-3.429V6z"/>
<path fill="#949494" d="M15.857 3H6.428v18h13.715V7.286L15.857 3zm0 .643L19.5 7.286h-3.643V3.643zm3.857 16.928H6.857V3.43h8.572v4.285h4.285v12.857z"/>
<path fill="#C8C8C8" d="M17.143 9.857c0 2.13-1.727 3.857-3.857 3.857s-3.857-1.726-3.857-3.857C9.429 7.727 11.156 6 13.286 6v3.857h3.857zM18.428 16.714h-6.857v.429h6.857v-.429zM18.428 15.429h-6.857v.428h6.857v-.428zM18.428 18h-6.857v.428h6.857V18z"/>
<path fill="#B7472A" d="M3 9l8.571-1.286v11.143L3 17.571V9z"/>
<path fill="#fff" d="M6.76 14.085v1.772H5.571v-5.143h1.863c1.33 0 1.994.547 1.994 1.64 0 .516-.19.934-.572 1.253-.381.319-.891.479-1.53.479H6.76zm0-2.481v1.603h.468c.633 0 .949-.27.949-.81 0-.529-.316-.793-.95-.793H6.76zM15.857 3.857v3.429h3.429l-3.429-3.429z"/>
<path fill="url(#paint0_linear)" d="M20.143 7.286L15.857 3H6.428v18h13.715V7.286z"/>
<path fill="url(#paint1_linear)" d="M19.714 7.714H15.43V9h4.285V7.714z"/>
<path fill="url(#paint2_linear)" d="M6.428 3v.429h9v4.285h4.286v6h.429V7.286L15.857 3H6.428z"/>
<path fill="url(#paint3_linear)" d="M11.571 20.143H6.428v-2.057l5.143.771v1.286z"/>
<path fill="url(#paint4_linear)" d="M11.571 7.714L3 9v8.571l8.571 1.286V7.714z"/>
</g>
<defs>
<linearGradient id="paint0_linear" x1="4.966" x2="19.495" y1="4.227" y2="21.543" gradientUnits="userSpaceOnUse">
<stop stop-color="#fff" stop-opacity="0"/>
<stop offset=".226" stop-color="#FCFCFC" stop-opacity=".023"/>
<stop offset=".363" stop-color="#F4F4F4" stop-opacity=".036"/>
<stop offset=".475" stop-color="#E6E6E6" stop-opacity=".048"/>
<stop offset=".574" stop-color="#D1D1D1" stop-opacity=".057"/>
<stop offset=".665" stop-color="#B7B7B7" stop-opacity=".067"/>
<stop offset=".75" stop-color="#979797" stop-opacity=".075"/>
<stop offset=".83" stop-color="#707070" stop-opacity=".083"/>
<stop offset=".906" stop-color="#444" stop-opacity=".091"/>
<stop offset=".976" stop-color="#121212" stop-opacity=".098"/>
<stop offset="1" stop-opacity=".1"/>
</linearGradient>
<linearGradient id="paint1_linear" x1="17.571" x2="17.571" y1="8.96" y2="7.752" gradientUnits="userSpaceOnUse">
<stop stop-color="#828282" stop-opacity="0"/>
<stop offset=".281" stop-color="#7F7F7F" stop-opacity=".028"/>
<stop offset=".45" stop-color="#777" stop-opacity=".045"/>
<stop offset=".59" stop-color="#696969" stop-opacity=".059"/>
<stop offset=".713" stop-color="#545454" stop-opacity=".071"/>
<stop offset=".826" stop-color="#3A3A3A" stop-opacity=".083"/>
<stop offset=".929" stop-color="#1A1A1A" stop-opacity=".093"/>
<stop offset="1" stop-opacity=".1"/>
</linearGradient>
<linearGradient id="paint2_linear" x1="14.687" x2="17.244" y1="6.956" y2="4.399" gradientUnits="userSpaceOnUse">
<stop stop-color="#fff" stop-opacity="0"/>
<stop offset=".854" stop-color="#fff" stop-opacity=".213"/>
<stop offset="1" stop-color="#fff" stop-opacity=".25"/>
</linearGradient>
<linearGradient id="paint3_linear" x1="8.894" x2="9.076" y1="20.108" y2="18.398" gradientUnits="userSpaceOnUse">
<stop stop-color="#828282" stop-opacity="0"/>
<stop offset=".17" stop-color="#7E7E7E" stop-opacity=".034"/>
<stop offset=".346" stop-color="#717171" stop-opacity=".069"/>
<stop offset=".525" stop-color="#5D5D5D" stop-opacity=".105"/>
<stop offset=".706" stop-color="#404040" stop-opacity=".141"/>
<stop offset=".886" stop-color="#1B1B1B" stop-opacity=".178"/>
<stop offset=".997" stop-opacity=".2"/>
</linearGradient>
<linearGradient id="paint4_linear" x1="7.286" x2="7.286" y1="18.509" y2="8.039" gradientUnits="userSpaceOnUse">
<stop stop-color="#fff" stop-opacity="0"/>
<stop offset=".859" stop-color="#fff" stop-opacity=".155"/>
<stop offset="1" stop-color="#fff" stop-opacity=".18"/>
</linearGradient>
<clipPath id="clip0">
<path fill="#fff" d="M0 0H24V24H0z"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 4.5 KiB

View file

@ -0,0 +1,83 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24">
<g clip-path="url(#clip0)">
<path fill="#fff" d="M19.469 3H6.812v16.594H8.22V21h12.656V4.406L19.469 3z"/>
<path fill="#217346" d="M19.469 3H6.812v2.531H19.47V3.844l1.406 1.406v-.844L19.469 3z"/>
<path fill="#949494" d="M20.313 4.688v15.75H8.78v-.844H19.47V5.53h-.563v13.5H7.375v-13.5h-.563v14.063H8.22V21h12.656V5.25l-.563-.563z"/>
<path fill="#217346" d="M4 8.906L12.719 7.5v11.25L4 17.344V8.906z"/>
<path fill="#fff" d="M10.75 15.656H9.372l-.889-1.648c-.033-.062-.068-.174-.104-.34h-.014c-.017.078-.057.196-.119.354l-.892 1.634H5.969l1.644-2.531-1.504-2.531h1.414l.737 1.518c.058.12.11.262.155.427h.015c.028-.099.082-.246.161-.441l.82-1.504h1.296l-1.547 2.51 1.59 2.552z"/>
<path fill="#C8C8C8" d="M18.063 10.031H15.53v1.125h2.531v-1.125zM18.063 8.344H15.53v1.125h2.531V8.344zM18.063 11.719H15.53v1.125h2.531v-1.125zM18.063 16.781H15.53v1.125h2.531v-1.125zM18.063 13.406H15.53v1.125h2.531v-1.125zM18.063 15.094H15.53v1.125h2.531v-1.125zM14.969 10.031h-2.25v1.125h2.25v-1.125zM14.969 8.344h-2.25v1.125h2.25V8.344zM14.969 11.719h-2.25v1.125h2.25v-1.125zM14.969 16.781h-2.25v1.125h2.25v-1.125zM14.969 13.406h-2.25v1.125h2.25v-1.125zM14.969 15.094h-2.25v1.125h2.25v-1.125z"/>
<path fill="url(#paint0_linear)" d="M19.469 5.531H6.812v14.063H19.47V5.53z"/>
<path fill="url(#paint1_linear)" d="M19.469 3H6.812v2.531H19.47V3.844l1.406 1.406v-.844L19.469 3z"/>
<path fill="url(#paint2_linear)" d="M19.469 3.844v15.75H8.219V21h12.656V5.25l-1.406-1.406z"/>
<path fill="url(#paint3_linear)" d="M19.469 19.594H8.219V21h11.25v-1.406z"/>
<path fill="url(#paint4_linear)" d="M12.719 20.156h-4.5v-.562H6.813v-1.795l5.906.951v1.406z"/>
<path fill="url(#paint5_linear)" d="M12.719 7.5L4 8.906v8.438l8.719 1.406V7.5z"/>
<path fill="url(#paint6_linear)" d="M12.719 7.5L4 8.906v8.438l8.719 1.406V7.5z"/>
</g>
<defs>
<linearGradient id="paint0_linear" x1="7.331" x2="18.95" y1="5.126" y2="19.999" gradientUnits="userSpaceOnUse">
<stop stop-color="#fff" stop-opacity="0"/>
<stop offset=".226" stop-color="#FCFCFC" stop-opacity=".023"/>
<stop offset=".363" stop-color="#F4F4F4" stop-opacity=".036"/>
<stop offset=".475" stop-color="#E6E6E6" stop-opacity=".048"/>
<stop offset=".574" stop-color="#D1D1D1" stop-opacity=".057"/>
<stop offset=".665" stop-color="#B7B7B7" stop-opacity=".067"/>
<stop offset=".75" stop-color="#979797" stop-opacity=".075"/>
<stop offset=".83" stop-color="#707070" stop-opacity=".083"/>
<stop offset=".906" stop-color="#444" stop-opacity=".091"/>
<stop offset=".976" stop-color="#121212" stop-opacity=".098"/>
<stop offset="1" stop-opacity=".1"/>
</linearGradient>
<linearGradient id="paint1_linear" x1="13.769" x2="13.916" y1="5.55" y2="2.749" gradientUnits="userSpaceOnUse">
<stop stop-color="#fff" stop-opacity="0"/>
<stop offset=".854" stop-color="#fff" stop-opacity=".213"/>
<stop offset="1" stop-color="#fff" stop-opacity=".25"/>
</linearGradient>
<linearGradient id="paint2_linear" x1="11.91" x2="20.766" y1="9.75" y2="21.085" gradientUnits="userSpaceOnUse">
<stop stop-color="#fff" stop-opacity="0"/>
<stop offset=".226" stop-color="#FCFCFC" stop-opacity=".023"/>
<stop offset=".363" stop-color="#F4F4F4" stop-opacity=".036"/>
<stop offset=".475" stop-color="#E6E6E6" stop-opacity=".048"/>
<stop offset=".574" stop-color="#D1D1D1" stop-opacity=".057"/>
<stop offset=".665" stop-color="#B7B7B7" stop-opacity=".067"/>
<stop offset=".75" stop-color="#979797" stop-opacity=".075"/>
<stop offset=".83" stop-color="#707070" stop-opacity=".083"/>
<stop offset=".906" stop-color="#444" stop-opacity=".091"/>
<stop offset=".976" stop-color="#121212" stop-opacity=".098"/>
<stop offset="1" stop-opacity=".1"/>
</linearGradient>
<linearGradient id="paint3_linear" x1="13.844" x2="13.844" y1="20.956" y2="19.635" gradientUnits="userSpaceOnUse">
<stop stop-color="#828282" stop-opacity="0"/>
<stop offset=".281" stop-color="#7F7F7F" stop-opacity=".028"/>
<stop offset=".45" stop-color="#777" stop-opacity=".045"/>
<stop offset=".59" stop-color="#696969" stop-opacity=".059"/>
<stop offset=".713" stop-color="#545454" stop-opacity=".071"/>
<stop offset=".826" stop-color="#3A3A3A" stop-opacity=".083"/>
<stop offset=".929" stop-color="#1A1A1A" stop-opacity=".093"/>
<stop offset="1" stop-opacity=".1"/>
</linearGradient>
<linearGradient id="paint4_linear" x1="9.631" x2="9.85" y1="20.238" y2="18.188" gradientUnits="userSpaceOnUse">
<stop stop-color="#828282" stop-opacity="0"/>
<stop offset=".281" stop-color="#7F7F7F" stop-opacity=".056"/>
<stop offset=".45" stop-color="#777" stop-opacity=".09"/>
<stop offset=".59" stop-color="#696969" stop-opacity=".118"/>
<stop offset=".713" stop-color="#545454" stop-opacity=".143"/>
<stop offset=".826" stop-color="#3A3A3A" stop-opacity=".165"/>
<stop offset=".929" stop-color="#1A1A1A" stop-opacity=".186"/>
<stop offset="1" stop-opacity=".2"/>
</linearGradient>
<linearGradient id="paint5_linear" x1="8.359" x2="8.359" y1="18.398" y2="7.828" gradientUnits="userSpaceOnUse">
<stop stop-color="#fff" stop-opacity="0"/>
<stop offset=".859" stop-color="#fff" stop-opacity=".155"/>
<stop offset="1" stop-color="#fff" stop-opacity=".18"/>
</linearGradient>
<linearGradient id="paint6_linear" x1="8.359" x2="8.359" y1="18.398" y2="7.828" gradientUnits="userSpaceOnUse">
<stop stop-color="#fff" stop-opacity="0"/>
<stop offset=".859" stop-color="#fff" stop-opacity=".155"/>
<stop offset="1" stop-color="#fff" stop-opacity=".18"/>
</linearGradient>
<clipPath id="clip0">
<path fill="#fff" d="M0 0H24V24H0z"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 6.2 KiB

View file

@ -283,8 +283,9 @@
}
.image-icon {
height: 18px;
width: 18px;
flex-shrink: 0;
height: 24px;
width: 24px;
}
.file-preview-link {

View file

@ -300,3 +300,19 @@
}
}
}
.asset-icon {
display: inline-block;
font-size: $font-size-h2;
text-align: center;
width: 24px;
&.fa-file-pdf {
color: $pdf-color;
}
&.fa-image {
color: $brand-primary;
}
}

View file

@ -38,6 +38,8 @@ $office-ms-powerpoint: #d24726;
// MarvinJS color:
$marvinjs-color: #29999c;
$pdf-color: #f40f02;
// Don't use them

View file

@ -1286,6 +1286,10 @@ ul.content-activities {
}
}
body > .loading-overlay {
position: fixed;
}
.turbolinks-progress-bar::before {
background-color: $brand-primary;
}

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module FileIconsHelper
def wopi_file?(asset)
file_ext = asset.file_name.split('.').last
@ -9,21 +11,21 @@ module FileIconsHelper
file_ext = asset.file_name.split('.').last
if Extends::FILE_FA_ICON_MAPPINGS[file_ext] # Check for custom mappings or possible overrides
return Extends::FILE_FA_ICON_MAPPINGS[file_ext]
Extends::FILE_FA_ICON_MAPPINGS[file_ext]
elsif Constants::FILE_TEXT_FORMATS.include?(file_ext)
return 'fa-file-word'
'fa-file-word'
elsif Constants::FILE_TABLE_FORMATS.include?(file_ext)
return 'fa-file-excel'
'fa-file-excel'
elsif Constants::FILE_PRESENTATION_FORMATS.include?(file_ext)
return 'fa-file-powerpoint'
'fa-file-powerpoint'
elsif %w(pdf).include?(file_ext)
return 'fa-file-pdf'
'fa-file-pdf'
elsif %w(txt csv tab tex).include?(file_ext)
return 'fa-file-alt'
'far fa-file-alt'
elsif Constants::WHITELISTED_IMAGE_TYPES.include?(file_ext)
return 'fa-image'
'fa-image'
else
return 'fa-paperclip'
'fa-paperclip'
end
end
@ -31,11 +33,13 @@ module FileIconsHelper
def file_extension_icon(asset)
file_ext = asset.file_name.split('.').last
if Constants::FILE_TEXT_FORMATS.include?(file_ext)
image_link = 'office/Word-docx_20x20x32.png'
image_link = 'icon_small/docx_file.svg'
elsif Constants::FILE_TABLE_FORMATS.include?(file_ext)
image_link = 'office/Excel-xlsx_20x20x32.png'
image_link = 'icon_small/xslx_file.svg'
elsif Constants::FILE_PRESENTATION_FORMATS.include?(file_ext)
image_link = 'office/PowerPoint-pptx_20x20x32.png'
image_link = 'icon_small/pptx_file.svg'
elsif asset.file.attached? && asset.file.metadata['asset_type'] == 'marvinjs'
image_link = 'icon_small/marvinjs_file.svg'
end
# Now check for custom mappings or possible overrides
@ -98,7 +102,13 @@ module FileIconsHelper
def file_extension_icon_html(asset)
html = file_extension_icon(asset)
html = "<i class='fas #{file_fa_icon_class(asset)}'></i>" if html.blank?
if html.blank?
html = ActionController::Base.helpers.content_tag(
:i,
'',
class: ['fas', 'asset-icon', file_fa_icon_class(asset)]
)
end
html
end

View file

@ -4,9 +4,7 @@
data-asset-updated-at="<%= asset.updated_at.to_i %>"
data-asset-order="1"
>
<div class="file-icon">
<i class="fas <%= file_fa_icon_class(asset) if asset.file_name %>"></i>
</div>
<%= file_extension_icon_html(asset) %>
<%= link_to rails_blob_path(asset.file, disposition: 'attachment'),
class: "file-preview-link file-name",
id: "modal_link#{asset.id}",