Skip to content

Commit

Permalink
update: update file format icons
Browse files Browse the repository at this point in the history
  • Loading branch information
mutantsan committed Sep 3, 2023
1 parent a1a7e2c commit 848b20a
Showing 1 changed file with 27 additions and 4 deletions.
31 changes: 27 additions & 4 deletions ckanext/unfold/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,39 @@ def get_icon_by_format(fmt: str) -> str:
default_icon = "fa fa-file"
icons = {
("csv",): "fa fa-file-csv",
("txt", "tsv", "ini", "nfo"): "fa fa-file-text",
("txt", "tsv", "ini", "nfo", "log"): "fa fa-file-text",
("xls", "xlsx"): "fa fa-file-excel",
("doc", "docx"): "fa fa-file-word",
("ppt", "pptx", "pptm"): "fa fa-file-powerpoint",
("png", "jpeg", "jpg", "svg", "bmp", "psd"): "fa fa-file-image",
("7z", "rar", "zip", "gzip", "gz", "tar", "deb", "cbr"): "fa fa-file-archive",
(
"7z",
"rar",
"zip",
"zipx",
"gzip",
"tar.gz",
"tar",
"deb",
"cbr",
"pkg",
"apk",
): "fa fa-file-archive",
("pdf",): "fa fa-file-pdf",
("json", "xhtml", "py", "css", "rs", "html", "php", "sql"): "fa fa-file-code",
(
"json",
"xhtml",
"py",
"css",
"rs",
"html",
"php",
"sql",
"java",
"class",
): "fa fa-file-code",
("xml", "dtd"): "fa fa-file-contract",
("mp3", "wav", "wma", "aac", "flac"): "fa fa-file-audio",
("mp3", "wav", "wma", "aac", "flac", "mpa", "ogg"): "fa fa-file-audio",
}

for formats, icon in icons.items():
Expand Down

0 comments on commit 848b20a

Please sign in to comment.