Commit 1ceb891ec1bce9d1035c5a8eb8a8a6a6e98acbf2
Exists in
master
and in
23 other branches
Merge branch 'stable'
Showing
9 changed files
with
26 additions
and
16 deletions
Show diff stats
app/controllers/public/home_controller.rb
| @@ -4,7 +4,7 @@ class HomeController < PublicController | @@ -4,7 +4,7 @@ class HomeController < PublicController | ||
| 4 | @has_news = false | 4 | @has_news = false |
| 5 | if environment.enabled?('use_portal_community') && environment.portal_community | 5 | if environment.enabled?('use_portal_community') && environment.portal_community |
| 6 | @has_news = true | 6 | @has_news = true |
| 7 | - @news_cache_key = environment.portal_news_cache_key | 7 | + @news_cache_key = environment.portal_news_cache_key(FastGettext.locale) |
| 8 | if !read_fragment(@news_cache_key) | 8 | if !read_fragment(@news_cache_key) |
| 9 | portal_community = environment.portal_community | 9 | portal_community = environment.portal_community |
| 10 | @highlighted_news = portal_community.news(2, true) | 10 | @highlighted_news = portal_community.news(2, true) |
app/models/environment.rb
| @@ -696,8 +696,8 @@ class Environment < ActiveRecord::Base | @@ -696,8 +696,8 @@ class Environment < ActiveRecord::Base | ||
| 696 | settings[:portal_folders] = folders ? folders.map(&:id) : nil | 696 | settings[:portal_folders] = folders ? folders.map(&:id) : nil |
| 697 | end | 697 | end |
| 698 | 698 | ||
| 699 | - def portal_news_cache_key | ||
| 700 | - "home-page-news/#{cache_key}" | 699 | + def portal_news_cache_key(language='en') |
| 700 | + "home-page-news/#{cache_key}-#{language}" | ||
| 701 | end | 701 | end |
| 702 | 702 | ||
| 703 | def notification_emails | 703 | def notification_emails |
app/models/recent_documents_block.rb
app/sweepers/article_sweeper.rb
| @@ -20,7 +20,9 @@ protected | @@ -20,7 +20,9 @@ protected | ||
| 20 | BlockSweeper.expire_blocks(blocks) | 20 | BlockSweeper.expire_blocks(blocks) |
| 21 | env = article.profile.environment | 21 | env = article.profile.environment |
| 22 | if env && (env.portal_community == article.profile) | 22 | if env && (env.portal_community == article.profile) |
| 23 | - expire_fragment(env.portal_news_cache_key) | 23 | + Noosfero.locales.keys.each do |locale| |
| 24 | + expire_fragment(env.portal_news_cache_key(locale)) | ||
| 25 | + end | ||
| 24 | end | 26 | end |
| 25 | end | 27 | end |
| 26 | 28 |
app/sweepers/block_sweeper.rb
| @@ -5,15 +5,14 @@ class BlockSweeper < ActiveRecord::Observer | @@ -5,15 +5,14 @@ class BlockSweeper < ActiveRecord::Observer | ||
| 5 | class << self | 5 | class << self |
| 6 | include SweeperHelper | 6 | include SweeperHelper |
| 7 | 7 | ||
| 8 | - def cache_key_regex(block) | 8 | + # Expire block's all languages cache |
| 9 | + def expire_block(block) | ||
| 9 | regex = '-[a-z]*$' | 10 | regex = '-[a-z]*$' |
| 10 | clean_ck = block.cache_key.gsub(/#{regex}/,'') | 11 | clean_ck = block.cache_key.gsub(/#{regex}/,'') |
| 11 | - %r{#{clean_ck+regex}} | ||
| 12 | - end | ||
| 13 | 12 | ||
| 14 | - # Expire block's all languages cache | ||
| 15 | - def expire_block(block) | ||
| 16 | - expire_timeout_fragment(cache_key_regex(block)) | 13 | + Noosfero.locales.keys.each do |locale| |
| 14 | + expire_timeout_fragment("#{clean_ck}-#{locale}") | ||
| 15 | + end | ||
| 17 | end | 16 | end |
| 18 | 17 | ||
| 19 | def expire_blocks(blocks) | 18 | def expire_blocks(blocks) |
db/migrate/20120307200651_add_ip_address_to_comment.rb
| @@ -6,6 +6,6 @@ class AddIpAddressToComment < ActiveRecord::Migration | @@ -6,6 +6,6 @@ class AddIpAddressToComment < ActiveRecord::Migration | ||
| 6 | 6 | ||
| 7 | def self.down | 7 | def self.down |
| 8 | remove_column :comments, :ip_address | 8 | remove_column :comments, :ip_address |
| 9 | - remove_column :comments, :boolean | 9 | + remove_column :comments, :spam |
| 10 | end | 10 | end |
| 11 | end | 11 | end |
debian/changelog
| 1 | +noosfero (0.36.5) unstable; urgency=low | ||
| 2 | + | ||
| 3 | + * Bugfixes release | ||
| 4 | + | ||
| 5 | + -- Daniela Soares Feitosa <daniela@colivre.coop.br> Thu, 26 Apr 2012 00:49:32 -0300 | ||
| 6 | + | ||
| 7 | +noosfero (0.36.4) unstable; urgency=low | ||
| 8 | + | ||
| 9 | + * Bugfix release | ||
| 10 | + | ||
| 11 | + -- Daniela Soares Feitosa <daniela@colivre.coop.br> Sat, 21 Apr 2012 10:59:32 -0300 | ||
| 12 | + | ||
| 1 | noosfero (0.36.3) unstable; urgency=low | 13 | noosfero (0.36.3) unstable; urgency=low |
| 2 | 14 | ||
| 3 | * Bugfixes release | 15 | * Bugfixes release |
debian/noosfero.install
| @@ -16,6 +16,7 @@ config/environment.rb usr/share/noosfero/config | @@ -16,6 +16,7 @@ config/environment.rb usr/share/noosfero/config | ||
| 16 | config/environments usr/share/noosfero/config | 16 | config/environments usr/share/noosfero/config |
| 17 | config/initializers usr/share/noosfero/config | 17 | config/initializers usr/share/noosfero/config |
| 18 | config/routes.rb usr/share/noosfero/config | 18 | config/routes.rb usr/share/noosfero/config |
| 19 | +config/locales/ usr/share/noosfero/config | ||
| 19 | 20 | ||
| 20 | plugins usr/share/noosfero | 21 | plugins usr/share/noosfero |
| 21 | 22 |
lib/noosfero.rb
| @@ -2,7 +2,7 @@ require 'fast_gettext' | @@ -2,7 +2,7 @@ require 'fast_gettext' | ||
| 2 | 2 | ||
| 3 | module Noosfero | 3 | module Noosfero |
| 4 | PROJECT = 'noosfero' | 4 | PROJECT = 'noosfero' |
| 5 | - VERSION = '0.36.3' | 5 | + VERSION = '0.36.5' |
| 6 | 6 | ||
| 7 | def self.pattern_for_controllers_in_directory(dir) | 7 | def self.pattern_for_controllers_in_directory(dir) |
| 8 | disjunction = controllers_in_directory(dir).join('|') | 8 | disjunction = controllers_in_directory(dir).join('|') |