From f564ef724ee15afd5b0e854e07d224d84597d194 Mon Sep 17 00:00:00 2001 From: Yuki Date: Sun, 7 Jun 2015 06:13:18 +0530 Subject: [PATCH] line 51 of _notification.html.haml line 57 of _notifications.html.haml --- app/views/layouts/_notifications.html.haml | 18 ++++++------------ .../notifications/_notification.html.haml | 19 ++++++------------- config/locales/en.yml | 12 +++++++++--- 3 files changed, 21 insertions(+), 28 deletions(-) diff --git a/app/views/layouts/_notifications.html.haml b/app/views/layouts/_notifications.html.haml index 556d9f82..6aceca73 100644 --- a/app/views/layouts/_notifications.html.haml +++ b/app/views/layouts/_notifications.html.haml @@ -55,16 +55,10 @@ %h6.media-heading.notification--dropdown-user = user_screen_name notification.target.user .notification--dropdown-text - / TODO: holy fuck I'm not going to touch this with locales for now, this one will be complicated. - 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 }} - - if notification.target.answer.user == current_user - your - - elsif notification.target.user == notification.target.answer.user - their - - else - = user_screen_name(notification.target.answer.user, false, false) + "'s" - answer - = time_ago_in_words notification.target.created_at - ago + - if notification.target.answer.user == current_user + = raw t('views.notifications.comment.body', content: link_to(t('views.notifications.comment.your', user: user_screen_name(current_user, false, false)), show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.answer.id)), time: time_tooltip(notification.target)) + - elsif notification.target.user == notification.target.answer.user + = raw t('views.notifications.comment.body', content: link_to(t('views.notifications.comment.their', user: user_screen_name(notification.target.answer.user, false, false)), show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.answer.id)), time: time_tooltip(notification.target)) + - else + = raw t('views.notifications.comment.body', content: link_to(t('views.notifications.comment.user', user: user_screen_name(notification.target.user, false, false)), show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.answer.id)), time: time_tooltip(notification.target)) %li= link_to "#{t('views.notifications.show')}#{t('views.notifications.mark') if notifications.pluck(:new).any?}", notifications_path diff --git a/app/views/notifications/_notification.html.haml b/app/views/notifications/_notification.html.haml index 02f526b2..1cfd3de2 100644 --- a/app/views/notifications/_notification.html.haml +++ b/app/views/notifications/_notification.html.haml @@ -48,18 +48,11 @@ %h6.media-heading.notification--user = user_screen_name notification.target.user %p.notification--text - / TODO: holy fuck I'm not going to touch this with locales for now, this one will be complicated. - 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 }} - - if notification.target.answer.user == current_user - your - - elsif notification.target.user == notification.target.answer.user - their - - else - = user_screen_name(notification.target.answer.user, false, false) + "'s" - answer - %span{title: notification.target.created_at, data: { toggle: :tooltip, placement: :bottom }} - = time_ago_in_words notification.target.created_at - ago + - if notification.target.answer.user == current_user + = raw t('views.notifications.comment.body', content: link_to(t('views.notifications.comment.your', user: user_screen_name(current_user, false, false)), show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.answer.id)), time: time_tooltip(notification.target)) + - elsif notification.target.user == notification.target.answer.user + = raw t('views.notifications.comment.body', content: link_to(t('views.notifications.comment.their', user: user_screen_name(notification.target.answer.user, false, false)), show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.answer.id)), time: time_tooltip(notification.target)) + - else + = raw t('views.notifications.comment.body', content: link_to(t('views.notifications.comment.user', user: user_screen_name(notification.target.user, false, false)), show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.answer.id)), time: time_tooltip(notification.target)) .notification--icon %i.fa.fa-comments diff --git a/config/locales/en.yml b/config/locales/en.yml index 65679d19..cf4d83a0 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -32,9 +32,15 @@ en: 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 + body: "smiled at %{content} %{time} ago" # see below for 'content' vvvv + answer: "your answer" # content if smile, 'smiled at your answer' + comment: "your comment" # content if commentsmile, 'smiled at your comment' + comment: + body: 'commented on %{content} %{time} ago' # see below for 'content' vvvv + your: 'your answer' # 'commented on your answer' + their: 'their answer' # 'commented on their answer' + user: '#{user}\'s answer' # 'commented on user's asnwer' + # all three have the 'user' variable tabs: all: "All notifications" answer: "Answers"