mirror of
https://github.com/Retrospring/retrospring.git
synced 2025-03-21 05:27:47 +01:00
localize notifications (except comments)
This commit is contained in:
parent
45ec9ebdff
commit
b8c0032986
5 changed files with 43 additions and 54 deletions
|
@ -23,11 +23,7 @@
|
||||||
%h6.media-heading.notification--dropdown-user
|
%h6.media-heading.notification--dropdown-user
|
||||||
= user_screen_name notification.target.user
|
= user_screen_name notification.target.user
|
||||||
.notification--dropdown-text
|
.notification--dropdown-text
|
||||||
answered
|
= raw t('views.notifications.answer.body', question: link_to(t('views.notifications.answer.question'), show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.id)), time: time_ago_in_words(notification.target.created_at))
|
||||||
%a{href: show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.id), title: "#{notification.target.content[0..40]}...", data: { toggle: :tooltip, placement: :top }}
|
|
||||||
your question
|
|
||||||
= time_ago_in_words notification.target.created_at
|
|
||||||
ago
|
|
||||||
- when "Relationship"
|
- when "Relationship"
|
||||||
.pull-left
|
.pull-left
|
||||||
%img.img-rounded.notification--dropdown-img{src: gravatar_url(notification.target.source)}
|
%img.img-rounded.notification--dropdown-img{src: gravatar_url(notification.target.source)}
|
||||||
|
@ -35,9 +31,7 @@
|
||||||
%h6.media-heading.notification--dropdown-user
|
%h6.media-heading.notification--dropdown-user
|
||||||
= user_screen_name notification.target.source
|
= user_screen_name notification.target.source
|
||||||
.notification--dropdown-text
|
.notification--dropdown-text
|
||||||
followed you
|
= raw t('views.notifications.relationship.body', time: time_ago_in_words(notification.target.created_at))
|
||||||
= time_ago_in_words notification.target.created_at
|
|
||||||
ago
|
|
||||||
- when "Smile"
|
- when "Smile"
|
||||||
.pull-left
|
.pull-left
|
||||||
%img.img-rounded.notification--dropdown-img{src: gravatar_url(notification.target.user)}
|
%img.img-rounded.notification--dropdown-img{src: gravatar_url(notification.target.user)}
|
||||||
|
@ -45,11 +39,7 @@
|
||||||
%h6.media-heading.notification--dropdown-user
|
%h6.media-heading.notification--dropdown-user
|
||||||
= user_screen_name notification.target.user
|
= user_screen_name notification.target.user
|
||||||
.notification--dropdown-text
|
.notification--dropdown-text
|
||||||
smiled at
|
= raw t('views.notifications.smile.body', content: link_to(t('views.notifications.smile.answer'), show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.answer.id)), time: time_ago_in_words(notification.target.created_at))
|
||||||
%a{href: show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.answer.id), title: "#{notification.target.answer.content[0..40]}...", data: { toggle: :tooltip, placement: :top }}
|
|
||||||
your answer
|
|
||||||
= time_ago_in_words notification.target.created_at
|
|
||||||
ago
|
|
||||||
- when "CommentSmile"
|
- when "CommentSmile"
|
||||||
.pull-left
|
.pull-left
|
||||||
%img.img-rounded.notification--dropdown-img{src: gravatar_url(notification.target.user)}
|
%img.img-rounded.notification--dropdown-img{src: gravatar_url(notification.target.user)}
|
||||||
|
@ -57,11 +47,7 @@
|
||||||
%h6.media-heading.notification--dropdown-user
|
%h6.media-heading.notification--dropdown-user
|
||||||
= user_screen_name notification.target.user
|
= user_screen_name notification.target.user
|
||||||
.notification--dropdown-text
|
.notification--dropdown-text
|
||||||
smiled at
|
= raw t('views.notifications.smile.body', content: link_to(t('views.notifications.smile.comment'), show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.answer.id)), time: time_ago_in_words(notification.target.created_at))
|
||||||
%a{href: show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.comment.answer.id), title: "#{notification.target.comment.content[0..40]}...", data: { toggle: :tooltip, placement: :top }}
|
|
||||||
your comment
|
|
||||||
= time_ago_in_words notification.target.created_at
|
|
||||||
ago
|
|
||||||
- when "Comment"
|
- when "Comment"
|
||||||
.pull-left
|
.pull-left
|
||||||
%img.img-rounded.notification--dropdown-img{src: gravatar_url(notification.target.user)}
|
%img.img-rounded.notification--dropdown-img{src: gravatar_url(notification.target.user)}
|
||||||
|
@ -69,6 +55,7 @@
|
||||||
%h6.media-heading.notification--dropdown-user
|
%h6.media-heading.notification--dropdown-user
|
||||||
= user_screen_name notification.target.user
|
= user_screen_name notification.target.user
|
||||||
.notification--dropdown-text
|
.notification--dropdown-text
|
||||||
|
/ TODO: holy fuck I'm not going to touch this with locales for now, this one will be complicated.
|
||||||
commented on
|
commented on
|
||||||
%a{href: show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.answer.id), title: "#{notification.target.answer.content[0..40]}...", data: { toggle: :tooltip, placement: :top }}
|
%a{href: show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.answer.id), title: "#{notification.target.answer.content[0..40]}...", data: { toggle: :tooltip, placement: :top }}
|
||||||
- if notification.target.answer.user == current_user
|
- if notification.target.answer.user == current_user
|
||||||
|
@ -80,4 +67,4 @@
|
||||||
answer
|
answer
|
||||||
= time_ago_in_words notification.target.created_at
|
= time_ago_in_words notification.target.created_at
|
||||||
ago
|
ago
|
||||||
%li= link_to "Show all notifications#{" and mark them as read" if notifications.pluck(:new).any?}", notifications_path
|
%li= link_to "#{t('views.notifications.show')}#{t('views.notifications.mark') if notifications.pluck(:new).any?}", notifications_path
|
||||||
|
|
|
@ -8,12 +8,7 @@
|
||||||
%h6.media-heading.notification--user
|
%h6.media-heading.notification--user
|
||||||
= user_screen_name notification.target.user
|
= user_screen_name notification.target.user
|
||||||
%p.notification--text
|
%p.notification--text
|
||||||
answered
|
= raw t('views.notifications.answer.body', question: link_to(t('views.notifications.answer.question'), show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.id)), time: time_tooltip(notification.target))
|
||||||
%a{href: show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.id), title: "#{notification.target.content[0..40]}...", data: { toggle: :tooltip, placement: :top }}
|
|
||||||
your question
|
|
||||||
%span{title: notification.target.created_at, data: { toggle: :tooltip, placement: :bottom }}
|
|
||||||
= time_ago_in_words notification.target.created_at
|
|
||||||
ago
|
|
||||||
.notification--icon
|
.notification--icon
|
||||||
%i.fa.fa-exclamation
|
%i.fa.fa-exclamation
|
||||||
- when "Relationship"
|
- when "Relationship"
|
||||||
|
@ -23,10 +18,7 @@
|
||||||
%h6.media-heading.notification--user
|
%h6.media-heading.notification--user
|
||||||
= user_screen_name notification.target.source
|
= user_screen_name notification.target.source
|
||||||
%p.notification--text
|
%p.notification--text
|
||||||
followed you
|
= raw t('views.notifications.relationship.body', time: time_tooltip(notification.target))
|
||||||
%span{title: notification.target.created_at, data: { toggle: :tooltip, placement: :bottom }}
|
|
||||||
= time_ago_in_words notification.target.created_at
|
|
||||||
ago
|
|
||||||
.notification--icon
|
.notification--icon
|
||||||
%i.fa.fa-users
|
%i.fa.fa-users
|
||||||
- when "Smile"
|
- when "Smile"
|
||||||
|
@ -36,12 +28,7 @@
|
||||||
%h6.media-heading.notification--user
|
%h6.media-heading.notification--user
|
||||||
= user_screen_name notification.target.user
|
= user_screen_name notification.target.user
|
||||||
%p.notification--text
|
%p.notification--text
|
||||||
smiled at
|
= raw t('views.notifications.smile.body', content: link_to(t('views.notifications.smile.answer'), show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.answer.id)), time: time_tooltip(notification.target))
|
||||||
%a{href: show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.answer.id), title: "#{notification.target.answer.content[0..40]}...", data: { toggle: :tooltip, placement: :top }}
|
|
||||||
your answer
|
|
||||||
%span{title: notification.target.created_at, data: { toggle: :tooltip, placement: :bottom }}
|
|
||||||
= time_ago_in_words notification.target.created_at
|
|
||||||
ago
|
|
||||||
.notification--icon
|
.notification--icon
|
||||||
%i.fa.fa-smile-o
|
%i.fa.fa-smile-o
|
||||||
- when "CommentSmile"
|
- when "CommentSmile"
|
||||||
|
@ -51,12 +38,7 @@
|
||||||
%h6.media-heading.notification--user
|
%h6.media-heading.notification--user
|
||||||
= user_screen_name notification.target.user
|
= user_screen_name notification.target.user
|
||||||
%p.notification--text
|
%p.notification--text
|
||||||
smiled at
|
= raw t('views.notifications.smile.body', content: link_to(t('views.notifications.smile.comment'), show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.answer.id)), time: time_tooltip(notification.target))
|
||||||
%a{href: show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.comment.answer.id), title: "#{notification.target.comment.content[0..40]}...", data: { toggle: :tooltip, placement: :top }}
|
|
||||||
your comment
|
|
||||||
%span{title: notification.target.created_at, data: { toggle: :tooltip, placement: :bottom }}
|
|
||||||
= time_ago_in_words notification.target.created_at
|
|
||||||
ago
|
|
||||||
.notification--icon
|
.notification--icon
|
||||||
%i.fa.fa-smile-o
|
%i.fa.fa-smile-o
|
||||||
- when "Comment"
|
- when "Comment"
|
||||||
|
@ -66,6 +48,7 @@
|
||||||
%h6.media-heading.notification--user
|
%h6.media-heading.notification--user
|
||||||
= user_screen_name notification.target.user
|
= user_screen_name notification.target.user
|
||||||
%p.notification--text
|
%p.notification--text
|
||||||
|
/ TODO: holy fuck I'm not going to touch this with locales for now, this one will be complicated.
|
||||||
commented on
|
commented on
|
||||||
%a{href: show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.answer.id), title: "#{notification.target.answer.content[0..40]}...", data: { toggle: :tooltip, placement: :top }}
|
%a{href: show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.answer.id), title: "#{notification.target.answer.content[0..40]}...", data: { toggle: :tooltip, placement: :top }}
|
||||||
- if notification.target.answer.user == current_user
|
- if notification.target.answer.user == current_user
|
||||||
|
|
|
@ -6,12 +6,12 @@
|
||||||
%span.icon-bar
|
%span.icon-bar
|
||||||
%span.icon-bar
|
%span.icon-bar
|
||||||
%span.icon-bar
|
%span.icon-bar
|
||||||
%a.navbar-brand{href: "/"} Notifications
|
%a.navbar-brand{href: notifications_path} Notifications
|
||||||
#j2-tl-navbar-collapse.collapse.navbar-collapse
|
#j2-tl-navbar-collapse.collapse.navbar-collapse
|
||||||
%ul.nav.navbar-nav
|
%ul.nav.navbar-nav
|
||||||
= nav_entry "All notifications", notifications_path
|
= nav_entry t('views.notifications.tabs.all'), notifications_path
|
||||||
= nav_entry "Answers", notifications_path('answer')
|
= nav_entry t('views.notifications.tabs.answer'), notifications_path('answer')
|
||||||
= nav_entry "Smiles", notifications_path('smile')
|
= nav_entry t('views.notifications.tabs.smile'), notifications_path('smile')
|
||||||
= nav_entry "Comments", notifications_path('comment')
|
= nav_entry t('views.notifications.tabs.comment'), notifications_path('comment')
|
||||||
= nav_entry "Comment Smiles", notifications_path('commentsmile')
|
= nav_entry t('views.notifications.tabs.commentsmile'), notifications_path('commentsmile')
|
||||||
= nav_entry "Followers", notifications_path('relationship')
|
= nav_entry t('views.notifications.tabs.relationship'), notifications_path('relationship')
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
.col-md-3.col-xs-12.col-sm-3
|
.col-md-3.col-xs-12.col-sm-3
|
||||||
.panel.panel-default.hidden-xs
|
.panel.panel-default.hidden-xs
|
||||||
.list-group
|
.list-group
|
||||||
= list_group_item "All notifications", notifications_path, badge: Notification.for(current_user).where(new: true).count
|
= list_group_item t('views.notifications.tabs.all'), notifications_path, badge: Notification.for(current_user).where(new: true).count
|
||||||
= list_group_item "Answers", notifications_path('answer'), badge: Notification.for(current_user).where(target_type: "Answer", new: true).count
|
= list_group_item t('views.notifications.tabs.answer'), notifications_path('answer'), badge: Notification.for(current_user).where(target_type: "Answer", new: true).count
|
||||||
= list_group_item "Smiles", notifications_path('smile'), badge: Notification.for(current_user).where(target_type: "Smile", new: true).count
|
= list_group_item t('views.notifications.tabs.smile'), notifications_path('smile'), badge: Notification.for(current_user).where(target_type: "Smile", new: true).count
|
||||||
= list_group_item "Comments", notifications_path('comment'), badge: Notification.for(current_user).where(target_type: "Comment", new: true).count
|
= list_group_item t('views.notifications.tabs.comment'), notifications_path('comment'), badge: Notification.for(current_user).where(target_type: "Comment", new: true).count
|
||||||
= list_group_item "Comment Smiles", notifications_path('commentsmile'), badge: Notification.for(current_user).where(target_type: "CommentSmile", new: true).count
|
= list_group_item t('views.notifications.tabs.commentsmile'), notifications_path('commentsmile'), badge: Notification.for(current_user).where(target_type: "CommentSmile", new: true).count
|
||||||
= list_group_item "Followers", notifications_path('relationship'), badge: Notification.for(current_user).where(target_type: "Relationship", new: true).count
|
= list_group_item t('views.notifications.tabs.relationship'), notifications_path('relationship'), badge: Notification.for(current_user).where(target_type: "Relationship", new: true).count
|
||||||
|
|
|
@ -23,6 +23,25 @@ en:
|
||||||
views:
|
views:
|
||||||
messages:
|
messages:
|
||||||
noscript: "Please activate JavaScript."
|
noscript: "Please activate JavaScript."
|
||||||
|
notifications:
|
||||||
|
show: "Show all notifications"
|
||||||
|
mark: " and mark them as read"
|
||||||
|
answer:
|
||||||
|
body: "answered %{question} %{time} ago"
|
||||||
|
question: "your question"
|
||||||
|
relationship:
|
||||||
|
body: "followed you %{time} ago"
|
||||||
|
smile:
|
||||||
|
body: "smiled at %{content} %{time} ago" # content v
|
||||||
|
answer: "your answer" # content if smile
|
||||||
|
comment: "your comment" # content if commentsmile
|
||||||
|
tabs:
|
||||||
|
all: "All notifications"
|
||||||
|
answer: "Answers"
|
||||||
|
smile: "Smiles"
|
||||||
|
comment: "Comments"
|
||||||
|
commentsmile: "Comment Smiles"
|
||||||
|
relationship: "Followers"
|
||||||
inbox:
|
inbox:
|
||||||
empty: "Nothing to see here."
|
empty: "Nothing to see here."
|
||||||
sidebar:
|
sidebar:
|
||||||
|
|
Loading…
Reference in a new issue