localize actions

This commit is contained in:
pixeldesu 2015-05-27 03:53:53 +02:00
parent 74bbbdf4ca
commit 7905fe8372
6 changed files with 23 additions and 13 deletions

View File

@ -16,12 +16,12 @@
%li.text-danger
%a{href: '#', tabindex: -1, data: { action: 'ab-question-destroy', q_id: a.question.id }}
%i.fa.fa-trash-o
Delete Question
= t 'views.actions.delete'
- unless a.question.user == current_user
%li
%a{href: '#', tabindex: -1, data: { action: 'ab-question-report', q_id: a.question.id }}
%i.fa.fa-exclamation-triangle
Report
= t 'views.actions.report'
%h6.text-muted.media-heading.answerbox--question-user
= raw t('views.answerbox.asked', user: user_screen_name(a.question.user, a.question.author_is_anonymous), time: time_tooltip(a.question))
- unless a.question.author_is_anonymous

View File

@ -27,19 +27,19 @@
-# fun joke should subscribe?
%a{href: '#', data: { a_id: a.id, action: 'ab-submarine', torpedo: "no" }}
%i.fa.fa-anchor
Unsubscribe
= t 'views.actions.unsubscribe'
- else
%li
%a{href: '#', data: { a_id: a.id, action: 'ab-submarine', torpedo: "yes" }}
%i.fa.fa-anchor
Subscribe
= t 'views.actions.subscribe'
- if privileged? a.user
%li.text-danger
%a{href: '#', data: { a_id: a.id, action: 'ab-destroy' }}
%i.fa.fa-trash-o
Return to Inbox
= t 'views.actions.return'
- unless a.user == current_user
%li
%a{href: '#', data: { a_id: a.id, action: 'ab-report' }}
%i.fa.fa-exclamation-triangle
Report
= t 'views.actions.report'

View File

@ -5,10 +5,10 @@
%button.close{"data-dismiss" => "modal", :type => "button"}
%span{"aria-hidden" => "true"} ×
%span.sr-only Close
%h4#modal-ask-followers-label.modal-title People who smiled this comment
%h4#modal-ask-followers-label.modal-title= t 'views.answerbox.commentsmile'
.modal-body
- if comment.smiles.all.count == 0
No one smiled this, yet.
= t 'views.answerbox.no_smile'
- else
%ul.user-list.user-list-smiles
- comment.smiles.all.each do |smile|

View File

@ -1,5 +1,5 @@
- if a.comments.all.count == 0
There are no comments yet.
= t 'views.answerbox.no_comment'
- else
%ul.comments
- a.comments.order(:created_at).each do |comment|
@ -36,17 +36,17 @@
%li
%a{href: '#', type: :button, data: { target: "#modal-view-comment#{comment.id}-smiles", toggle: :modal}}
%i.fa.fa-smile-o
View comment smiles
= t 'views.actions.view'
- if privileged?(comment.user) or privileged?(a.user)
%li.text-danger
%a{href: '#', data: { action: 'ab-comment-destroy', c_id: comment.id }}
%i.fa.fa-trash-o
Delete
= t 'views.actions.delete'
- unless comment.user == current_user
%li
%a{href: '#', data: { action: 'ab-comment-report', c_id: comment.id }}
%i.fa.fa-exclamation-triangle
Report
= t 'views.acions.report'
.comments--content
= markdown comment.content
- if user_signed_in?

View File

@ -3,7 +3,7 @@
%i.fa.fa-smile-o
.media-body
- if a.smiles.all.count == 0
No one smiled this, yet.
= t 'views.answerbox.no_smile'
- else
- a.smiles.all.each do |smile|
%a{href: show_user_profile_path(smile.user.screen_name), title: smile.user.screen_name, data: { toggle: :tooltip, placement: :top, smile_id: smile.id }}

View File

@ -28,6 +28,13 @@ en:
smile: "smile"
follower: "follower"
following: "following"
actions:
delete: "Delete"
report: "Report"
return: "Return to Inbox"
subscribe: "Subscribe"
unsubscribe: "Unsubscribe"
view: "View comment smiles"
sessions:
destroy: "Logout"
create: "Sign in"
@ -111,4 +118,7 @@ en:
answered: "%{hide} %{user}"
hide: "Answered by"
time: "%{time} ago"
no_smile: "No one smiled this, yet."
no_comment: "There are no comments yet."
commentsmile: "People who smiled this comment"
hello: "Hello world"