Assets: Trim the first part of the asset type

Usually "image" or "application".

Also special treatment for .blend files
e.g. application/x-blender becomes blend logo
This commit is contained in:
Pablo Vazquez 2018-03-27 19:46:34 +02:00
parent ebfd3d542c
commit a4e415f1e3

View File

@ -138,3 +138,12 @@ script(type="text/javascript").
}
{% endif %}
var $content_type = $(".js-type");
var type_value = $content_type.text();
var type_value_trimmed = type_value.substring(type_value.indexOf("/") + 1);
$content_type.text(type_value_trimmed);
if (type_value_trimmed == 'x-blender' || type_value_trimmed == 'blend'){
$content_type.html('<span class="blend"><i class="pi-blender-logo"></i></span>');
};