Commit 2ca87f91eb75289e40c4713c41215843ee3d5c65
1 parent
7852f785
Exists in
master
and in
28 other branches
Treating article mime type on cms
Showing
3 changed files
with
11 additions
and
3 deletions
Show diff stats
app/views/cms/view.rhtml
... | ... | @@ -42,10 +42,10 @@ |
42 | 42 | |
43 | 43 | <% @articles.each do |article| article = FilePresenter.for article %> |
44 | 44 | <tr> |
45 | - <td> | |
45 | + <td class="article-name"> | |
46 | 46 | <%= link_to_article(article) %> |
47 | 47 | </td> |
48 | - <td> | |
48 | + <td class="article-mime"> | |
49 | 49 | <%= article.respond_to?(:short_description) ? |
50 | 50 | article.short_description : |
51 | 51 | article.class.short_description %> | ... | ... |
lib/file_presenter.rb
... | ... | @@ -43,7 +43,7 @@ class FilePresenter |
43 | 43 | end |
44 | 44 | |
45 | 45 | def short_description |
46 | - _("File (%s)") % content_type | |
46 | + _("File (%s)") % content_type.sub(/^application\//, '').sub(/^x-/, '').sub(/^image\//, '') | |
47 | 47 | end |
48 | 48 | |
49 | 49 | # Define the css classes to style the page fragment with the file related | ... | ... |
public/stylesheets/application.css
... | ... | @@ -3171,6 +3171,14 @@ table.cms-articles .icon:hover { |
3171 | 3171 | background: #eeeeec; |
3172 | 3172 | border: 1px solid #d3d7cf; |
3173 | 3173 | } |
3174 | + | |
3175 | +.controller-cms .article-mime { | |
3176 | + max-width: 90px; | |
3177 | + overflow: hidden; | |
3178 | + text-overflow: ellipsis; | |
3179 | + white-space: nowrap; | |
3180 | +} | |
3181 | + | |
3174 | 3182 | .controller-cms .article-controls { |
3175 | 3183 | white-space: nowrap; |
3176 | 3184 | } | ... | ... |