mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +08:00
bring back attachment icons
This commit is contained in:
@ -245,7 +245,7 @@ Discourse.Utilities = {
|
|||||||
if (Discourse.Utilities.isAnImage(upload.original_filename)) {
|
if (Discourse.Utilities.isAnImage(upload.original_filename)) {
|
||||||
return '<img src="' + upload.url + '" width="' + upload.width + '" height="' + upload.height + '">';
|
return '<img src="' + upload.url + '" width="' + upload.width + '" height="' + upload.height + '">';
|
||||||
} else {
|
} else {
|
||||||
return '<a class="attachment" href="' + upload.url + '">' + upload.original_filename + '</a><span class="size">(' + I18n.toHumanSize(upload.filesize) + ')</span>';
|
return '<a class="attachment" href="' + upload.url + '">' + upload.original_filename + '</a> (' + I18n.toHumanSize(upload.filesize) + ')';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -953,3 +953,9 @@ clear: both;
|
|||||||
|
|
||||||
input#edit-title {margin-left: 10px;}
|
input#edit-title {margin-left: 10px;}
|
||||||
|
|
||||||
|
a.attachment:before {
|
||||||
|
display: inline-block;
|
||||||
|
margin-right: 4px;
|
||||||
|
font-family: "FontAwesome";
|
||||||
|
content: "\f019";
|
||||||
|
}
|
||||||
|
@ -95,7 +95,7 @@ var getUploadMarkdown = function(filename) {
|
|||||||
|
|
||||||
test("getUploadMarkdown", function() {
|
test("getUploadMarkdown", function() {
|
||||||
ok(getUploadMarkdown("lolcat.gif") === '<img src="/uploads/123/abcdef.ext" width="100" height="200">');
|
ok(getUploadMarkdown("lolcat.gif") === '<img src="/uploads/123/abcdef.ext" width="100" height="200">');
|
||||||
ok(getUploadMarkdown("important.txt") === '<a class="attachment" href="/uploads/123/abcdef.ext">important.txt</a><span class="size">(42 Bytes)</span>');
|
ok(getUploadMarkdown("important.txt") === '<a class="attachment" href="/uploads/123/abcdef.ext">important.txt</a> (42 Bytes)');
|
||||||
});
|
});
|
||||||
|
|
||||||
test("isAnImage", function() {
|
test("isAnImage", function() {
|
||||||
|
Reference in New Issue
Block a user