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,10 +42,10 @@ | ||
42 | 42 | ||
43 | <% @articles.each do |article| article = FilePresenter.for article %> | 43 | <% @articles.each do |article| article = FilePresenter.for article %> |
44 | <tr> | 44 | <tr> |
45 | - <td> | 45 | + <td class="article-name"> |
46 | <%= link_to_article(article) %> | 46 | <%= link_to_article(article) %> |
47 | </td> | 47 | </td> |
48 | - <td> | 48 | + <td class="article-mime"> |
49 | <%= article.respond_to?(:short_description) ? | 49 | <%= article.respond_to?(:short_description) ? |
50 | article.short_description : | 50 | article.short_description : |
51 | article.class.short_description %> | 51 | article.class.short_description %> |
lib/file_presenter.rb
@@ -43,7 +43,7 @@ class FilePresenter | @@ -43,7 +43,7 @@ class FilePresenter | ||
43 | end | 43 | end |
44 | 44 | ||
45 | def short_description | 45 | def short_description |
46 | - _("File (%s)") % content_type | 46 | + _("File (%s)") % content_type.sub(/^application\//, '').sub(/^x-/, '').sub(/^image\//, '') |
47 | end | 47 | end |
48 | 48 | ||
49 | # Define the css classes to style the page fragment with the file related | 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,6 +3171,14 @@ table.cms-articles .icon:hover { | ||
3171 | background: #eeeeec; | 3171 | background: #eeeeec; |
3172 | border: 1px solid #d3d7cf; | 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 | .controller-cms .article-controls { | 3182 | .controller-cms .article-controls { |
3175 | white-space: nowrap; | 3183 | white-space: nowrap; |
3176 | } | 3184 | } |