Skip to content

Commit

Permalink
bring back attachment icons
Browse files Browse the repository at this point in the history
  • Loading branch information
ZogStriP committed Oct 23, 2013
1 parent 08c08a3 commit a12a1bc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/assets/javascripts/discourse/components/utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ Discourse.Utilities = {
if (Discourse.Utilities.isAnImage(upload.original_filename)) {
return '<img src="' + upload.url + '" width="' + upload.width + '" height="' + upload.height + '">';
} 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) + ')';
}
},

Expand Down
14 changes: 10 additions & 4 deletions app/assets/stylesheets/desktop/topic-post.scss
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ iframe {
a:not(.badge-category) {margin-left: -10px;}

}

a.star {
margin-right: 5px;
margin-top: 6px;
Expand Down Expand Up @@ -737,7 +737,7 @@ blockquote {
.row:after {clear: both;}
.embedded-posts {
h1, h2, h3 {margin: 10px 0;}
&.bottom {
&.bottom {
&.hidden {display: block; opacity: 0; }

}
Expand Down Expand Up @@ -766,7 +766,7 @@ button.show-replies {

}


}

&.bottom-round button.show-replies {
Expand All @@ -775,7 +775,7 @@ button.show-replies {
margin-bottom: 0;
padding-bottom: 8px;


&:hover {background: #ddd;
.badge-posts {color: #888;}

Expand Down Expand Up @@ -953,3 +953,9 @@ clear: both;

input#edit-title {margin-left: 10px;}

a.attachment:before {
display: inline-block;
margin-right: 4px;
font-family: "FontAwesome";
content: "\f019";
}
2 changes: 1 addition & 1 deletion test/javascripts/components/utilities_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ var getUploadMarkdown = function(filename) {

test("getUploadMarkdown", function() {
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() {
Expand Down

0 comments on commit a12a1bc

Please sign in to comment.