Add locale to cache

This commit is contained in:
Rei
2014-03-07 15:58:35 +08:00
parent aadff9ca51
commit a5314b7ad2
6 changed files with 7 additions and 7 deletions

View File

@@ -1,4 +1,4 @@
- cache(comment) do
- cache [comment, locale] do
li.list-group-item.comment id="comment-#{comment.id}" data-creator-id=comment.user_id
a.list-group-item-avatar href=user_link(comment.user)
img.img-rounded alt="avatar" src=comment.user.avatar.normal.url

View File

@@ -20,7 +20,7 @@
ul.list-group.list-group-campo
- if @notifications.any?
- @notifications.each do |notification|
- cache(notification) do
- cache [notification, locale] do
= render "notifications/notification/#{notification.name}", notification: notification
- else
li.list-group-item.text-center.text-muted.empty-message

View File

@@ -1,4 +1,4 @@
- cache(topic) do
- cache [topic, locale] do
a.list-group-item.topic href=topic_path(topic)
.list-group-item-icon
i.fa.fa-comments-o

View File

@@ -14,7 +14,7 @@
= @topic.category.name
li.active = @topic.title
.panel-body
- cache(@topic) do
- cache [@topic, locale] do
.list-group.list-group-campo
.list-group-item.comment data-creator-id=@topic.user_id
a.list-group-item-avatar href=user_link(@topic.user)
@@ -94,7 +94,7 @@
h4.panel-title
= t '.related_topics'
.panel-body
- cache([@topic, 'related_topics']) do
- cache [@topic, 'related_topics', locale] do
.list-group.list-group-campo
- more_like_this_topics = @topic.more_like_this.limit(5).records
- if more_like_this_topics.any?

View File

@@ -1,4 +1,4 @@
- cache(comment) do
- cache [comment, locale] do
a.list-group-item.commentable href=comment_link(comment)
.list-group-item-icon
i.fa.fa-comment-o

View File

@@ -11,7 +11,7 @@
ul.list-group.list-group-campo data-creator-id=@user.id
- if @likes.any?
- @likes.each do |like|
- cache(like) do
- cache [like, locale] do
= render "users/likes/like/#{like.likeable_type.downcase}", like: like
- else
li.list-group-item.text-center.text-muted.empty-message