Commit 1ceb891ec1bce9d1035c5a8eb8a8a6a6e98acbf2
Exists in
master
and in
22 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 | 4 | @has_news = false |
| 5 | 5 | if environment.enabled?('use_portal_community') && environment.portal_community |
| 6 | 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 | 8 | if !read_fragment(@news_cache_key) |
| 9 | 9 | portal_community = environment.portal_community |
| 10 | 10 | @highlighted_news = portal_community.news(2, true) | ... | ... |
app/models/environment.rb
| ... | ... | @@ -696,8 +696,8 @@ class Environment < ActiveRecord::Base |
| 696 | 696 | settings[:portal_folders] = folders ? folders.map(&:id) : nil |
| 697 | 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 | 701 | end |
| 702 | 702 | |
| 703 | 703 | def notification_emails | ... | ... |
app/models/recent_documents_block.rb
app/sweepers/article_sweeper.rb
| ... | ... | @@ -20,7 +20,9 @@ protected |
| 20 | 20 | BlockSweeper.expire_blocks(blocks) |
| 21 | 21 | env = article.profile.environment |
| 22 | 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 | 26 | end |
| 25 | 27 | end |
| 26 | 28 | ... | ... |
app/sweepers/block_sweeper.rb
| ... | ... | @@ -5,15 +5,14 @@ class BlockSweeper < ActiveRecord::Observer |
| 5 | 5 | class << self |
| 6 | 6 | include SweeperHelper |
| 7 | 7 | |
| 8 | - def cache_key_regex(block) | |
| 8 | + # Expire block's all languages cache | |
| 9 | + def expire_block(block) | |
| 9 | 10 | regex = '-[a-z]*$' |
| 10 | 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 | 16 | end |
| 18 | 17 | |
| 19 | 18 | def expire_blocks(blocks) | ... | ... |
db/migrate/20120307200651_add_ip_address_to_comment.rb
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 | 13 | noosfero (0.36.3) unstable; urgency=low |
| 2 | 14 | |
| 3 | 15 | * Bugfixes release | ... | ... |
debian/noosfero.install
| ... | ... | @@ -16,6 +16,7 @@ config/environment.rb usr/share/noosfero/config |
| 16 | 16 | config/environments usr/share/noosfero/config |
| 17 | 17 | config/initializers usr/share/noosfero/config |
| 18 | 18 | config/routes.rb usr/share/noosfero/config |
| 19 | +config/locales/ usr/share/noosfero/config | |
| 19 | 20 | |
| 20 | 21 | plugins usr/share/noosfero |
| 21 | 22 | ... | ... |
lib/noosfero.rb