project Utilities / File Location Listing avatar

utilities/file_location_listing#9: Add Mime-Type indicator to search results

Issue Information

Issue Type: issue
Status: closed
Reported By: btasker
Assigned To: btasker

Milestone: v0.1
Created: 29-Dec-23 11:15


Search results should indicate what kind of file is being linked to: is it a HTML page, a textfile etc

Toggle State Changes


assigned to @btasker

We actually already almost have this

    ico = document.createElement('div');
    ico.className = "ico " + res['content-type'];

The template from my old search portal did this. However, the content-type it returned wasn't a mime type, but values such as page. Should just need to rejig the CSS to work with actual content types.


mentioned in commit 6b193016d39fbc95f0344e1deda44173c0344793

Commit: 6b193016d39fbc95f0344e1deda44173c0344793 
Author: B Tasker                            
Date: 2023-12-29T11:28:32.000+00:00 


feat: show icon for certain mime-types (utilities/file_location_listing#9)

If there isn't a matching CSS rule the icon block will default to display:none

+21 -9 (30 lines changed)

This is done:


I moved the icon from the end of the title to the beginning - that way if the title is long enough to get truncated the icon is still visible