Commit 5cf344ebad5fa578e5e77abd5a58751f54802a2f
1 parent
0d6a8190
Exists in
master
and in
22 other branches
Moving presenters to app/presenters folder
Showing
4 changed files
with
29 additions
and
29 deletions
Show diff stats
... | ... | @@ -0,0 +1,18 @@ |
1 | +class FilePresenter::Image < FilePresenter | |
2 | + def initialize(f) | |
3 | + @file = f | |
4 | + end | |
5 | + | |
6 | + def self.accepts?(f) | |
7 | + return nil unless f.respond_to? :image? | |
8 | + f.image? ? 10 : nil | |
9 | + end | |
10 | + | |
11 | + def icon_name | |
12 | + public_filename :icon | |
13 | + end | |
14 | + | |
15 | + def short_description | |
16 | + _('Image (%s)') % content_type.split('/')[1].upcase | |
17 | + end | |
18 | +end | ... | ... |
lib/file_presenter/generic.rb
lib/file_presenter/image.rb
... | ... | @@ -1,18 +0,0 @@ |
1 | -class FilePresenter::Image < FilePresenter | |
2 | - def initialize(f) | |
3 | - @file = f | |
4 | - end | |
5 | - | |
6 | - def self.accepts?(f) | |
7 | - return nil unless f.respond_to? :image? | |
8 | - f.image? ? 10 : nil | |
9 | - end | |
10 | - | |
11 | - def icon_name | |
12 | - public_filename :icon | |
13 | - end | |
14 | - | |
15 | - def short_description | |
16 | - _('Image (%s)') % content_type.split('/')[1].upcase | |
17 | - end | |
18 | -end |