bring back attachment icons

This commit is contained in:
Régis Hanol 2013-10-23 09:52:15 +02:00
parent 08c08a3bc6
commit a12a1bcc66
3 changed files with 12 additions and 6 deletions
app/assets
javascripts/discourse/components
stylesheets/desktop
test/javascripts/components

View file

@ -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) + ')';
} }
}, },

View file

@ -455,7 +455,7 @@ iframe {
a:not(.badge-category) {margin-left: -10px;} a:not(.badge-category) {margin-left: -10px;}
} }
a.star { a.star {
margin-right: 5px; margin-right: 5px;
margin-top: 6px; margin-top: 6px;
@ -737,7 +737,7 @@ blockquote {
.row:after {clear: both;} .row:after {clear: both;}
.embedded-posts { .embedded-posts {
h1, h2, h3 {margin: 10px 0;} h1, h2, h3 {margin: 10px 0;}
&.bottom { &.bottom {
&.hidden {display: block; opacity: 0; } &.hidden {display: block; opacity: 0; }
} }
@ -766,7 +766,7 @@ button.show-replies {
} }
} }
&.bottom-round button.show-replies { &.bottom-round button.show-replies {
@ -775,7 +775,7 @@ button.show-replies {
margin-bottom: 0; margin-bottom: 0;
padding-bottom: 8px; padding-bottom: 8px;
&:hover {background: #ddd; &:hover {background: #ddd;
.badge-posts {color: #888;} .badge-posts {color: #888;}
@ -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";
}

View file

@ -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() {