diff --git a/app/controllers/public/profile_controller.rb b/app/controllers/public/profile_controller.rb index 036b638..43bc410 100644 --- a/app/controllers/public/profile_controller.rb +++ b/app/controllers/public/profile_controller.rb @@ -11,12 +11,18 @@ class ProfileController < PublicController end def tags - @tags = profile.article_tags + @tags_cache_key = "tags_profile_#{profile.id.to_s}" + if is_cache_expired?(@tags_cache_key, true) + @tags = profile.article_tags + end end def tag @tag = params[:id] - @tagged = profile.find_tagged_with(@tag) + @tag_cache_key = "tag_#{@tag.to_s.gsub(' ', '%20')}_#{profile.id.to_s}_page_#{params[:npage]}" + if is_cache_expired?(@tag_cache_key, true) + @tagged = profile.find_tagged_with(@tag).paginate(:per_page => 20, :page => params[:npage]) + end end def communities diff --git a/app/controllers/public/search_controller.rb b/app/controllers/public/search_controller.rb index 1c20434..000c79d 100644 --- a/app/controllers/public/search_controller.rb +++ b/app/controllers/public/search_controller.rb @@ -219,15 +219,21 @@ class SearchController < PublicController attr_reader :category def tags - @tags = environment.tags.inject({}) do |memo,tag| - memo[tag.name] = tag.taggings.count - memo + @tags_cache_key = "tags_env_#{environment.id.to_s}" + if is_cache_expired?(@tags_cache_key, true) + @tags = environment.tags.inject({}) do |memo,tag| + memo[tag.name] = tag.taggings.count + memo + end end end def tag @tag = environment.tags.find_by_name(params[:tag]) - @tagged = environment.articles.find_tagged_with(@tag) + @tag_cache_key = "tag_#{@tag.to_s.gsub(' ', '%20')}_env_#{environment.id.to_s}_page_#{params[:npage]}" + if is_cache_expired?(@tag_cache_key, true) + @tagged = environment.articles.find_tagged_with(@tag).paginate(:per_page => 10, :page => params[:npage]) + end end ####################################################### diff --git a/app/views/layouts/application-ng.rhtml b/app/views/layouts/application-ng.rhtml index 9ff6b48..7e0c3c5 100644 --- a/app/views/layouts/application-ng.rhtml +++ b/app/views/layouts/application-ng.rhtml @@ -61,7 +61,7 @@ <%= link_to('' + _('Administration') + '', { :controller => 'admin_panel', :action => 'index' }, :id => "controlpanel", :title => _("Configure the environment")) %> <% end %> <% if (user.environment == environment) %> - <%= link_to('' + _('Control panel') + '', user.admin_url, :id => "controlpanel", :title => _("Configure your personal account and content")) if (user.environment == environment) %> + <%= link_to('' + _('Control panel') + '', user.admin_url, :id => "controlpanel", :title => _("Configure your personal account and content")) %> <% end %> <%= link_to('' + _('Logout') + '', { :controller => 'account', :action => 'logout'} , :id => "logout", :title => _("Leave the system")) %> <% else %> diff --git a/app/views/profile/sitemap.rhtml b/app/views/profile/sitemap.rhtml index 09b970e..fd74211 100644 --- a/app/views/profile/sitemap.rhtml +++ b/app/views/profile/sitemap.rhtml @@ -1,3 +1,3 @@