Show attachment file name instead of the type
authorr <r@freesoftwareextremist.com>
Sat, 16 Jan 2021 18:03:47 +0000 (18:03 +0000)
committerr <r@freesoftwareextremist.com>
Sat, 16 Jan 2021 18:03:47 +0000 (18:03 +0000)
templates/status.tmpl

index e842a96c308d26c9dcbec29025cbbaca12e8b14e..a46129f0528d1bc13d196522795cbe9e0e3b0df6 100644 (file)
@@ -91,7 +91,9 @@
 
                                {{if eq .Type "image"}}
                                {{if $.Ctx.HideAttachments}}
-                               <a href="{{.URL}}" target="_blank" title="{{.Description}}"> [image] </a>
+                               <a href="{{.URL}}" target="_blank">
+                                       {{if .Description}}[{{.Description}}]{{else}}[image]{{end}}
+                               </a>
                                {{else}}
                                <a class="img-link" href="{{.URL}}" target="_blank" title="{{.Description}}">
                                        <img class="status-image" src="{{.URL}}" alt="status-image" height="240" />
 
                                {{else if eq .Type "audio"}}
                                {{if $.Ctx.HideAttachments}}
-                               <a href="{{.URL}}" target="_blank" title="{{.Description}}"> [audio] </a>
+                               <a href="{{.URL}}" target="_blank">
+                                       {{if .Description}}[{{.Description}}]{{else}}[audio]{{end}}
+                               </a>
                                {{else}}
                                <audio class="status-audio" controls title="{{.Description}}">
                                        <source src="{{.URL}}">
 
                                {{else if eq .Type "video"}}
                                {{if $.Ctx.HideAttachments}}
-                               <a href="{{.URL}}" target="_blank" title="{{.Description}}"> [video] </a>
+                               <a href="{{.URL}}" target="_blank">
+                                       {{if .Description}}[{{.Description}}]{{else}}[video]{{end}}
+                               </a>
                                {{else}}
                                <div class="status-video-container" title="{{.Description}}">
                                        <video class="status-video" controls height="240">
                                {{end}}
 
                                {{else}}
-                               <a href="{{.URL}}" target="_blank" title="{{.Description}}"> [attachment] </a>
+                               <a href="{{.URL}}" target="_blank"> 
+                                       {{if .Description}}[{{.Description}}]{{else}}[attachment]{{end}}
+                               </a>
                                {{end}}
                                {{end}}
                        </div>