Commit f4012a36daa7a996193a465f3c846f15be1f5742
Exists in
master
and in
22 other branches
Merge branch 'stable'
Showing
22 changed files
with
220 additions
and
133 deletions
Show diff stats
INSTALL.varnish
| ... | ... | @@ -15,6 +15,10 @@ Noosfero was tested with Varnish 2.x. If you are using a Debian Lenny (and you |
| 15 | 15 | should, unless Debian already released Squeeze by now), make sure you install |
| 16 | 16 | varnish from the lenny-backports suite. |
| 17 | 17 | |
| 18 | +Install the RPAF apache module (or skip this step if not using apache): | |
| 19 | + | |
| 20 | + # apt-get install libapache2-mod-rpaf | |
| 21 | + | |
| 18 | 22 | 3) Enable varnish logging: |
| 19 | 23 | |
| 20 | 24 | 3a) Edit /etc/default/varnishncsa and uncomment the line that contains: | ... | ... |
app/controllers/public/content_viewer_controller.rb
| ... | ... | @@ -19,7 +19,7 @@ class ContentViewerController < ApplicationController |
| 19 | 19 | unless @page |
| 20 | 20 | page_from_old_path = profile.articles.find_by_old_path(path) |
| 21 | 21 | if page_from_old_path |
| 22 | - redirect_to :profile => profile.identifier, :page => page_from_old_path.explode_path | |
| 22 | + redirect_to profile.url.merge(:page => page_from_old_path.explode_path) | |
| 23 | 23 | return |
| 24 | 24 | end |
| 25 | 25 | end | ... | ... |
app/controllers/public/search_controller.rb
| ... | ... | @@ -4,10 +4,17 @@ class SearchController < PublicController |
| 4 | 4 | include SearchHelper |
| 5 | 5 | include ActionView::Helpers::NumberHelper |
| 6 | 6 | |
| 7 | + before_filter :redirect_asset_param, :except => [:facets_browse, :assets] | |
| 7 | 8 | before_filter :load_category |
| 8 | 9 | before_filter :load_search_assets |
| 9 | 10 | before_filter :load_query |
| 10 | 11 | |
| 12 | + # Backwards compatibility with old URLs | |
| 13 | + def redirect_asset_param | |
| 14 | + return unless params.has_key?(:asset) | |
| 15 | + redirect_to params.merge(:action => params.delete(:asset)) | |
| 16 | + end | |
| 17 | + | |
| 11 | 18 | no_design_blocks |
| 12 | 19 | |
| 13 | 20 | def facets_browse |
| ... | ... | @@ -250,10 +257,9 @@ class SearchController < PublicController |
| 250 | 257 | end |
| 251 | 258 | |
| 252 | 259 | def limit |
| 253 | - searching = @searching.values.select{ |v| v } | |
| 254 | - if params[:display] == 'map' | |
| 260 | + if map_search? | |
| 255 | 261 | MAP_SEARCH_LIMIT |
| 256 | - elsif searching.size <= 1 | |
| 262 | + elsif !multiple_search? | |
| 257 | 263 | if [:people, :communities].include? @asset |
| 258 | 264 | BLOCKS_SEARCH_LIMIT |
| 259 | 265 | elsif @asset == :enterprises and @empty_query |
| ... | ... | @@ -267,31 +273,34 @@ class SearchController < PublicController |
| 267 | 273 | end |
| 268 | 274 | |
| 269 | 275 | def paginate_options(page = params[:page]) |
| 276 | + page = 1 if multiple_search? or params[:display] == 'map' | |
| 270 | 277 | { :per_page => limit, :page => page } |
| 271 | 278 | end |
| 272 | 279 | |
| 273 | 280 | def full_text_search(filters = [], options = {}) |
| 274 | 281 | paginate_options = paginate_options(params[:page]) |
| 275 | 282 | asset_class = asset_class(@asset) |
| 276 | - | |
| 277 | 283 | solr_options = options |
| 278 | - if !@results_only and asset_class.respond_to? :facets | |
| 279 | - solr_options.merge! asset_class.facets_find_options(params[:facet]) | |
| 280 | - solr_options[:all_facets] = true | |
| 281 | - solr_options[:limit] = 0 if @facets_only | |
| 282 | - end | |
| 283 | - solr_options[:filter_queries] ||= [] | |
| 284 | - solr_options[:filter_queries] += filters | |
| 285 | - solr_options[:filter_queries] << "environment_id:#{environment.id}" | |
| 286 | - solr_options[:filter_queries] << asset_class.facet_category_query.call(@category) if @category | |
| 287 | - | |
| 288 | - solr_options[:boost_functions] ||= [] | |
| 289 | - params[:order_by] = nil if params[:order_by] == 'none' | |
| 290 | - if params[:order_by] | |
| 291 | - order = SortOptions[@asset][params[:order_by].to_sym] | |
| 292 | - raise "Unknown order by" if order.nil? | |
| 293 | - order[:solr_opts].each do |opt, value| | |
| 294 | - solr_options[opt] = value.is_a?(Proc) ? instance_eval(&value) : value | |
| 284 | + pg_options = paginate_options(params[:page]) | |
| 285 | + | |
| 286 | + if !multiple_search? | |
| 287 | + if !@results_only and asset_class.respond_to? :facets | |
| 288 | + solr_options.merge! asset_class.facets_find_options(params[:facet]) | |
| 289 | + solr_options[:all_facets] = true | |
| 290 | + end | |
| 291 | + solr_options[:filter_queries] ||= [] | |
| 292 | + solr_options[:filter_queries] += filters | |
| 293 | + solr_options[:filter_queries] << "environment_id:#{environment.id}" | |
| 294 | + solr_options[:filter_queries] << asset_class.facet_category_query.call(@category) if @category | |
| 295 | + | |
| 296 | + solr_options[:boost_functions] ||= [] | |
| 297 | + params[:order_by] = nil if params[:order_by] == 'none' | |
| 298 | + if params[:order_by] | |
| 299 | + order = SortOptions[@asset][params[:order_by].to_sym] | |
| 300 | + raise "Unknown order by" if order.nil? | |
| 301 | + order[:solr_opts].each do |opt, value| | |
| 302 | + solr_options[opt] = value.is_a?(Proc) ? instance_eval(&value) : value | |
| 303 | + end | |
| 295 | 304 | end |
| 296 | 305 | end |
| 297 | 306 | ... | ... |
app/helpers/search_helper.rb
| ... | ... | @@ -45,6 +45,14 @@ module SearchHelper |
| 45 | 45 | # FIXME remove it after search_controler refactored |
| 46 | 46 | include EventsHelper |
| 47 | 47 | |
| 48 | + def multiple_search? | |
| 49 | + ['index', 'category_index'].include?(params[:action]) or @results.size > 1 | |
| 50 | + end | |
| 51 | + | |
| 52 | + def map_search? | |
| 53 | + !@query.blank? and !multiple_search? and params[:display] == 'map' | |
| 54 | + end | |
| 55 | + | |
| 48 | 56 | def search_page_title(title, category = nil) |
| 49 | 57 | title = "<h1>" + title |
| 50 | 58 | title += '<small>' + category.name + '</small>' if category |
| ... | ... | @@ -58,8 +66,8 @@ module SearchHelper |
| 58 | 66 | :align => 'center', :class => 'search-category-context') if category |
| 59 | 67 | end |
| 60 | 68 | |
| 61 | - def display_results(use_map = false) | |
| 62 | - if params[:display] == 'map' && use_map | |
| 69 | + def display_results(map_capable = false) | |
| 70 | + if map_capable and map_search? | |
| 63 | 71 | partial = 'google_maps' |
| 64 | 72 | klass = 'map' |
| 65 | 73 | else | ... | ... |
app/models/community.rb
| ... | ... | @@ -88,7 +88,7 @@ class Community < Organization |
| 88 | 88 | end |
| 89 | 89 | |
| 90 | 90 | def activities |
| 91 | - Scrap.find_by_sql("SELECT id, updated_at, '#{Scrap.to_s}' AS klass FROM #{Scrap.table_name} WHERE scraps.receiver_id = #{self.id} AND scraps.scrap_id IS NULL UNION SELECT id, updated_at, '#{ActionTracker::Record.to_s}' AS klass FROM #{ActionTracker::Record.table_name} WHERE action_tracker.target_id = #{self.id} UNION SELECT at.id, at.updated_at, '#{ActionTracker::Record.to_s}' AS klass FROM #{ActionTracker::Record.table_name} at INNER JOIN articles a ON at.target_id = a.id WHERE a.profile_id = #{self.id} AND at.target_type = 'Article' ORDER BY updated_at DESC") | |
| 91 | + Scrap.find_by_sql("SELECT id, updated_at, '#{Scrap.to_s}' AS klass FROM #{Scrap.table_name} WHERE scraps.receiver_id = #{self.id} AND scraps.scrap_id IS NULL UNION SELECT id, updated_at, '#{ActionTracker::Record.to_s}' AS klass FROM #{ActionTracker::Record.table_name} WHERE action_tracker.target_id = #{self.id} and action_tracker.verb != 'join_community' and action_tracker.verb != 'leave_scrap' UNION SELECT at.id, at.updated_at, '#{ActionTracker::Record.to_s}' AS klass FROM #{ActionTracker::Record.table_name} at INNER JOIN articles a ON at.target_id = a.id WHERE a.profile_id = #{self.id} AND at.target_type = 'Article' ORDER BY updated_at DESC") | |
| 92 | 92 | end |
| 93 | 93 | |
| 94 | 94 | end | ... | ... |
app/models/person.rb
| ... | ... | @@ -458,7 +458,7 @@ class Person < Profile |
| 458 | 458 | end |
| 459 | 459 | |
| 460 | 460 | def activities |
| 461 | - Scrap.find_by_sql("SELECT id, updated_at, '#{Scrap.to_s}' AS klass FROM #{Scrap.table_name} WHERE scraps.receiver_id = #{self.id} AND scraps.scrap_id IS NULL UNION SELECT id, updated_at, '#{ActionTracker::Record.to_s}' AS klass FROM #{ActionTracker::Record.table_name} WHERE action_tracker.user_id = #{self.id} ORDER BY updated_at DESC") | |
| 461 | + Scrap.find_by_sql("SELECT id, updated_at, '#{Scrap.to_s}' AS klass FROM #{Scrap.table_name} WHERE scraps.receiver_id = #{self.id} AND scraps.scrap_id IS NULL UNION SELECT id, updated_at, '#{ActionTracker::Record.to_s}' AS klass FROM #{ActionTracker::Record.table_name} WHERE action_tracker.user_id = #{self.id} and action_tracker.verb != 'leave_scrap_to_self' and action_tracker.verb != 'add_member_in_community' ORDER BY updated_at DESC") | |
| 462 | 462 | end |
| 463 | 463 | |
| 464 | 464 | protected | ... | ... |
app/views/search/_display_results.rhtml
| 1 | -<div id="search-results" class="<%= @results.size == 1 ? 'only-one-result-box' : 'multiple-results-boxes' %>"> | |
| 1 | +<div id="search-results" class="<%= !multiple_search? ? 'only-one-result-box' : 'multiple-results-boxes' %>"> | |
| 2 | 2 | <% @order.each do |name| %> |
| 3 | 3 | <% results = @results[name] %> |
| 4 | 4 | <% empty = results.nil? || results.empty? %> |
| ... | ... | @@ -7,7 +7,7 @@ |
| 7 | 7 | <% if not empty %> |
| 8 | 8 | <% partial = partial_for_class(results.first.class.class_name.constantize) %> |
| 9 | 9 | |
| 10 | - <% if @results.size > 1 %> | |
| 10 | + <% if multiple_search? %> | |
| 11 | 11 | <h3><%= @names[name] %></h3> |
| 12 | 12 | <% if results.total_entries > SearchController::MULTIPLE_SEARCH_LIMIT %> |
| 13 | 13 | <%= link_to(_('see all (%d)') % results.total_entries, params.merge(:action => name), :class => 'see-more' ) %> |
| ... | ... | @@ -22,9 +22,10 @@ |
| 22 | 22 | </ul> |
| 23 | 23 | </div> |
| 24 | 24 | <% else %> |
| 25 | - <% if @results.size > 1 %> | |
| 25 | + <% if multiple_search? %> | |
| 26 | 26 | <h3><%= @names[name] %></h3> |
| 27 | 27 | <% end %> |
| 28 | + | |
| 28 | 29 | <div class="search-results-innerbox search-results-type-empty"> |
| 29 | 30 | <div> <%= _('None') %> </div> |
| 30 | 31 | </div> | ... | ... |
app/views/search/_profile.rhtml
| 1 | 1 | <li class="search-profile-item"> |
| 2 | -<% if @empty_query or @results.size > 1 or !profile.enterprise? %> | |
| 2 | +<% if @empty_query or multiple_search? or !profile.enterprise? %> | |
| 3 | 3 | <%= profile_image_link profile, :portrait, 'div', |
| 4 | 4 | @filter == 'more_recent' ? profile.send(@filter + '_label') + show_date(profile.created_at) : profile.send(@filter + '_label') %> |
| 5 | 5 | <% else %> | ... | ... |
app/views/tasks/processed.rhtml
config/initializers/action_tracker.rb
| ... | ... | @@ -23,7 +23,28 @@ ActionTrackerConfig.verbs = { |
| 23 | 23 | }, |
| 24 | 24 | |
| 25 | 25 | :upload_image => { |
| 26 | - :description => lambda { n_('uploaded 1 image<br />%{thumbnails}<br style="clear: both;" />', 'uploaded %{num} images<br />%{thumbnails}<br style="clear: both;" />', get_view_url.size) % { :num => get_view_url.size, :thumbnails => '{{ta.collect_group_with_index(:thumbnail_path){ |t,i| content_tag(:span, link_to(image_tag(t), ta.get_view_url[i]))}.last(3).join}}' } }, | |
| 26 | + :description => lambda do | |
| 27 | + total = get_view_url.size | |
| 28 | + n_('uploaded 1 image', 'uploaded %d images', total) % total + | |
| 29 | + '<br />{{'+ | |
| 30 | + 'ta.collect_group_with_index(:thumbnail_path) { |t,i|' + | |
| 31 | + " if ( #{total} == 1 );" + | |
| 32 | + ' link_to( image_tag(t), ta.get_view_url[i], :class => \'upimg\' );' + | |
| 33 | + ' else;' + | |
| 34 | + " pos = #{total}-i;" + | |
| 35 | + ' morethen2 = pos>2 ? \'morethen2\' : \'\';' + | |
| 36 | + ' morethen5 = pos>5 ? \'morethen5\' : \'\';' + | |
| 37 | + ' t = t.gsub(/(.*)(display)(.*)/, \'\\1thumb\\3\');' + | |
| 38 | + ' link_to( \' \', ta.get_view_url[i],' + | |
| 39 | + ' :style => "background-image:url(#{t})",' + | |
| 40 | + ' :class => "upimg pos#{pos} #{morethen2} #{morethen5}" );' + | |
| 41 | + ' end' + | |
| 42 | + '}.reverse.join}}' + | |
| 43 | + ( total > 5 ? | |
| 44 | + '<span class="more" onclick="this.parentNode.className+=\' show-all\'">' + | |
| 45 | + '…</span>' : '' ) + | |
| 46 | + '<br style="clear: both;" />' | |
| 47 | + end, | |
| 27 | 48 | :type => :groupable |
| 28 | 49 | }, |
| 29 | 50 | ... | ... |
debian/changelog
debian/control
| ... | ... | @@ -62,8 +62,7 @@ Description: free web-based platform for social networks |
| 62 | 62 | |
| 63 | 63 | Package: noosfero-apache |
| 64 | 64 | Architecture: all |
| 65 | -Depends: apache2, debconf | |
| 66 | -Suggests: noosfero | |
| 65 | +Depends: apache2, debconf, noosfero | |
| 67 | 66 | Description: free web-based platform for social networks (apache frontend) |
| 68 | 67 | Noosfero is a web platform for social and solidarity economy networks with |
| 69 | 68 | blog, e-Porfolios, CMS, RSS, thematic discussion, events agenda and collective | ... | ... |
etc/noosfero/varnish-noosfero.vcl
| 1 | 1 | sub vcl_recv { |
| 2 | + if (req.request == "GET" || req.request == "HEAD") { | |
| 2 | 3 | if (req.http.Cookie) { |
| 3 | - # We only care about the "_noosfero_session.*" cookie, used for | |
| 4 | - # authentication. | |
| 5 | - if (req.http.Cookie ~ "_noosfero_session.*" ) { | |
| 6 | - return (pass); | |
| 7 | - } | |
| 8 | - # Else strip all cookies | |
| 4 | + # We only care about the "_noosfero_session.*" cookie, used for | |
| 5 | + # authentication. | |
| 6 | + if (req.http.Cookie !~ "_noosfero_session.*" ) { | |
| 7 | + # strip all cookies | |
| 9 | 8 | unset req.http.Cookie; |
| 9 | + } | |
| 10 | 10 | } |
| 11 | + } | |
| 11 | 12 | } |
| 12 | 13 | |
| 13 | 14 | sub vcl_error { | ... | ... |
lib/noosfero.rb
public/designs/templates/leftbar/stylesheets/style.css
| ... | ... | @@ -45,26 +45,25 @@ |
| 45 | 45 | width: 489px; |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | -#profile-wall li.profile-activity-item.upload_image span, | |
| 49 | -#profile-wall li.profile-activity-item.upload_image span img, | |
| 50 | -#profile-wall li.profile-activity-item.upload_image span a, | |
| 51 | -#profile-network li.profile-activity-item.upload_image span, | |
| 52 | -#profile-network li.profile-activity-item.upload_image span img, | |
| 53 | -#profile-network li.profile-activity-item.upload_image span a { | |
| 54 | - width: 178px; | |
| 55 | - height: 144px; | |
| 48 | +li.profile-activity-item.upload_image .upimg { | |
| 49 | + width: 168px; | |
| 50 | + height: 168px; | |
| 56 | 51 | } |
| 57 | - | |
| 58 | -#profile-wall li.profile-activity-item.upload_image .activity-gallery-images-count-1 span, | |
| 59 | -#profile-wall li.profile-activity-item.upload_image .activity-gallery-images-count-1 span a img, | |
| 60 | -#profile-wall li.profile-activity-item.upload_image .activity-gallery-images-count-1 span a, | |
| 61 | -#profile-network li.profile-activity-item.upload_image .activity-gallery-images-count-1 span, | |
| 62 | -#profile-network li.profile-activity-item.upload_image .activity-gallery-images-count-1 span a img, | |
| 63 | -#profile-network li.profile-activity-item.upload_image .activity-gallery-images-count-1 span a { | |
| 64 | - max-width: 540px; | |
| 52 | +li.profile-activity-item.upload_image .more, | |
| 53 | +li.profile-activity-item.upload_image .upimg.morethen2 { | |
| 54 | + font-size: 46px; | |
| 55 | + width: 77px; | |
| 56 | + height: 77px; | |
| 57 | +} | |
| 58 | +li.profile-activity-item.upload_image .activity-gallery-images-count-3 .pos3 { | |
| 59 | + /* reduce size only for 4 or more itens */ | |
| 60 | + width: 168px; | |
| 61 | + height: 168px; | |
| 65 | 62 | } |
| 66 | 63 | |
| 67 | -#profile-wall li.profile-activity-item.upload_image .activity-gallery-images-count-1 span a, | |
| 68 | -#profile-network li.profile-activity-item.upload_image .activity-gallery-images-count-1 span a { | |
| 69 | - background-image: url(/images/gallery-image-activity-border-big-onecol.png); | |
| 64 | +li.profile-activity-item.upload_image .activity-gallery-images-count-4 .pos3 { | |
| 65 | + /* make a line-break on this case */ | |
| 66 | + float: none; | |
| 67 | + margin-left: 364px; | |
| 70 | 68 | } |
| 69 | + | ... | ... |
public/designs/templates/rightbar/stylesheets/style.css
| ... | ... | @@ -45,21 +45,25 @@ |
| 45 | 45 | width: 489px; |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | -#profile-wall li.profile-activity-item.upload_image span, | |
| 49 | -#profile-wall li.profile-activity-item.upload_image span img, | |
| 50 | -#profile-wall li.profile-activity-item.upload_image span a, | |
| 51 | -#profile-network li.profile-activity-item.upload_image span, | |
| 52 | -#profile-network li.profile-activity-item.upload_image span img, | |
| 53 | -#profile-network li.profile-activity-item.upload_image span a { | |
| 54 | - width: 178px; | |
| 55 | - height: 144px; | |
| 48 | +li.profile-activity-item.upload_image .upimg { | |
| 49 | + width: 168px; | |
| 50 | + height: 168px; | |
| 51 | +} | |
| 52 | +li.profile-activity-item.upload_image .more, | |
| 53 | +li.profile-activity-item.upload_image .upimg.morethen2 { | |
| 54 | + font-size: 46px; | |
| 55 | + width: 77px; | |
| 56 | + height: 77px; | |
| 57 | +} | |
| 58 | +li.profile-activity-item.upload_image .activity-gallery-images-count-3 .pos3 { | |
| 59 | + /* reduce size only for 4 or more itens */ | |
| 60 | + width: 168px; | |
| 61 | + height: 168px; | |
| 56 | 62 | } |
| 57 | 63 | |
| 58 | -#profile-wall li.profile-activity-item.upload_image .activity-gallery-images-count-1 span, | |
| 59 | -#profile-wall li.profile-activity-item.upload_image .activity-gallery-images-count-1 span a img, | |
| 60 | -#profile-wall li.profile-activity-item.upload_image .activity-gallery-images-count-1 span a, | |
| 61 | -#profile-network li.profile-activity-item.upload_image .activity-gallery-images-count-1 span, | |
| 62 | -#profile-network li.profile-activity-item.upload_image .activity-gallery-images-count-1 span a img, | |
| 63 | -#profile-network li.profile-activity-item.upload_image .activity-gallery-images-count-1 span a { | |
| 64 | - max-width: 540px; | |
| 64 | +li.profile-activity-item.upload_image .activity-gallery-images-count-4 .pos3 { | |
| 65 | + /* make a line-break on this case */ | |
| 66 | + float: none; | |
| 67 | + margin-left: 364px; | |
| 65 | 68 | } |
| 69 | + | ... | ... |
public/stylesheets/application.css
| ... | ... | @@ -4733,16 +4733,13 @@ h1#agenda-title { |
| 4733 | 4733 | } |
| 4734 | 4734 | #profile-activity li, #profile-network li, #profile-wall li { |
| 4735 | 4735 | display: block; |
| 4736 | - padding: 3px; | |
| 4736 | + padding: 3px 0px; | |
| 4737 | 4737 | margin-bottom: 3px; |
| 4738 | 4738 | background-color: #fff; |
| 4739 | 4739 | border-bottom: 1px solid #e8e8e8; |
| 4740 | 4740 | position: relative; |
| 4741 | 4741 | } |
| 4742 | 4742 | |
| 4743 | -#profile-activity li, #profile-network li, #profile-wall li { | |
| 4744 | -} | |
| 4745 | - | |
| 4746 | 4743 | .profile-activity-lead img { |
| 4747 | 4744 | width: 124px; |
| 4748 | 4745 | float: left; |
| ... | ... | @@ -4806,75 +4803,79 @@ h1#agenda-title { |
| 4806 | 4803 | color: #000; |
| 4807 | 4804 | } |
| 4808 | 4805 | |
| 4809 | -#profile-wall li.profile-activity-item.upload_image span, | |
| 4810 | -#profile-wall li.profile-activity-item.upload_image span a, | |
| 4811 | -#profile-network li.profile-activity-item.upload_image span, | |
| 4812 | -#profile-network li.profile-activity-item.upload_image span a { | |
| 4813 | - width: 110px; | |
| 4814 | - height: 100px; | |
| 4806 | +li.profile-activity-item.upload_image .more, | |
| 4807 | +li.profile-activity-item.upload_image .upimg { | |
| 4815 | 4808 | display: block; |
| 4816 | - overflow: hidden; | |
| 4817 | - position: absolute; | |
| 4809 | + float: left; | |
| 4810 | + width: 114px; | |
| 4811 | + height: 114px; | |
| 4812 | + background-size: cover; | |
| 4813 | + -o-background-size: cover; | |
| 4814 | + -moz-background-size: cover; | |
| 4815 | + -webkit-background-size: cover; | |
| 4816 | + background-position: 50% 50%; | |
| 4817 | + border: 4px solid #D2D2D2; | |
| 4818 | + border-radius: 4px; | |
| 4819 | + -moz-border-radius: 4px; | |
| 4820 | + -webkit-border-radius: 4px; | |
| 4821 | + margin: 3px 6px 3px 0px; | |
| 4818 | 4822 | } |
| 4819 | 4823 | |
| 4820 | -#profile-wall li.profile-activity-item.upload_image span a img, | |
| 4821 | -#profile-network li.profile-activity-item.upload_image span a img { | |
| 4822 | - width: 110px; | |
| 4823 | - height: 100px; | |
| 4824 | +#wrap-1 li.profile-activity-item.upload_image .upimg:hover { | |
| 4825 | + text-decoration: none; | |
| 4824 | 4826 | } |
| 4825 | 4827 | |
| 4826 | -#profile-wall li.profile-activity-item.upload_image .activity-gallery-images-count-1 span, | |
| 4827 | -#profile-wall li.profile-activity-item.upload_image .activity-gallery-images-count-1 span a, | |
| 4828 | -#profile-wall li.profile-activity-item.upload_image .activity-gallery-images-count-1 span a img, | |
| 4829 | -#profile-network li.profile-activity-item.upload_image .activity-gallery-images-count-1 span, | |
| 4830 | -#profile-network li.profile-activity-item.upload_image .activity-gallery-images-count-1 span a, | |
| 4831 | -#profile-network li.profile-activity-item.upload_image .activity-gallery-images-count-1 span a img { | |
| 4832 | - width: auto; | |
| 4833 | - max-width: 383px; | |
| 4834 | - height: auto; | |
| 4828 | +li.profile-activity-item.upload_image .more, | |
| 4829 | +li.profile-activity-item.upload_image .upimg.morethen2 { | |
| 4830 | + width: 50px; | |
| 4831 | + height: 50px; | |
| 4832 | +} | |
| 4833 | +li.profile-activity-item.upload_image .activity-gallery-images-count-3 .pos3 { | |
| 4834 | + /* reduce size only for 4 or more itens */ | |
| 4835 | + width: 114px; | |
| 4836 | + height: 114px; | |
| 4835 | 4837 | } |
| 4836 | 4838 | |
| 4837 | -#profile-wall li.profile-activity-item.upload_image span img, | |
| 4838 | -#profile-network li.profile-activity-item.upload_image span img { | |
| 4839 | - display: block; | |
| 4839 | +li.profile-activity-item.upload_image .activity-gallery-images-count-4 .pos3 { | |
| 4840 | + /* make a line-break on this case */ | |
| 4841 | + float: none; | |
| 4842 | + margin-left: 256px; | |
| 4840 | 4843 | } |
| 4841 | 4844 | |
| 4842 | -#profile-wall li.profile-activity-item.upload_image span, | |
| 4843 | -#profile-network li.profile-activity-item.upload_image span { | |
| 4844 | - position: relative; | |
| 4845 | - display: inline-block; | |
| 4846 | - margin: 5px 0px 0px 5px; | |
| 4845 | +li.profile-activity-item.upload_image .more { | |
| 4846 | + text-align: center; | |
| 4847 | + font-weight: bold; | |
| 4848 | + font-size: 28px; | |
| 4849 | + color: #DDD; | |
| 4850 | + background: #888; | |
| 4851 | + cursor: pointer; | |
| 4852 | +} | |
| 4853 | +li.profile-activity-item.upload_image .more:hover { | |
| 4854 | + color: #EEE; | |
| 4855 | + background: #999; | |
| 4847 | 4856 | } |
| 4848 | 4857 | |
| 4849 | -#profile-wall li.profile-activity-item.upload_image .profile-activity-text span, | |
| 4850 | -#profile-network li.profile-activity-item.upload_image .profile-activity-text span { | |
| 4851 | - border: 4px solid #D2D2D2; | |
| 4852 | - border-radius: 4px; | |
| 4853 | - -webkit-border-radius: 4px; | |
| 4854 | - -moz-border-radius: 4px; | |
| 4858 | +li.profile-activity-item.upload_image .morethen5 { | |
| 4859 | + display: none; | |
| 4855 | 4860 | } |
| 4856 | 4861 | |
| 4857 | -#profile-wall li.profile-activity-item.upload_image span a, | |
| 4858 | -#profile-network li.profile-activity-item.upload_image span a { | |
| 4859 | - text-indent: -5000em; | |
| 4862 | +li.profile-activity-item.upload_image .show-all .morethen5 { | |
| 4863 | + display: block; | |
| 4860 | 4864 | } |
| 4861 | 4865 | |
| 4862 | -#profile-wall li.profile-activity-item.upload_image .activity-gallery-images-count-1 span a, | |
| 4863 | -#profile-network li.profile-activity-item.upload_image .activity-gallery-images-count-1 span a { | |
| 4864 | - position: relative; | |
| 4866 | +li.profile-activity-item.upload_image .show-all .more { | |
| 4867 | + display: none; | |
| 4865 | 4868 | } |
| 4866 | 4869 | |
| 4867 | -#profile-wall li.profile-activity-item.upload_image .article-comment span, | |
| 4868 | -#profile-wall li.profile-activity-item.upload_image .profile-wall-actions span, | |
| 4869 | -#profile-network li.profile-activity-item.upload_image .article-comment span, | |
| 4870 | -#profile-network li.profile-activity-item.upload_image .profile-wall-actions span { | |
| 4871 | - display: inline; | |
| 4872 | - position: static; | |
| 4873 | - margin: 0; | |
| 4870 | +li.profile-activity-item.upload_image .activity-gallery-images-count-1 .upimg, | |
| 4871 | +li.profile-activity-item.upload_image .activity-gallery-images-count-1 img { | |
| 4872 | + /* Only ".activity-gallery-images-count-1" has a "img" inside */ | |
| 4874 | 4873 | float: none; |
| 4874 | + display: inline-block; | |
| 4875 | 4875 | width: auto; |
| 4876 | + max-width: 100%; | |
| 4876 | 4877 | height: auto; |
| 4877 | - font-weight: normal; | |
| 4878 | + max-height: 300px; | |
| 4878 | 4879 | } |
| 4879 | 4880 | |
| 4880 | 4881 | #profile-wall li.profile-activity-item ul.profile-wall-activities-comments, | ... | ... |
test/functional/content_viewer_controller_test.rb
| ... | ... | @@ -474,7 +474,7 @@ class ContentViewerControllerTest < ActionController::TestCase |
| 474 | 474 | get :view_page, :profile => p.identifier, :page => old_path |
| 475 | 475 | |
| 476 | 476 | assert_response :redirect |
| 477 | - assert_redirected_to :profile => p.identifier, :page => a.explode_path | |
| 477 | + assert_redirected_to :host => p.default_hostname, :controller => 'content_viewer', :action => 'view_page', :profile => p.identifier, :page => a.explode_path | |
| 478 | 478 | end |
| 479 | 479 | |
| 480 | 480 | should 'load new article name equal of another article old name' do |
| ... | ... | @@ -503,7 +503,7 @@ class ContentViewerControllerTest < ActionController::TestCase |
| 503 | 503 | get :view_page, :profile => p.identifier, :page => old_path |
| 504 | 504 | |
| 505 | 505 | assert_response :redirect |
| 506 | - assert_redirected_to :profile => p.identifier, :page => a2.explode_path | |
| 506 | + assert_redirected_to :host => p.default_hostname, :controller => 'content_viewer', :action => 'view_page', :profile => p.identifier, :page => a2.explode_path | |
| 507 | 507 | end |
| 508 | 508 | |
| 509 | 509 | should 'not return an article of a different user' do | ... | ... |
test/functional/profile_controller_test.rb
| ... | ... | @@ -1139,8 +1139,10 @@ class ProfileControllerTest < ActionController::TestCase |
| 1139 | 1139 | |
| 1140 | 1140 | should "view more activities paginated" do |
| 1141 | 1141 | login_as(profile.identifier) |
| 1142 | - 40.times{ fast_create(ActionTracker::Record, :user_id => profile.id)} | |
| 1142 | + article = TinyMceArticle.create!(:profile => profile, :name => 'An Article about Free Software') | |
| 1143 | + 40.times{ ActionTracker::Record.create!(:user_id => profile.id, :user_type => 'Profile', :verb => 'create_article', :target_id => article.id, :target_type => 'Article', :params => {'name' => article.name, 'url' => article.url, 'lead' => article.lead, 'first_image' => article.first_image})} | |
| 1143 | 1144 | assert_equal 40, profile.tracked_actions.count |
| 1145 | + assert_equal 40, profile.activities.count | |
| 1144 | 1146 | get :view_more_activities, :profile => profile.identifier, :page => 2 |
| 1145 | 1147 | assert_response :success |
| 1146 | 1148 | assert_template '_profile_activities_list' | ... | ... |
test/unit/community_test.rb
| ... | ... | @@ -351,7 +351,7 @@ class CommunityTest < ActiveSupport::TestCase |
| 351 | 351 | scrap = Scrap.create!(defaults_for_scrap(:sender => person, :receiver => community, :content => 'A scrap')) |
| 352 | 352 | activity = ActionTracker::Record.last |
| 353 | 353 | |
| 354 | - assert_equal [activity,scrap], community.activities.map { |a| a.klass.constantize.find(a.id) } | |
| 354 | + assert_equal [scrap], community.activities.map { |a| a.klass.constantize.find(a.id) } | |
| 355 | 355 | end |
| 356 | 356 | |
| 357 | 357 | should 'return tracked_actions of community as activities' do | ... | ... |
test/unit/search_helper_test.rb
| ... | ... | @@ -4,6 +4,28 @@ class SearchHelperTest < ActiveSupport::TestCase |
| 4 | 4 | |
| 5 | 5 | include SearchHelper |
| 6 | 6 | |
| 7 | + should 'return whether on a multiple search' do | |
| 8 | + stubs(:params).returns({:action => 'index', :display => 'map'}) | |
| 9 | + @results = {:articles => [1,2], :products => [1,2]} | |
| 10 | + assert multiple_search? | |
| 11 | + | |
| 12 | + stubs(:params).returns({:action => 'products', :display => 'map'}) | |
| 13 | + @results = {:products => [1,2]} | |
| 14 | + assert !multiple_search? | |
| 15 | + end | |
| 16 | + | |
| 17 | + should 'return whether on a map search' do | |
| 18 | + stubs(:params).returns({:action => 'index', :display => 'map'}) | |
| 19 | + @results = {:articles => [1,2], :products => [1,2]} | |
| 20 | + @query = '' | |
| 21 | + assert !map_search? | |
| 22 | + | |
| 23 | + stubs(:params).returns({:action => 'products', :display => 'map'}) | |
| 24 | + @results = {:products => [1,2]} | |
| 25 | + @query = 'test' | |
| 26 | + assert map_search? | |
| 27 | + end | |
| 28 | + | |
| 7 | 29 | should 'display search page title' do |
| 8 | 30 | title = 'page_title' |
| 9 | 31 | assert_equal search_page_title(title), '<h1>page_title</h1>' |
| ... | ... | @@ -35,6 +57,8 @@ class SearchHelperTest < ActiveSupport::TestCase |
| 35 | 57 | |
| 36 | 58 | should 'display results with map' do |
| 37 | 59 | stubs(:params).returns({:display => 'map'}) |
| 60 | + @query = 'test' | |
| 61 | + @results = {:products => [1,2]} | |
| 38 | 62 | expects('render').with({:partial => 'google_maps'}).returns('render_return') |
| 39 | 63 | expects('content_tag').with('div', 'render_return', :class => 'map-or-list-search-results map') |
| 40 | 64 | display_results true |
| ... | ... | @@ -231,7 +255,6 @@ class SearchHelperTest < ActiveSupport::TestCase |
| 231 | 255 | end |
| 232 | 256 | end |
| 233 | 257 | |
| 234 | - | |
| 235 | 258 | should 'return asset class from string' do |
| 236 | 259 | asset_names = ['products', 'events', 'articles', 'enterprises', 'people', 'communities'] |
| 237 | 260 | asset_classes = [Product, Event, Article, Enterprise, Person, Community] | ... | ... |