mirror of
https://github.com/zhigang1992/tsemple.git
synced 2026-04-30 21:52:18 +08:00
Add locale to cache
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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?
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user