Commit b49fa908dde6cfdb453296b5f62d6957001ba53b
Committed by
Rodrigo Souto
1 parent
bbcc0618
Exists in
master
and in
29 other branches
Adding bigger icons when displaying folders
Signed-off-by: Tallys Martins <tallysmartins@gmail.com> Signed-off-by: André Bernardes <andrebsguedes@gmail.com>
Showing
5 changed files
with
13 additions
and
10 deletions
Show diff stats
app/helpers/folder_helper.rb
| ... | ... | @@ -42,15 +42,15 @@ module FolderHelper |
| 42 | 42 | |
| 43 | 43 | def icon_for_article(article, size = 'icon') |
| 44 | 44 | article = FilePresenter.for article |
| 45 | - icon = article.respond_to?(:icon_name) ? | |
| 46 | - article.icon_name : | |
| 47 | - article.class.icon_name(article) | |
| 48 | - if (icon =~ /\//) | |
| 49 | - icon | |
| 45 | + if article.respond_to?(:sized_icon) | |
| 46 | + article.sized_icon(size) | |
| 50 | 47 | else |
| 51 | - klasses = 'icon ' + [icon].flatten.map{|name| 'icon-'+name}.join(' ') | |
| 48 | + icon = article.respond_to?(:icon_name) ? | |
| 49 | + article.icon_name : | |
| 50 | + article.class.icon_name(article) | |
| 51 | + klasses = "#{size} " + [icon].flatten.map{|name| "#{size}-"+name}.join(' ') | |
| 52 | 52 | if article.kind_of?(UploadedFile) || article.kind_of?(FilePresenter) |
| 53 | - klasses += ' icon-upload-file' | |
| 53 | + klasses += " #{size}-upload-file" | |
| 54 | 54 | end |
| 55 | 55 | klasses |
| 56 | 56 | end | ... | ... |
app/presenters/image.rb
lib/short_filename.rb
| ... | ... | @@ -9,7 +9,7 @@ module ShortFilename |
| 9 | 9 | def short_filename_upper_ext(filename, limit_chars = 43) |
| 10 | 10 | extname = File.extname(filename) |
| 11 | 11 | display_name = shrink(File.basename(filename, extname), extname, limit_chars) |
| 12 | - return display_name + " - " + extname.upcase.delete(".") if not extname.empty? else display_name | |
| 12 | + return extname.present? ? (display_name + ' - ' + extname.upcase.delete(".")) : display_name | |
| 13 | 13 | end |
| 14 | 14 | |
| 15 | 15 | def shrink(filename, extname, limit_chars) | ... | ... |
3.24 KB
public/stylesheets/application.css
| ... | ... | @@ -3910,7 +3910,6 @@ table.cms-articles .icon:hover { |
| 3910 | 3910 | |
| 3911 | 3911 | div.folder-description { |
| 3912 | 3912 | padding-bottom: 15px; |
| 3913 | - border-bottom: 1px solid #CCCCCC; | |
| 3914 | 3913 | } |
| 3915 | 3914 | |
| 3916 | 3915 | .list-item h2{ |
| ... | ... | @@ -3919,7 +3918,7 @@ div.folder-description { |
| 3919 | 3918 | } |
| 3920 | 3919 | |
| 3921 | 3920 | .item-info{ |
| 3922 | - border-bottom: 1px solid #ccc; | |
| 3921 | + border-top: 1px solid #ccc; | |
| 3923 | 3922 | line-height: 25px; |
| 3924 | 3923 | padding:25px 20px; |
| 3925 | 3924 | } | ... | ... |