From 2ca87f91eb75289e40c4713c41215843ee3d5c65 Mon Sep 17 00:00:00 2001 From: Rodrigo Souto Date: Mon, 23 Sep 2013 16:58:18 -0300 Subject: [PATCH] Treating article mime type on cms --- app/views/cms/view.rhtml | 4 ++-- lib/file_presenter.rb | 2 +- public/stylesheets/application.css | 8 ++++++++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/app/views/cms/view.rhtml b/app/views/cms/view.rhtml index cdb2405..036d6c3 100644 --- a/app/views/cms/view.rhtml +++ b/app/views/cms/view.rhtml @@ -42,10 +42,10 @@ <% @articles.each do |article| article = FilePresenter.for article %> - + <%= link_to_article(article) %> - + <%= article.respond_to?(:short_description) ? article.short_description : article.class.short_description %> diff --git a/lib/file_presenter.rb b/lib/file_presenter.rb index ee334ab..4b21b13 100644 --- a/lib/file_presenter.rb +++ b/lib/file_presenter.rb @@ -43,7 +43,7 @@ class FilePresenter end def short_description - _("File (%s)") % content_type + _("File (%s)") % content_type.sub(/^application\//, '').sub(/^x-/, '').sub(/^image\//, '') end # Define the css classes to style the page fragment with the file related diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 29f62ae..69ab799 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -3171,6 +3171,14 @@ table.cms-articles .icon:hover { background: #eeeeec; border: 1px solid #d3d7cf; } + +.controller-cms .article-mime { + max-width: 90px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + .controller-cms .article-controls { white-space: nowrap; } -- libgit2 0.21.2