Commit 0d6a81901ebf1b5e4b2cadaa55770e72ccbca58a

Authored by Rodrigo Souto
2 parents f5c2a127 1c68caa0

Merge commit 'refs/merge-requests/316' of git://gitorious.org/noosfero/noosfero …

…into merge-requests/316

Conflicts:
	app/helpers/blog_helper.rb
Showing 68 changed files with 514 additions and 242 deletions   Show diff stats
app/controllers/public/content_viewer_controller.rb
... ... @@ -53,7 +53,9 @@ class ContentViewerController < ApplicationController
53 53 # At this point the page will be showed
54 54 @page.hit
55 55  
56   - unless @page.mime_type == 'text/html' || (@page.image? && params[:view])
  56 + @page = FilePresenter.for @page
  57 +
  58 + unless @page.mime_type == 'text/html' || params[:view]
57 59 headers['Content-Type'] = @page.mime_type
58 60 data = @page.data
59 61  
... ...
app/helpers/blog_helper.rb
... ... @@ -42,7 +42,7 @@ module BlogHelper
42 42  
43 43 def display_post(article, format = 'full')
44 44 no_comments = (format == 'full') ? false : true
45   - html = send("display_#{format}_format", article).html_safe
  45 + html = send("display_#{format}_format", FilePresenter.for(article)).html_safe
46 46  
47 47 article_title(article, :no_comments => no_comments) + html
48 48 end
... ...
app/helpers/cms_helper.rb
... ... @@ -33,7 +33,7 @@ module CmsHelper
33 33 link_to article_name, {:action => 'view', :id => article.id}, :class => icon_for_article(article)
34 34 else
35 35 if article.image?
36   - image_tag(icon_for_article(article)) + link_to(article_name, article.url)
  36 + image_tag(icon_for_article(article)) + link_to(article_name, article.url)
37 37 else
38 38 link_to article_name, article.url, :class => icon_for_article(article)
39 39 end
... ...
app/helpers/folder_helper.rb
... ... @@ -21,6 +21,7 @@ module FolderHelper
21 21 end
22 22  
23 23 def display_article_in_listing(article, recursive = false, level = 0)
  24 + article = FilePresenter.for article
24 25 article_link = if article.image?
25 26 link_to(' ' * (level * 4) + image_tag(icon_for_article(article)) + short_filename(article.name), article.url.merge(:view => true))
26 27 else
... ... @@ -40,12 +41,15 @@ module FolderHelper
40 41 end
41 42  
42 43 def icon_for_article(article)
43   - icon = article.class.icon_name(article)
  44 + article = FilePresenter.for article
  45 + icon = article.respond_to?(:icon_name) ?
  46 + article.icon_name :
  47 + article.class.icon_name(article)
44 48 if (icon =~ /\//)
45 49 icon
46 50 else
47   - klasses = 'icon icon-' + icon
48   - if article.kind_of?(UploadedFile)
  51 + klasses = 'icon ' + [icon].flatten.map{|name| 'icon-'+name}.join(' ')
  52 + if article.kind_of?(UploadedFile) || article.kind_of?(FilePresenter)
49 53 klasses += ' icon-upload-file'
50 54 end
51 55 klasses
... ...
app/helpers/profile_editor_helper.rb
... ... @@ -136,7 +136,7 @@ module ProfileEditorHelper
136 136 concat(
137 137 content_tag(
138 138 'div',
139   - capture(&block) + content_tag('br', '', :style => 'clear: left'),
  139 + capture(&block) + tag('br', :style => 'clear: left'),
140 140 :class => 'control-panel')
141 141 )
142 142 end
... ...
app/models/article.rb
... ... @@ -154,8 +154,12 @@ class Article < ActiveRecord::Base
154 154 end
155 155 end
156 156  
  157 + def css_class_list
  158 + [self.class.name.underscore.dasherize]
  159 + end
  160 +
157 161 def css_class_name
158   - self.class.name.underscore.dasherize
  162 + [css_class_list].flatten.compact.join(' ')
159 163 end
160 164  
161 165 def pending_categorizations
... ... @@ -329,7 +333,7 @@ class Article < ActiveRecord::Base
329 333 end
330 334  
331 335 def view_url
332   - @view_url ||= image? ? url.merge(:view => true) : url
  336 + @view_url ||= is_a?(UploadedFile) ? url.merge(:view => true) : url
333 337 end
334 338  
335 339 def comment_url_structure(comment, action = :edit)
... ...
app/models/article_block.rb
... ... @@ -12,7 +12,7 @@ class ArticleBlock < Block
12 12 block = self
13 13 lambda do
14 14 block_title(block.title) +
15   - (block.article ? article_to_html(block.article,
  15 + (block.article ? article_to_html(FilePresenter.for(block.article),
16 16 :gallery_view => false,
17 17 :inside_block => block, # For Blogs and folders
18 18 :format => block.visualization_format # For Articles and contents
... ...
app/models/profile_list_block.rb
... ... @@ -54,7 +54,7 @@ class ProfileListBlock < Block
54 54 list = content_tag 'ul', nl +' '+ list + nl
55 55 end
56 56 block_title(title) + nl +
57   - content_tag('div', nl + list + nl + content_tag('br', '', :style => 'clear:both'))
  57 + content_tag('div', nl + list + nl + tag('br', :style => 'clear:both'))
58 58 end
59 59 end
60 60  
... ...
app/models/uploaded_file.rb
... ... @@ -60,12 +60,20 @@ class UploadedFile < Article
60 60  
61 61 postgresql_attachment_fu
62 62  
  63 + # Use this method only to get the generic icon for this kind of content.
  64 + # If you want the specific icon for a file type or the iconified version
  65 + # of an image, use FilePresenter.for(uploaded_file).icon_name
63 66 def self.icon_name(article = nil)
64   - if article
65   - article.image? ? article.public_filename(:icon) : (article.mime_type ? article.mime_type.gsub(/[\/+.]/, '-') : 'upload-file')
66   - else
67   - 'upload-file'
  67 + unless article.nil?
  68 + warn = ('='*80) + "\n" +
  69 + 'The method `UploadedFile.icon_name(obj)` is deprecated. ' +
  70 + 'You must to encapsulate UploadedFile with `FilePresenter.for()`.' +
  71 + "\n" + ('='*80)
  72 + raise NoMethodError, warn if ENV['RAILS_ENV'] == 'test'
  73 + Rails.logger.warn warn if Rails.logger
  74 + puts warn if ENV['RAILS_ENV'] == 'development'
68 75 end
  76 + 'upload-file'
69 77 end
70 78  
71 79 def mime_type
... ... @@ -91,40 +99,27 @@ class UploadedFile < Article
91 99 end
92 100  
93 101 def to_html(options = {})
  102 + warn = ('='*80) + "\n" +
  103 + 'The method `UploadedFile#to_html()` is deprecated. ' +
  104 + 'You must to encapsulate UploadedFile with `FilePresenter.for()`.' +
  105 + "\n" + ('='*80)
  106 + raise NoMethodError, warn if ENV['RAILS_ENV'] == 'test'
  107 + Rails.logger.warn warn if Rails.logger
  108 + puts warn if ENV['RAILS_ENV'] == 'development'
94 109 article = self
95 110 if image?
96 111 lambda do
97   - if article.gallery? && options[:gallery_view]
98   - images = article.parent.images
99   - current_index = images.index(article)
100   - total_of_images = images.count
101   -
102   - link_to_previous = if current_index >= 1
103   - link_to(_('« Previous'), images[current_index - 1].view_url, :class => 'left')
104   - else
105   - content_tag('span', _('« Previous'), :class => 'left')
106   - end
107   -
108   - link_to_next = if current_index < total_of_images - 1
109   - link_to(_('Next &raquo;'), images[current_index + 1].view_url, :class => 'right')
110   - else
111   - content_tag('span', _('Next &raquo;'), :class => 'right')
112   - end
113   -
114   - content_tag(
115   - 'div',
116   - link_to_previous + (content_tag('span', _('image %d of %d'), :class => 'total-of-images') % [current_index + 1, total_of_images]).html_safe + link_to_next,
117   - :class => 'gallery-navigation'
118   - )
119   - end.to_s +
120   - image_tag(article.public_filename(:display), :class => article.css_class_name, :style => 'max-width: 100%') +
121   - content_tag('p', article.abstract, :class => 'uploaded-file-description')
122   -
  112 + image_tag(article.public_filename(:display),
  113 + :class => article.css_class_name,
  114 + :style => 'max-width: 100%') +
  115 + content_tag('div', article.abstract, :class => 'uploaded-file-description')
123 116 end
124 117 else
125 118 lambda do
126   - content_tag('ul', content_tag('li', link_to(article.name, article.url, :class => article.css_class_name))) +
127   - content_tag('p', article.abstract, :class => 'uploaded-file-description')
  119 + content_tag('div',
  120 + link_to(article.name, article.url),
  121 + :class => article.css_class_name) +
  122 + content_tag('div', article.abstract, :class => 'uploaded-file-description')
128 123 end
129 124 end
130 125 end
... ...
app/views/cms/view.rhtml
... ... @@ -40,13 +40,15 @@
40 40 </tr>
41 41 <% end %>
42 42  
43   - <% @articles.each do |article| %>
  43 + <% @articles.each do |article| article = FilePresenter.for article %>
44 44 <tr>
45 45 <td>
46 46 <%= link_to_article(article) %>
47 47 </td>
48 48 <td>
49   - <%= article.class.short_description %>
  49 + <%= article.respond_to?(:short_description) ?
  50 + article.short_description :
  51 + article.class.short_description %>
50 52 </td>
51 53 <td class="article-controls">
52 54 <%= expirable_button article, :edit, _('Edit'), {:action => 'edit', :id => article.id} if !remove_content_button(:edit) %>
... ...
app/views/file_presenter/_generic.html.erb 0 → 100644
... ... @@ -0,0 +1,9 @@
  1 +<span class="download-link">
  2 + <span>Download</span>
  3 + <strong><%= link_to generic.filename, generic.public_filename %></strong>
  4 +</span>
  5 +
  6 +<div class="uploaded-file-description <%= 'empty' if generic.abstract.blank? %>">
  7 + <%= generic.abstract %>
  8 +</div>
  9 +
... ...
app/views/file_presenter/_image.html.erb 0 → 100644
... ... @@ -0,0 +1,36 @@
  1 +<% if image.gallery? && options[:gallery_view] %>
  2 +<%
  3 + images = image.parent.images
  4 + current_index = images.index(image.encapsulated_file)
  5 + total_of_images = images.count
  6 + link_to_previous = if current_index >= 1
  7 + link_to(_('&laquo; Previous'), images[current_index - 1].view_url, :class => 'previous')
  8 + else
  9 + content_tag('span', _('&laquo; Previous'), :class => 'previous')
  10 + end
  11 +
  12 + link_to_next = if current_index < total_of_images - 1
  13 + link_to(_('Next &raquo;'), images[current_index + 1].view_url, :class => 'next')
  14 + else
  15 + content_tag('span', _('Next &raquo;'), :class => 'next')
  16 + end
  17 +%>
  18 +
  19 +<div class="gallery-navigation">
  20 + <%= link_to_previous %>
  21 + <span class="total-of-images">
  22 + <%= _('image %d of %d') % [current_index + 1, total_of_images] %>
  23 + </span>
  24 + <%= link_to_next %>
  25 +</div>
  26 +
  27 +<% end %>
  28 +
  29 +<%# image_tag(article.public_filename(:display), :class => article.css_class_name, :style => 'max-width: 100%') %>
  30 +
  31 +<img src="<%=image.public_filename(:display)%>" class="<%=image.css_class_name%>">
  32 +
  33 +<div class="uploaded-file-description <%= 'empty' if image.abstract.blank? %>">
  34 + <%= image.abstract %>
  35 +</div>
  36 +
... ...
lib/file_presenter.rb 0 → 100644
... ... @@ -0,0 +1,107 @@
  1 +# All file presenters must extends `FilePresenter` not only to ensure the
  2 +# same interface, but also to make `FilePresenter.for(file)` to work.
  3 +class FilePresenter
  4 +
  5 + # Will return a encapsulated `UploadedFile` or the same object if no
  6 + # one accepts it. That behave allow to give any model to this class,
  7 + # like a Article and have no trouble with that.
  8 + def self.for(f)
  9 + return f if f.is_a? FilePresenter
  10 + klass = FilePresenter.subclasses.sort_by {|class_name|
  11 + class_name.constantize.accepts?(f) || 0
  12 + }.last.constantize
  13 + klass.accepts?(f) ? klass.new(f) : f
  14 + end
  15 +
  16 + def initialize(f)
  17 + @file = f
  18 + end
  19 +
  20 + # Allows to use the original `UploadedFile` reference.
  21 + def encapsulated_file
  22 + @file
  23 + end
  24 +
  25 + def id
  26 + @file.id
  27 + end
  28 +
  29 + def reload
  30 + @file.reload
  31 + self
  32 + end
  33 +
  34 + # This method must be overridden in subclasses.
  35 + #
  36 + # If the class accepts the file, return a number that represents the
  37 + # priority the class should be given to handle that file. Higher numbers
  38 + # mean higher priority.
  39 + #
  40 + # If the class does not accept the file, return false.
  41 + def self.accepts?(f)
  42 + nil
  43 + end
  44 +
  45 + def short_description
  46 + _("File (%s)") % content_type
  47 + end
  48 +
  49 + # Define the css classes to style the page fragment with the file related
  50 + # content. If you want other classes to identify this area to your
  51 + # customized presenter, so do this:
  52 + # def css_class_list
  53 + # [super, 'myclass'].flatten
  54 + # end
  55 + def css_class_list
  56 + [ @file.css_class_list,
  57 + 'file-' + self.class.to_s.split(/:+/).map(&:underscore)[1..-1].join('-'),
  58 + 'content-type_' + self.content_type.split('/')[0],
  59 + 'content-type_' + self.content_type.gsub(/[^a-z0-9]/i,'-')
  60 + ].flatten
  61 + end
  62 +
  63 + # Enable file presenter to customize the css classes on view_page.rhtml
  64 + # You may not overwrite this method on your customized presenter.
  65 + def css_class_name
  66 + [css_class_list].flatten.compact.join(' ')
  67 + end
  68 +
  69 + # The generic icon class-name or the specific file path.
  70 + # You may replace this method on your custom FilePresenter.
  71 + # See the current used icons class-names in public/designs/icons/tango/style.css
  72 + def icon_name
  73 + if mime_type
  74 + [ mime_type.split('/')[0], mime_type.gsub(/[^a-z0-9]/i, '-') ]
  75 + else
  76 + 'upload-file'
  77 + end
  78 + end
  79 +
  80 + # Automatic render `file_presenter/<custom>.html.erb` to display your
  81 + # custom presenter html content.
  82 + # You may not overwrite this method on your customized presenter.
  83 + # A variable with the same presenter name will be created to refer
  84 + # to the file object.
  85 + # Example:
  86 + # The `FilePresenter::Image` render `file_presenter/image.html.erb`
  87 + # inside the `file_presenter/image.html.erb` you can access the
  88 + # required `FilePresenter::Image` instance in the `image` variable.
  89 + def to_html(options = {})
  90 + file = self
  91 + lambda do
  92 + render :partial => file.class.to_s.underscore,
  93 + :locals => { :options => options },
  94 + :object => file
  95 + end
  96 + end
  97 +
  98 + # That makes the presenter to works like any other `UploadedFile` instance.
  99 + def method_missing(m, *args)
  100 + @file.send(m, *args)
  101 + end
  102 +
  103 +end
  104 +
  105 +# Preload FilePresenters to allow `FilePresenter.for()` to work
  106 +FilePresenter::Generic
  107 +FilePresenter::Image
... ...
lib/file_presenter/generic.rb 0 → 100644
... ... @@ -0,0 +1,11 @@
  1 +# Made to encapsulate any UploadedFile
  2 +class FilePresenter::Generic < FilePresenter
  3 + def initialize(f)
  4 + @file = f
  5 + end
  6 +
  7 + # if returns low priority, because it is generic.
  8 + def self.accepts?(f)
  9 + 1 if f.is_a? UploadedFile
  10 + end
  11 +end
... ...
lib/file_presenter/image.rb 0 → 100644
... ... @@ -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
... ...
plugins/html5_video/lib/file_presenter/video.rb 0 → 100644
... ... @@ -0,0 +1,14 @@
  1 +class FilePresenter::Video < FilePresenter
  2 + def initialize(f)
  3 + @file = f
  4 + end
  5 +
  6 + def self.accepts?(f)
  7 + return nil if !f.respond_to?(:content_type) || f.content_type.nil?
  8 + ( f.content_type[0..4] == 'video' ) ? 10 : nil
  9 + end
  10 +
  11 + def short_description
  12 + _('Video (%s)') % content_type.split('/')[1].upcase
  13 + end
  14 +end
... ...
plugins/html5_video/lib/html5_video_plugin.rb 0 → 100644
... ... @@ -0,0 +1,13 @@
  1 +class Html5VideoPlugin < Noosfero::Plugin
  2 +
  3 + FilePresenter::Video
  4 +
  5 + def self.plugin_name
  6 + "HTML5 Video"
  7 + end
  8 +
  9 + def self.plugin_description
  10 + _("A plugin to enable the video suport, with auto conversion for the web.")
  11 + end
  12 +
  13 +end
... ...
plugins/html5_video/test/functional/content_viewer_controler_test.rb 0 → 100644
... ... @@ -0,0 +1,30 @@
  1 +require File.dirname(__FILE__) + '/../../../../test/test_helper'
  2 +require 'content_viewer_controller'
  3 +
  4 +class ContentViewerController
  5 + # Re-raise errors caught by the controller.
  6 + def rescue_action(e) raise e end
  7 + append_view_path File.join(File.dirname(__FILE__) + '/../../views')
  8 +end
  9 +
  10 +class ContentViewerControllerTest < ActionController::TestCase
  11 +
  12 + all_fixtures
  13 +
  14 + def setup
  15 + @controller = ContentViewerController.new
  16 + @request = ActionController::TestRequest.new
  17 + @response = ActionController::TestResponse.new
  18 +
  19 + @profile = create_user('testinguser').person
  20 + @environment = @profile.environment
  21 + end
  22 + attr_reader :profile, :environment
  23 +
  24 + should 'add html5 video tag to the page of file type video' do
  25 + file = UploadedFile.create!(:uploaded_data => fixture_file_upload('/files/test.txt', 'video/ogg'), :profile => profile)
  26 + get :view_page, file.url.merge(:view=>:true)
  27 + assert_select '#article video'
  28 + end
  29 +
  30 +end
... ...
plugins/html5_video/views/file_presenter/_video.html.erb 0 → 100644
... ... @@ -0,0 +1,8 @@
  1 +<video class="video-js vjs-default-skin" controls poster="video.jpg" preload="auto" data-setup="{}">
  2 + <source type="video/ogg" src="<%= video.public_filename %>"/>
  3 +</video>
  4 +
  5 +<div class="uploaded-file-description <%= 'empty' if video.abstract.blank? %>">
  6 + <%= video.abstract %>
  7 +</div>
  8 +
... ...
public/designs/icons/tango/ie6.css
... ... @@ -1,52 +0,0 @@
1   -.msie6 .icon-edit { background-image: url(ie6/Tango/16x16/apps/text-editor.gif) }
2   -.msie6 .icon-home { background-image: url(ie6/Tango/16x16/actions/go-home.gif) }
3   -.msie6 .icon-new,
4   -.msie6 .icon-suggest { background-image: url(ie6/Tango/16x16/actions/filenew.gif) }
5   -.msie6 .icon-close { background-image: url(ie6/Tango/16x16/actions/gtk-cancel.gif) }
6   -.msie6 .icon-newfolder { background-image: url(ie6/Tango/16x16/actions/folder-new.gif) }
7   -.msie6 .icon-save { background-image: url(ie6/Tango/16x16/actions/filesave.gif) }
8   -.msie6 .icon-send { background-image: url(ie6/Tango/16x16/actions/stock_mail-forward.gif) }
9   -.msie6 .icon-cancel { background-image: url(ie6/Tango/16x16/actions/gtk-cancel.gif) }
10   -.msie6 .icon-person { background-image: url(ie6/Tango/16x16/apps/system-config-users.gif) }
11   -.msie6 .icon-product { background-image: url(ie6/Tango/16x16/mimetypes/package.gif) }
12   -.msie6 .icon-delete { background-image: url(ie6/Tango/16x16/places/user-trash.gif) }
13   -.msie6 .icon-back { background-image: url(ie6/Tango/16x16/actions/back.gif) }
14   -.msie6 .icon-next { background-image: url(ie6/Tango/16x16/actions/go-next.gif) }
15   -.msie6 .icon-add { background-image: url(ie6/Tango/16x16/actions/add.gif) }
16   -.msie6 .icon-more { background-image: url(ie6/Tango/16x16/actions/add.gif) }
17   -.msie6 .icon-up { background-image: url(ie6/Tango/16x16/actions/go-up.gif) }
18   -.msie6 .icon-down { background-image: url(ie6/Tango/16x16/actions/go-down.gif) }
19   -.msie6 .icon-left { background-image: url(ie6/Tango/16x16/actions/go-previous.gif) }
20   -.msie6 .icon-right { background-image: url(ie6/Tango/16x16/actions/go-next.gif) }
21   -.msie6 .icon-up-disabled { background-image: url(ie6/Tango/16x16/actions/go-up.gif); opacity: 0.25; filter:alpha(opacity=25); }
22   -.msie6 .icon-down-disabled { background-image: url(ie6/Tango/16x16/actions/go-down.gif); opacity: 0.25; filter:alpha(opacity=25); }
23   -.msie6 .icon-left-disabled { background-image: url(ie6/Tango/16x16/actions/go-previous.gif); opacity: 0.25; filter:alpha(opacity=25); }
24   -.msie6 .icon-right-disabled { background-image: url(ie6/Tango/16x16/actions/go-next.gif); opacity: 0.25; filter:alpha(opacity=25); }
25   -.msie6 .icon-up-red { background-image: url(ie6/mod/16x16/actions/go-up-red.gif) }
26   -.msie6 .icon-forward { background-image: url(ie6/Tango/16x16/actions/go-next.gif) }
27   -.msie6 .icon-search { background-image: url(ie6/Tango/16x16/actions/search.gif) }
28   -.msie6 .icon-ok { background-image: url(ie6/Tango/16x16/actions/media-playback-start.gif) }
29   -.msie6 .icon-login { background-image: url(ie6/mod/16x16/actions/log-in.gif) }
30   -.msie6 .icon-help { background-image: url(ie6/Tango/16x16/apps/gnome-help.gif) }
31   -.msie6 .icon-firefox { background-image: url(firefox-24x24.gif) }
32   -.msie6 .icon-help32on { background-image: url(ie6/Tango/32x32/apps/gnome-help.gif) }
33   -.msie6 .icon-help32off { background-image: url(ie6/mod/32x32/apps/gnome-help-red.gif) }
34   -.msie6 .icon-spread { background-image: url(ie6/mod/16x16/actions/spread.gif) }
35   -.msie6 .icon-todo { background-image: url(ie6/Tango/16x16/actions/stock_paste.gif) }
36   -.msie6 .icon-eyes { background-image: url(ie6/Tango/16x16/actions/gtk-print-preview.gif) }
37   -.msie6 .icon-menu-home { background-image: url(ie6/Tango/16x16/actions/go-home.gif) }
38   -.msie6 .icon-menu-product { background-image: url(ie6/Tango/16x16/mimetypes/package.gif) }
39   -.msie6 .icon-menu-enterprise { background-image: url(ie6/Tango/16x16/actions/go-home.gif) }
40   -.msie6 .icon-menu-community { background-image: url(ie6/Tango/16x16/apps/system-config-users.gif) }
41   -.msie6 .icon-menu-ctrl-panel { background-image: url(ie6/Tango/16x16/categories/preferences-desktop.gif) }
42   -.msie6 .icon-menu-admin { background-image: url(ie6/Tango/16x16/categories/preferences-system.gif) }
43   -.msie6 .icon-menu-my-groups { background-image: url(ie6/Tango/16x16/apps/system-config-users.gif) }
44   -.msie6 .icon-menu-login { background-image: url(ie6/mod/16x16/actions/log-in.gif) }
45   -.msie6 .icon-menu-logout { background-image: url(ie6/Tango/16x16/actions/exit.gif) }
46   -.msie6 .icon-menu-search { background-image: url(ie6/Tango/16x16/actions/search.gif) }
47   -.msie6 .icon-menu-events { background-image: url(ie6/Tango/16x16/mimetypes/stock_calendar.gif) }
48   -.msie6 .icon-menu-articles { background-image: url(ie6/Tango/16x16/apps/text-editor.gif) }
49   -.msie6 .icon-menu-people { background-image: url(ie6/mod/16x16/apps/user.gif) }
50   -.msie6 .icon-menu-mail { background-image: url(ie6/Tango/16x16/apps/email.gif) }
51   -.msie6 .icon-upload-file { background-image: url(ie6/Tango/16x16/actions/filesave.gif) }
52   -.msie6 .icon-slideshow { background-image: url(ie6/Tango/16x16/mimetypes/x-office-presentation.gif) }
public/designs/icons/tango/ie6/Tango/16x16/actions/add.gif

192 Bytes

public/designs/icons/tango/ie6/Tango/16x16/actions/back.gif

570 Bytes

public/designs/icons/tango/ie6/Tango/16x16/actions/exit.gif

1.03 KB

public/designs/icons/tango/ie6/Tango/16x16/actions/filenew.gif

354 Bytes

public/designs/icons/tango/ie6/Tango/16x16/actions/filesave.gif

750 Bytes

public/designs/icons/tango/ie6/Tango/16x16/actions/folder-new.gif

599 Bytes

public/designs/icons/tango/ie6/Tango/16x16/actions/go-down.gif

568 Bytes

public/designs/icons/tango/ie6/Tango/16x16/actions/go-home.gif

587 Bytes

public/designs/icons/tango/ie6/Tango/16x16/actions/go-next.gif

570 Bytes

public/designs/icons/tango/ie6/Tango/16x16/actions/go-previous.gif

570 Bytes

public/designs/icons/tango/ie6/Tango/16x16/actions/go-up.gif

572 Bytes

public/designs/icons/tango/ie6/Tango/16x16/actions/gtk-cancel.gif

1022 Bytes

public/designs/icons/tango/ie6/Tango/16x16/actions/gtk-print-preview.gif

1022 Bytes

public/designs/icons/tango/ie6/Tango/16x16/actions/media-playback-start.gif

314 Bytes

public/designs/icons/tango/ie6/Tango/16x16/actions/search.gif

601 Bytes

public/designs/icons/tango/ie6/Tango/16x16/actions/stock_mail-forward.gif

601 Bytes

public/designs/icons/tango/ie6/Tango/16x16/actions/stock_paste.gif

595 Bytes

public/designs/icons/tango/ie6/Tango/16x16/apps/email.gif

347 Bytes

public/designs/icons/tango/ie6/Tango/16x16/apps/gnome-help.gif

1.01 KB

public/designs/icons/tango/ie6/Tango/16x16/apps/system-config-users.gif

1.05 KB

public/designs/icons/tango/ie6/Tango/16x16/apps/text-editor.gif

363 Bytes

public/designs/icons/tango/ie6/Tango/16x16/categories/preferences-desktop.gif

357 Bytes

public/designs/icons/tango/ie6/Tango/16x16/categories/preferences-system.gif

333 Bytes

public/designs/icons/tango/ie6/Tango/16x16/mimetypes/package.gif

573 Bytes

public/designs/icons/tango/ie6/Tango/16x16/mimetypes/stock_calendar.gif

382 Bytes

public/designs/icons/tango/ie6/Tango/16x16/mimetypes/x-office-presentation.gif

559 Bytes

public/designs/icons/tango/ie6/Tango/16x16/places/user-home.gif

1 KB

public/designs/icons/tango/ie6/Tango/16x16/places/user-trash.gif

1009 Bytes

public/designs/icons/tango/ie6/Tango/32x32/apps/gnome-help.gif

1.03 KB

public/designs/icons/tango/ie6/mod/16x16/actions/go-up-red.gif

361 Bytes

public/designs/icons/tango/ie6/mod/16x16/actions/log-in.gif

246 Bytes

public/designs/icons/tango/ie6/mod/16x16/actions/log-out.gif

241 Bytes

public/designs/icons/tango/ie6/mod/16x16/actions/password.gif

546 Bytes

public/designs/icons/tango/ie6/mod/16x16/actions/spread.gif

532 Bytes

public/designs/icons/tango/ie6/mod/16x16/apps/user.gif

620 Bytes

public/designs/icons/tango/ie6/mod/32x32/apps/gnome-help-red.gif

969 Bytes

public/designs/icons/tango/style.css
1   -@import url(ie6.css);
2   -
3 1 /******************SMALL ICONS********************/
4 2 .icon-edit { background-image: url(Tango/16x16/apps/text-editor.png) }
5   -.icon-home { background-image: url(Tango/16x16/actions/go-home.png) }
  3 +.icon-home { background-image: url(Tango/16x16/actions/go-home.png) }
6 4 .icon-new,
7   -.icon-suggest { background-image: url(Tango/16x16/actions/filenew.png) }
8   -.icon-close { background-image: url(Tango/16x16/actions/gtk-cancel.png) }
  5 +.icon-suggest { background-image: url(Tango/16x16/actions/filenew.png) }
  6 +.icon-close { background-image: url(Tango/16x16/actions/gtk-cancel.png) }
9 7 .icon-newfolder { background-image: url(Tango/16x16/actions/folder-new.png) }
10 8 .icon-folder { background-image: url(Tango/16x16/places/folder.png) }
11   -.icon-parent-folder { background-image: url(Tango/16x16/places/folder_home.png) }
  9 +.icon-parent-folder { background-image: url(Tango/16x16/places/folder_home.png) }
12 10 .icon-newblog { background-image: url(mod/16x16/apps/text-editor.png) }
13 11 .icon-blog { background-image: url(mod/16x16/apps/text-editor.png) }
14   -/*.icon-open { background-image: url(folder-open.gif) } UNUSED*/
15   -/*.icon-cms { background-image: url(abiword_48.png) } UNUSED*/
16   -.icon-save { background-image: url(Tango/16x16/actions/filesave.png) }
17   -.icon-send { background-image: url(Tango/16x16/actions/stock_mail-forward.png) }
18   -.icon-cancel { background-image: url(Tango/16x16/actions/gtk-cancel.png) }
19   -.icon-person { background-image: url(Tango/16x16/apps/system-config-users.png) }
20   -.icon-product { background-image: url(Tango/16x16/mimetypes/package.png) }
  12 +/*.icon-open { background-image: url(folder-open.gif) } UNUSED*/
  13 +/*.icon-cms { background-image: url(abiword_48.png) } UNUSED*/
  14 +.icon-save { background-image: url(Tango/16x16/actions/filesave.png) }
  15 +.icon-send { background-image: url(Tango/16x16/actions/stock_mail-forward.png) }
  16 +.icon-cancel { background-image: url(Tango/16x16/actions/gtk-cancel.png) }
  17 +.icon-person { background-image: url(Tango/16x16/apps/system-config-users.png) }
  18 +.icon-product { background-image: url(Tango/16x16/mimetypes/package.png) }
21 19 .icon-delete { background-image: url(Tango/16x16/places/user-trash.png) }
22   -/*.icon-find { background-image: url(noosfero-find.png) } UNUSED*/
23   -.icon-back { background-image: url(Tango/16x16/actions/back.png) }
24   -.icon-next { background-image: url(Tango/16x16/actions/go-next.png) }
25   -.icon-add { background-image: url(Tango/16x16/actions/add.png) }
26   -.icon-remove { background-image: url(Tango/16x16/actions/gtk-remove.png) }
27   -.icon-more { background-image: url(Tango/16x16/actions/add.png) }
28   -.icon-up { background-image: url(Tango/16x16/actions/go-up.png) }
29   -.icon-down { background-image: url(Tango/16x16/actions/go-down.png) }
30   -.icon-left { background-image: url(Tango/16x16/actions/go-previous.png) }
31   -.icon-right { background-image: url(Tango/16x16/actions/go-next.png) }
32   -.icon-up-disabled { background-image: url(Tango/16x16/actions/go-up.png); opacity: 0.25; filter:alpha(opacity=25); }
33   -.icon-down-disabled { background-image: url(Tango/16x16/actions/go-down.png); opacity: 0.25; filter:alpha(opacity=25); }
34   -.icon-left-disabled { background-image: url(Tango/16x16/actions/go-previous.png); opacity: 0.25; filter:alpha(opacity=25); }
35   -.icon-right-disabled { background-image: url(Tango/16x16/actions/go-next.png); opacity: 0.25; filter:alpha(opacity=25); }
36   -.icon-up-red { background-image: url(mod/16x16/actions/go-up-red.png) }
37   -.icon-forward { background-image: url(Tango/16x16/actions/go-next.png) }
38   -.icon-search { background-image: url(Tango/16x16/actions/search.png) }
39   -.icon-ok { background-image: url(Tango/16x16/actions/media-playback-start.png) }
40   -.icon-login { background-image: url(mod/16x16/actions/log-in.png) }
41   -.icon-help { background-image: url(Tango/16x16/apps/gnome-help.png) }
42   -.icon-firefox { background-image: url(firefox-24x24.gif) }
43   -.icon-help32on { background-image: url(Tango/32x32/apps/gnome-help.png) }
44   -.icon-help32off { background-image: url(mod/32x32/apps/gnome-help-red.png) }
  20 +/*.icon-find { background-image: url(noosfero-find.png) } UNUSED*/
  21 +.icon-back { background-image: url(Tango/16x16/actions/back.png) }
  22 +.icon-next { background-image: url(Tango/16x16/actions/go-next.png) }
  23 +.icon-add { background-image: url(Tango/16x16/actions/add.png) }
  24 +.icon-remove { background-image: url(Tango/16x16/actions/gtk-remove.png) }
  25 +.icon-more { background-image: url(Tango/16x16/actions/add.png) }
  26 +.icon-up { background-image: url(Tango/16x16/actions/go-up.png) }
  27 +.icon-down { background-image: url(Tango/16x16/actions/go-down.png) }
  28 +.icon-left { background-image: url(Tango/16x16/actions/go-previous.png) }
  29 +.icon-right { background-image: url(Tango/16x16/actions/go-next.png) }
  30 +.icon-up-disabled { background-image: url(Tango/16x16/actions/go-up.png); opacity: 0.25; filter:alpha(opacity=25); }
  31 +.icon-down-disabled { background-image: url(Tango/16x16/actions/go-down.png); opacity: 0.25; filter:alpha(opacity=25); }
  32 +.icon-left-disabled { background-image: url(Tango/16x16/actions/go-previous.png); opacity: 0.25; filter:alpha(opacity=25); }
  33 +.icon-right-disabled { background-image: url(Tango/16x16/actions/go-next.png); opacity: 0.25; filter:alpha(opacity=25); }
  34 +.icon-up-red { background-image: url(mod/16x16/actions/go-up-red.png) }
  35 +.icon-forward { background-image: url(Tango/16x16/actions/go-next.png) }
  36 +.icon-search { background-image: url(Tango/16x16/actions/search.png) }
  37 +.icon-ok { background-image: url(Tango/16x16/actions/media-playback-start.png) }
  38 +.icon-login { background-image: url(mod/16x16/actions/log-in.png) }
  39 +.icon-help { background-image: url(Tango/16x16/apps/gnome-help.png) }
  40 +.icon-firefox { background-image: url(firefox-24x24.gif) }
  41 +.icon-help32on { background-image: url(Tango/32x32/apps/gnome-help.png) }
  42 +.icon-help32off { background-image: url(mod/32x32/apps/gnome-help-red.png) }
45 43 .icon-spread { background-image: url(mod/16x16/actions/spread.png) }
46   -.icon-todo { background-image: url(Tango/16x16/actions/stock_paste.png) }
47   -.icon-eyes { background-image: url(Tango/16x16/actions/gtk-print-preview.png) }
48   -/*.icon-menu- { background-image: url(menu-without-ico-HC.gif) }*/
49   -.icon-menu-home { background-image: url(Tango/16x16/actions/go-home.png) }
50   -/*.icon-menu-blog { background-image: url(blog-HC.gif) } UNUSED*/
51   -/*.icon-menu-album { background-image: url(album-HC.gif) } UNUSED*/
52   -.icon-menu-product { background-image: url(Tango/16x16/mimetypes/package.png) }
53   -.icon-menu-enterprise { background-image: url(Tango/16x16/actions/go-home.png) }
54   -.icon-menu-community { background-image: url(Tango/16x16/apps/system-config-users.png) }
55   -/*.icon-menu-edit { background-image: url(edit-HC.gif) } UNUSED */
56   -.icon-menu-ctrl-panel { background-image: url(Tango/16x16/categories/preferences-desktop.png) }
57   -.icon-menu-admin { background-image: url(Tango/16x16/categories/preferences-system.png) }
58   -.icon-menu-my-groups { background-image: url(Tango/16x16/apps/system-config-users.png) }
59   -.icon-menu-login { background-image: url(mod/16x16/actions/log-in.png) }
60   -.icon-menu-logout { background-image: url(mod/16x16/actions/log-out.png) }
61   -.icon-menu-search { background-image: url(Tango/16x16/actions/search.png) }
62   -/*.icon-menu-ed-design { background-image: url(edit-design-HC.gif) } UNUSED */
63   -.icon-menu-events { background-image: url(Tango/16x16/mimetypes/stock_calendar.png) }
64   -.icon-event { background-image: url(Tango/16x16/mimetypes/stock_calendar.png) }
65   -.icon-newevent { background-image: url(Tango/16x16/mimetypes/stock_calendar.png) }
66   -.icon-menu-articles { background-image: url(Tango/16x16/apps/text-editor.png) }
67   -/*.icon-menu-comments { background-image: url(blog-HC.gif) } UNUSED */
68   -.icon-menu-people { background-image: url(mod/16x16/apps/user.png) }
69   -.icon-menu-mail { background-image: url(Tango/16x16/apps/email.png) }
70   -.icon-upload-file { background-image: url(Tango/16x16/actions/filesave.png) }
71   -.icon-newupload-file { background-image: url(Tango/16x16/actions/filesave.png) }
72   -.icon-slideshow { background-image: url(Tango/16x16/mimetypes/x-office-presentation.png) }
  44 +.icon-todo { background-image: url(Tango/16x16/actions/stock_paste.png) }
  45 +.icon-eyes { background-image: url(Tango/16x16/actions/find.png) }
  46 +/*.icon-menu- { background-image: url(menu-without-ico-HC.gif) }*/
  47 +.icon-menu-home { background-image: url(Tango/16x16/actions/go-home.png) }
  48 +/*.icon-menu-blog { background-image: url(blog-HC.gif) } UNUSED*/
  49 +/*.icon-menu-album { background-image: url(album-HC.gif) } UNUSED*/
  50 +.icon-menu-product { background-image: url(Tango/16x16/mimetypes/package.png) }
  51 +.icon-menu-enterprise { background-image: url(Tango/16x16/actions/go-home.png) }
  52 +.icon-menu-community { background-image: url(Tango/16x16/apps/system-config-users.png) }
  53 +/*.icon-menu-edit { background-image: url(edit-HC.gif) } UNUSED */
  54 +.icon-menu-ctrl-panel { background-image: url(Tango/16x16/categories/preferences-desktop.png) }
  55 +.icon-menu-admin { background-image: url(Tango/16x16/categories/preferences-system.png) }
  56 +.icon-menu-my-groups { background-image: url(Tango/16x16/apps/system-config-users.png) }
  57 +.icon-menu-login { background-image: url(mod/16x16/actions/log-in.png) }
  58 +.icon-menu-logout { background-image: url(mod/16x16/actions/log-out.png) }
  59 +.icon-menu-search { background-image: url(Tango/16x16/actions/search.png) }
  60 +/*.icon-menu-ed-design { background-image: url(edit-design-HC.gif) } UNUSED */
  61 +.icon-menu-events { background-image: url(Tango/16x16/mimetypes/stock_calendar.png) }
  62 +.icon-event { background-image: url(Tango/16x16/mimetypes/stock_calendar.png) }
  63 +.icon-newevent { background-image: url(Tango/16x16/mimetypes/stock_calendar.png) }
  64 +.icon-menu-articles { background-image: url(Tango/16x16/apps/text-editor.png) }
  65 +/*.icon-menu-comments { background-image: url(blog-HC.gif) } UNUSED */
  66 +.icon-menu-people { background-image: url(mod/16x16/apps/user.png) }
  67 +.icon-menu-mail { background-image: url(Tango/16x16/apps/email.png) }
  68 +.icon-upload-file { background-image: url(Tango/16x16/actions/filesave.png) }
  69 +.icon-newupload-file { background-image: url(Tango/16x16/actions/filesave.png) }
  70 +.icon-slideshow { background-image: url(Tango/16x16/mimetypes/x-office-presentation.png) }
73 71 .icon-photos { background-image: url(Tango/16x16/devices/camera-photo.png) }
74 72  
75   -.icon-text-html { background-image: url(Tango/16x16/mimetypes/text-html.png) }
  73 +.icon-text-html { background-image: url(Tango/16x16/mimetypes/text-html.png) }
76 74 .icon-text-plain { background-image: url(Tango/16x16/mimetypes/text-x-generic.png) }
77   -.icon-image-svg-xml { background-image: url(Tango/16x16/mimetypes/image-x-generic.png) }
  75 +.icon-image-svg-xml { background-image: url(Tango/16x16/mimetypes/image-x-generic.png) }
78 76 .icon-application-octet-stream { background-image: url(Tango/16x16/mimetypes/binary.png) }
79   -.icon-application-x-gzip { background-image: url(Tango/16x16/mimetypes/gnome-mime-application-x-gzip.png) }
80   -.icon-application-postscript { background-image: url(Tango/16x16/mimetypes/gnome-mime-application-postscript.png) }
81   -.icon-application-pdf { background-image: url(Tango/16x16/mimetypes/gnome-mime-application-pdf.png) }
82   -.icon-application-ogg { background-image: url(Tango/16x16/mimetypes/gnome-mime-application-ogg.png) }
83   -.icon-video-mpeg { background-image: url(Tango/16x16/mimetypes/video-x-generic.png) }
84   -.icon-application-vnd-oasis-opendocument-text { background-image: url(Tango/16x16/mimetypes/gnome-mime-application-vnd.oasis.opendocument.text.png) }
  77 +.icon-application-x-gzip { background-image: url(Tango/16x16/mimetypes/gnome-mime-application-x-gzip.png) }
  78 +.icon-application-postscript { background-image: url(Tango/16x16/mimetypes/gnome-mime-application-postscript.png) }
  79 +.icon-application-pdf { background-image: url(Tango/16x16/mimetypes/gnome-mime-application-pdf.png) }
  80 +.icon-application-ogg { background-image: url(Tango/16x16/mimetypes/gnome-mime-application-ogg.png) }
  81 +.icon-video, .icon-video-mpeg { background-image: url(Tango/16x16/mimetypes/video-x-generic.png) }
  82 +.icon-application-vnd-oasis-opendocument-text { background-image: url(Tango/16x16/mimetypes/gnome-mime-application-vnd.oasis.opendocument.text.png) }
85 83 .icon-application-vnd-oasis-opendocument-spreadsheet { background-image: url(Tango/16x16/mimetypes/gnome-mime-application-vnd.oasis.opendocument.spreadsheet.png) }
86   -.icon-application-vnd-oasis-opendocument-presentation { background-image: url(Tango/16x16/mimetypes/gnome-mime-application-vnd.oasis.opendocument.presentation.png) }
  84 +.icon-application-vnd-oasis-opendocument-presentation { background-image: url(Tango/16x16/mimetypes/gnome-mime-application-vnd.oasis.opendocument.presentation.png) }
87 85  
88   -.icon-media-pause { background-image: url(Tango/16x16/actions/media-playback-pause.png) }
89   -.icon-media-play { background-image: url(Tango/16x16/actions/media-playback-start.png) }
90   -.icon-media-prev { background-image: url(Tango/16x16/actions/media-skip-backward.png) }
91   -.icon-media-next { background-image: url(Tango/16x16/actions/media-skip-forward.png) }
  86 +.icon-media-pause { background-image: url(Tango/16x16/actions/media-playback-pause.png) }
  87 +.icon-media-play { background-image: url(Tango/16x16/actions/media-playback-start.png) }
  88 +.icon-media-prev { background-image: url(Tango/16x16/actions/media-skip-backward.png) }
  89 +.icon-media-next { background-image: url(Tango/16x16/actions/media-skip-forward.png) }
92 90 .icon-lock { background-image: url(Tango/16x16/actions/lock.png) }
93   -.icon-chat { background-image: url(Tango/16x16/apps/internet-group-chat.png); background-repeat: no-repeat }
94   -.icon-reply { background-image: url(Tango/16x16/actions/mail-reply-sender.png) }
95   -.icon-newforum { background-image: url(Tango/16x16/apps/internet-group-chat.png) }
96   -.icon-forum { background-image: url(Tango/16x16/apps/system-users.png) }
97   -.icon-gallery { background-image: url(Tango/16x16/mimetypes/image-x-generic.png) }
  91 +.icon-chat { background-image: url(Tango/16x16/apps/internet-group-chat.png); background-repeat: no-repeat }
  92 +.icon-reply { background-image: url(Tango/16x16/actions/mail-reply-sender.png) }
  93 +.icon-newforum { background-image: url(Tango/16x16/apps/internet-group-chat.png) }
  94 +.icon-forum { background-image: url(Tango/16x16/apps/system-users.png) }
  95 +.icon-gallery { background-image: url(Tango/16x16/mimetypes/image-x-generic.png) }
98 96 .icon-newgallery { background-image: url(Tango/16x16/mimetypes/image-x-generic.png) }
99   -.icon-locale { background-image: url(Tango/16x16/apps/preferences-desktop-locale.png) }
100   -.icon-user-removed { background-image: url(Tango/16x16/actions/gtk-cancel.png) }
101   -.icon-user-unknown { background-image: url(Tango/16x16/status/dialog-error.png) }
102   -.icon-alert { background-image: url(Tango/16x16/status/dialog-warning.png) }
  97 +.icon-locale { background-image: url(Tango/16x16/apps/preferences-desktop-locale.png) }
  98 +.icon-user-removed { background-image: url(Tango/16x16/actions/gtk-cancel.png) }
  99 +.icon-user-unknown { background-image: url(Tango/16x16/status/dialog-error.png) }
  100 +.icon-alert { background-image: url(Tango/16x16/status/dialog-warning.png) }
103 101  
104 102 /******************LARGE ICONS********************/
105   -.image-gallery-item .folder { background-image: url(mod/96x96/places/folder.png) }
106   -.image-gallery-item .gallery { background-image: url(mod/96x96/mimetypes/image-x-generic.png) }
  103 +.image-gallery-item .folder { background-image: url(mod/96x96/places/folder.png) }
  104 +.image-gallery-item .gallery { background-image: url(mod/96x96/mimetypes/image-x-generic.png) }
... ...
public/designs/themes/base/style.css
... ... @@ -822,12 +822,6 @@ div#notice {
822 822 margin-bottom: 0px;
823 823 }
824 824  
825   -X.sep {
826   - background: url(imgs/blog-sep.png) 50% 50% repeat-x;
827   - padding: 10px 20px;
828   - margin: 10px -19px;
829   -}
830   -
831 825 /* ==> search-results.css <== */
832 826  
833 827  
... ... @@ -1019,6 +1013,46 @@ hr.pre-posts, hr.sep-posts {
1019 1013 background: transparent;
1020 1014 }
1021 1015  
  1016 +/************* uploaded file *****************/
  1017 +
  1018 +#article .gallery-navigation {
  1019 + padding: 10px 0;
  1020 +}
  1021 +
  1022 +#article .gallery-navigation .previous {
  1023 + margin-right: 10px;
  1024 +}
  1025 +
  1026 +#article .gallery-navigation .next {
  1027 + margin-left: 10px;
  1028 +}
  1029 +
  1030 +#article .gallery-navigation .total-of-images {
  1031 + font-weight: bold;
  1032 +}
  1033 +
  1034 +#article .uploaded-file-description {
  1035 + background: #f6f6f6;
  1036 + border-top: 1px solid #ccc;
  1037 + border-bottom: 1px solid #ccc;
  1038 + padding: 1em;
  1039 +}
  1040 +#article .uploaded-file-description.empty {
  1041 + display: none;
  1042 +}
  1043 +
  1044 +#article.file-generic .download-link {
  1045 + display: block;
  1046 + margin-bottom: 10px;
  1047 +}
  1048 +#article.file-generic .download-link span {
  1049 + font-size: 150%;
  1050 + padding-right: 5px;
  1051 +}
  1052 +#article.file-generic .download-link a {
  1053 + font-size: 180%;
  1054 + text-decoration: none;
  1055 +}
1022 1056  
1023 1057 /**************************** Comments *******************************/
1024 1058  
... ...
public/stylesheets/application.css
... ... @@ -1584,6 +1584,7 @@ a.button.disabled, input.disabled {
1584 1584 .map {
1585 1585 clear: both;
1586 1586 }
  1587 +
1587 1588 /***********************************************************
1588 1589 * style for blocks
1589 1590 ***********************************************************/
... ... @@ -3440,26 +3441,7 @@ div#article-parent {
3440 3441 .article-body-uploaded-file {
3441 3442 text-align: center;
3442 3443 }
3443   -/************* uploaded file *****************/
3444 3444  
3445   -#article .gallery-navigation {
3446   - padding: 10px 0;
3447   -}
3448   -#article .gallery-navigation .left {
3449   - margin-right: 10px;
3450   -}
3451   -#article .gallery-navigation .right {
3452   - margin-left: 10px;
3453   -}
3454   -#article .gallery-navigation .total-of-images {
3455   - font-weight: bold;
3456   -}
3457   -#article .uploaded-file-description {
3458   - background: #f6f6f6;
3459   - border-top: 1px solid #ccc;
3460   - border-bottom: 1px solid #ccc;
3461   - padding: 1em;
3462   -}
3463 3445 /* ==> public/stylesheets/controller_events.css <== */
3464 3446 #agenda {
3465 3447 position: relative;
... ...
test/functional/cms_controller_test.rb
... ... @@ -940,8 +940,8 @@ class CmsControllerTest &lt; ActionController::TestCase
940 940 :article => {:uploaded_data => fixture_file_upload('/files/rails.png', 'image/png')}
941 941  
942 942 process_delayed_job_queue
943   - file = profile.articles.find_by_name('rails.png')
944   - assert File.exists?(file.class.icon_name(file))
  943 + file = FilePresenter.for profile.articles.find_by_name('rails.png')
  944 + assert File.exists?(file.icon_name)
945 945 file.destroy
946 946 end
947 947  
... ... @@ -951,8 +951,8 @@ class CmsControllerTest &lt; ActionController::TestCase
951 951 :article => {:uploaded_data => fixture_file_upload('/files/rails.png', 'image/png')}
952 952  
953 953 process_delayed_job_queue
954   - file = profile.articles.find_by_name('rails.png')
955   - assert File.exists?(file.class.icon_name(file))
  954 + file = FilePresenter.for profile.articles.find_by_name('rails.png')
  955 + assert File.exists?(file.icon_name)
956 956 file.destroy
957 957 end
958 958  
... ...
test/functional/content_viewer_controller_test.rb
... ... @@ -1271,4 +1271,12 @@ class ContentViewerControllerTest &lt; ActionController::TestCase
1271 1271 assert_tag :tag => 'strong', :content => /bold/
1272 1272 end
1273 1273  
  1274 + should 'display link to download of non-recognized file types on its page' do
  1275 + file = UploadedFile.create!(:uploaded_data => fixture_file_upload('/files/test.txt', 'bin/unknown'), :profile => profile)
  1276 + get :view_page, file.url.merge(:view=>:true)
  1277 + assert_tag :tag => 'a',
  1278 + :content => file.filename,
  1279 + :attributes => { :href => file.public_filename }
  1280 + end
  1281 +
1274 1282 end
... ...
test/unit/article_block_test.rb
... ... @@ -110,9 +110,12 @@ class ArticleBlockTest &lt; ActiveSupport::TestCase
110 110 block.article = image
111 111 block.save!
112 112  
113   - expects(:image_tag).with(image.public_filename(:display), :class => image.css_class_name, :style => 'max-width: 100%').returns('image')
114   -
115   - assert_match(/image/, instance_eval(&block.content))
  113 + assert_tag_in_string instance_eval(&block.content),
  114 + :tag => 'img',
  115 + :attributes => {
  116 + :src => image.public_filename(:display),
  117 + :class => /file-image/
  118 + }
116 119 end
117 120  
118 121 should 'not display gallery pages navigation in content' do
... ... @@ -123,8 +126,6 @@ class ArticleBlockTest &lt; ActiveSupport::TestCase
123 126 block.article = image
124 127 block.save!
125 128  
126   - expects(:image_tag).with(image.public_filename(:display), :class => image.css_class_name, :style => 'max-width: 100%').returns('image')
127   -
128 129 assert_no_match(/Previous/, instance_eval(&block.content))
129 130 end
130 131  
... ...
test/unit/blog_helper_test.rb
... ... @@ -94,10 +94,10 @@ class BlogHelperTest &lt; ActiveSupport::TestCase
94 94 should 'display link to file if post is an uploaded_file' do
95 95 file = UploadedFile.create!(:uploaded_data => fixture_file_upload('/files/test.txt', 'text/plain'), :profile => profile, :published => true, :parent => blog)
96 96  
97   - expects(:article_to_html).with(file).returns('TO HTML')
98   -
99 97 result = display_post(file)
100   - assert_tag_in_string result, :content => /TO HTML/
  98 + assert_tag_in_string result, :tag => 'a',
  99 + :attributes => { :href => file.public_filename },
  100 + :content => file.filename
101 101 end
102 102  
103 103 should 'display image if post is an image' do
... ...
test/unit/cms_helper_test.rb
... ... @@ -41,6 +41,7 @@ class CmsHelperTest &lt; ActiveSupport::TestCase
41 41 should 'display image and link if article is an image' do
42 42 profile = fast_create(Profile)
43 43 file = UploadedFile.create!(:profile => profile, :uploaded_data => fixture_file_upload('/files/rails.png', 'image/png'))
  44 + file = FilePresenter.for file
44 45 icon = icon_for_article(file)
45 46 expects(:image_tag).with(icon).returns('icon')
46 47  
... ...
test/unit/file_presenter_test.rb 0 → 100644
... ... @@ -0,0 +1,61 @@
  1 +require File.dirname(__FILE__) + '/../test_helper'
  2 +
  3 +class FilePresenterTest < ActiveSupport::TestCase
  4 +
  5 + should 'notify about deprecated method UploadedFile.icon_name' do
  6 + profile = fast_create(Profile)
  7 + file = UploadedFile.create!(
  8 + :profile => profile,
  9 + :uploaded_data => fixture_file_upload('/files/rails.png', 'image/png')
  10 + )
  11 + assert_raise NoMethodError do
  12 + UploadedFile.icon_name file
  13 + end
  14 + ENV.stubs('[]').with('RAILS_ENV').returns('other')
  15 + Rails.logger.expects(:warn) # must warn on any other RAILS_ENV
  16 + stubs(:puts)
  17 + UploadedFile.icon_name file
  18 + end
  19 +
  20 + should 'notify about deprecated method UploadedFile#to_html' do
  21 + profile = fast_create(Profile)
  22 + file = UploadedFile.create!(
  23 + :profile => profile,
  24 + :uploaded_data => fixture_file_upload('/files/rails.png', 'image/png')
  25 + )
  26 + assert_raise NoMethodError do
  27 + file.to_html
  28 + end
  29 + ENV.stubs('[]').with('RAILS_ENV').returns('other')
  30 + Rails.logger.expects(:warn) # must warn on any other RAILS_ENV
  31 + stubs(:puts)
  32 + file.to_html
  33 + end
  34 +
  35 + should 'return a thumbnail as icon for images ' do
  36 + f = UploadedFile.new
  37 + f.stubs(:image?).returns(true)
  38 + p = FilePresenter.for f
  39 + p.expects(:public_filename).with(:icon).returns('/path/to/file.xyz')
  40 + assert_equal '/path/to/file.xyz', p.icon_name
  41 + end
  42 +
  43 + should 'not crach when accepts? method receives a pure article' do
  44 + assert_nothing_raised do
  45 + FilePresenter.for Article.new
  46 + end
  47 + end
  48 +
  49 + should 'not crach when accepts? method receives a non-sense object' do
  50 + assert_nothing_raised do
  51 + FilePresenter.for nil
  52 + end
  53 + assert_nothing_raised do
  54 + FilePresenter.for({:key => 'value'})
  55 + end
  56 + assert_nothing_raised do
  57 + FilePresenter.for 'a string'
  58 + end
  59 + end
  60 +
  61 +end
... ...
test/unit/folder_helper_test.rb
... ... @@ -26,6 +26,7 @@ class FolderHelperTest &lt; ActiveSupport::TestCase
26 26 should 'display icon for images' do
27 27 profile = fast_create(Profile)
28 28 file = UploadedFile.create!(:uploaded_data => fixture_file_upload('/files/rails.png', 'image/png'), :profile => profile)
  29 + file = FilePresenter.for file
29 30 process_delayed_job_queue
30 31  
31 32 assert_match /rails_icon\.png/, icon_for_article(file.reload)
... ...
test/unit/profile_list_block_test.rb
... ... @@ -2,6 +2,8 @@ require File.dirname(__FILE__) + &#39;/../test_helper&#39;
2 2  
3 3 class ProfileListBlockTest < ActiveSupport::TestCase
4 4  
  5 + include ActionView::Helpers::TagHelper
  6 +
5 7 should 'describe itself' do
6 8 assert_not_equal Block.description, ProfileListBlock.description
7 9 end
... ...
test/unit/uploaded_file_test.rb
... ... @@ -7,13 +7,6 @@ class UploadedFileTest &lt; ActiveSupport::TestCase
7 7 end
8 8 attr_reader :profile
9 9  
10   - should 'return a thumbnail as icon for images ' do
11   - f = UploadedFile.new
12   - f.expects(:image?).returns(true)
13   - f.expects(:public_filename).with(:icon).returns('/path/to/file.xyz')
14   - assert_equal '/path/to/file.xyz', UploadedFile.icon_name(f)
15   - end
16   -
17 10 should 'return a default icon for uploaded files' do
18 11 assert_equal 'upload-file', UploadedFile.icon_name
19 12 end
... ... @@ -113,8 +106,11 @@ class UploadedFileTest &lt; ActiveSupport::TestCase
113 106 p = create_user('test_user').person
114 107 file = UploadedFile.create!(:uploaded_data => fixture_file_upload('/files/test.txt', 'text/plain'), :profile => p)
115 108  
  109 + ENV.stubs('[]').with('RAILS_ENV').returns('other')
  110 + Rails.logger.expects(:warn) # warn about deprecatede usage of UploadedFile#to_html
  111 + stubs(:puts)
116 112 stubs(:content_tag).returns('link')
117   - expects(:link_to).with(file.name, file.url, :class => file.css_class_name)
  113 + expects(:link_to).with(file.name, file.url)
118 114  
119 115 instance_eval(&file.to_html)
120 116 end
... ... @@ -206,13 +202,6 @@ class UploadedFileTest &lt; ActiveSupport::TestCase
206 202 file.destroy
207 203 end
208 204  
209   - should 'return the default thumbnail image as icon for images ' do
210   - f = UploadedFile.new
211   - f.expects(:image?).returns(true)
212   - f.expects(:public_filename).with(:icon).returns('/path/to/file.xyz')
213   - assert_equal '/path/to/file.xyz', UploadedFile.icon_name(f)
214   - end
215   -
216 205 should 'store width and height after processing' do
217 206 file = UploadedFile.create!(:profile => @profile, :uploaded_data => fixture_file_upload('/files/rails.png', 'image/png'))
218 207 file.create_thumbnails
... ... @@ -287,12 +276,6 @@ class UploadedFileTest &lt; ActiveSupport::TestCase
287 276 assert_equal '', f.lead
288 277 end
289 278  
290   - should 'survive when try to get icon_name from a file with mime_type nil' do
291   - f = UploadedFile.new
292   - f.expects(:mime_type).returns(nil)
293   - assert_equal 'upload-file', UploadedFile.icon_name(f)
294   - end
295   -
296 279 should 'upload to a folder with same name as the schema if database is postgresql' do
297 280 uses_postgresql 'image_schema_one'
298 281 file1 = UploadedFile.create!(:uploaded_data => fixture_file_upload('/files/rails.png', 'image/png'), :profile => @profile)
... ...