|
@@ -136,6 +136,43 @@ class App extends Spine.Controller
|
|
|
return marked(string)
|
|
|
App.i18n.translateContent(string)
|
|
|
|
|
|
+ ContentTypeIcon: (contentType) ->
|
|
|
+ icons =
|
|
|
+ # image
|
|
|
+ 'image/jpeg': 'file-image'
|
|
|
+ 'image/jpg': 'file-image'
|
|
|
+ 'image/png': 'file-image'
|
|
|
+ 'image/svg': 'file-image'
|
|
|
+ # documents
|
|
|
+ 'application/pdf': 'file-pdf'
|
|
|
+ 'application/msword': 'file-word' # .doc, .dot
|
|
|
+ 'application/vnd.ms-word': 'file-word'
|
|
|
+ 'application/vnd.oasis.opendocument.text': 'file-word'
|
|
|
+ 'application/vnd.openxmlformats-officedocument.wordprocessingml.document': 'file-word' # .docx
|
|
|
+ 'application/vnd.openxmlformats-officedocument.wordprocessingml.template': 'file-word' # .dotx
|
|
|
+ 'application/vnd.ms-excel': 'file-excel' # .xls
|
|
|
+ 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet': 'file-excel' # .xlsx
|
|
|
+ 'application/vnd.oasis.opendocument.spreadsheet': 'file-excel'
|
|
|
+ 'application/vnd.ms-powerpoint': 'file-powerpoint' # .ppt
|
|
|
+ 'application/vnd.openxmlformats-officedocument.presentationml.presentation': 'file-powerpoint' # .pptx
|
|
|
+ 'application/vnd.oasis.opendocument.presentation': 'file-powerpoint'
|
|
|
+ 'text/plain': 'file-text'
|
|
|
+ 'text/html': 'file-code'
|
|
|
+ 'application/json': 'file-code'
|
|
|
+ 'message/rfc822': 'file-email'
|
|
|
+ # code
|
|
|
+ 'application/json': 'file-code'
|
|
|
+ # text
|
|
|
+ 'text/plain': 'file-text'
|
|
|
+ 'text/rtf': 'file-text'
|
|
|
+ # archives
|
|
|
+ 'application/gzip': 'file-archive'
|
|
|
+ 'application/zip': 'file-archive'
|
|
|
+ return icons[contentType]
|
|
|
+
|
|
|
+ canDownload: (contentType) ->
|
|
|
+ contentType != 'text/html'
|
|
|
+
|
|
|
@viewPrint: (object, attributeName, attributes, table) ->
|
|
|
if !attributes
|
|
|
attributes = {}
|