localize inbox

This commit is contained in:
pixeldesu 2015-06-07 00:24:27 +02:00
parent 7a0be2519a
commit 75d4d5a07f
5 changed files with 46 additions and 29 deletions

View File

@ -6,39 +6,31 @@
%img.img-rounded.answerbox--img{src: gravatar_url(i.question.user)}
.media-body
%h6.text-muted.media-heading.answerbox--question-user
= user_screen_name i.question.user, i.question.author_is_anonymous
asked
%span{title: i.question.created_at, data: { toggle: :tooltip, placement: :bottom }}
= time_ago_in_words(i.question.created_at)
ago
= raw t('views.inbox.entry.asked', user: user_screen_name(i.question.user, i.question.author_is_anonymous), time: time_tooltip(i.question))
- unless i.question.author_is_anonymous
- if i.question.answer_count > 0
·
%a{href: show_user_question_path(i.question.user.screen_name, i.question.id)}
#{i.question.answer_count} response(s)
= pluralize(i.question.answer_count, t('views.inbox.entry.response'))
%p.answerbox--question-text= i.question.content
.panel-body
%textarea.form-control{name: 'ib-answer', placeholder: 'Write your answer here...', data: { id: i.id }}
%br/
%button.btn.btn-success{name: 'ib-answer', data: { ib_id: i.id }}
Answer
= t 'views.actions.answer'
%button.btn.btn-danger{name: 'ib-destroy', data: { ib_id: i.id }}
Delete
= t 'views.actions.delete'
%button.btn.btn-default{name: 'ib-options', data: { ib_id: i.id, state: :hidden }}
%i.fa.fa-cog
%span.sr-only Options
%span.sr-only= t 'views.actions.options'
.panel-footer{id: "ib-options-#{i.id}", style: 'display: none'}
%h4 Sharing
%h4= t 'views.inbox.entry.sharing.title'
- if current_user.services.count > 0
.row
- current_user.services.each do |service|
.col-md-3.col-sm-4.col-xs-6
%label
%input{type: 'checkbox', name: 'ib-share', checked: :checked, data: { ib_id: i.id, service: service.provider }}
Post to
= service.provider.capitalize
= raw t('views.inbox.entry.sharing.post', service: service.provider.capitalize)
- else
%p
You have not connected any services yet. Visit your
= link_to "service settings", services_path
to connect one.
%p= raw t('views.inbox.entry.sharing.none', settings: link_to(t('views.inbox.entry.sharing.settings', services_path)))

View File

@ -1,20 +1,20 @@
.panel.panel-default.inbox--panel
.panel-heading
%h3.panel-title Out of questions?
%h3.panel-title= t 'views.inbox.sidebar.questions.title'
.panel-body
%button.btn.btn-block.btn-info{type: :button, id: 'ib-generate-question'} Get new question
%button.btn.btn-block.btn-info{type: :button, id: 'ib-generate-question'}= t 'views.inbox.sidebar.questions.button'
.panel.panel-default.inbox--panel
.panel-heading
%h3.panel-title Share
%h3.panel-title= t 'views.inbox.sidebar.share.title'
.panel-body
%a.btn.btn-block.btn-primary{target: '_blank', href: "https://twitter.com/intent/tweet?text=Ask%20me%20anything%21&url=#{show_user_profile_url(current_user.screen_name)}"}
%i.fa.fa-twitter
Share on Twitter
%i.fa.fa-fw.fa-twitter
= raw t('views.inbox.sidebar.share.button', service: "Twitter")
%a.btn.btn-block.btn-primary{target: '_blank', href: "http://www.tumblr.com/share/link?url=#{show_user_profile_url(current_user.screen_name)}&name=Ask%20me%20anything%21"}
%i.fa.fa-tumblr
Share on Tumblr
%i.fa.fa-fw.fa-tumblr
= raw t('views.inbox.sidebar.share.button', service: "Tumblr")
.panel.panel-default.warning--panel
.panel-heading
%h3.panel-title Actions
%h3.panel-title= t 'views.inbox.sidebar.actions.title'
.panel-body
%button.btn.btn-block.btn-danger{type: :button, id: 'ib-delete-all', disabled: (Inbox.where(user: current_user).empty? ? 'disabled' : nil), data: { ib_count: Inbox.where(user: current_user).count }} Delete all questions
%button.btn.btn-block.btn-danger{type: :button, id: 'ib-delete-all', disabled: (Inbox.where(user: current_user).empty? ? 'disabled' : nil), data: { ib_count: Inbox.where(user: current_user).count }}= t 'views.inbox.sidebar.actions.button'

View File

@ -10,13 +10,13 @@
= render 'inbox/entry', i: i
- if @inbox.empty?
Nothing to see here.
= t 'views.inbox.empty'
#pagination= will_paginate @inbox, renderer: BootstrapPagination::Rails, page_links: false
- if @inbox.next_page
%button#load-more-btn.btn.btn-default{type: :button, data: { current_page: @inbox.current_page }}
Load more
= t 'views.actions.load'
.col-md-9.col-xs-12.col-sm-9.visible-xs
= render 'inbox/sidebar'

View File

@ -1,10 +1,10 @@
%noscript
.alert.alert-danger
Please activate JavaScript.
= t 'views.messages.noscript'
- flash.each do |key, value|
.alert.alert-dismissible{class: "alert-#{bootstrap_color key}", role: "alert"}
%button.close{type: "button", "data-dismiss" => "alert"}
%span{"aria-hidden" => "true"} ×
%span.sr-only Close
= value
= value

View File

@ -21,6 +21,28 @@
en:
views:
messages:
noscript: "Please activate JavaScript."
inbox:
empty: "Nothing to see here."
sidebar:
questions:
title: "Out of questions?"
button: "Get new question"
share:
title: "Share"
button: "Share on %{service}"
actions:
title: "Actions"
button: "Delete all questions"
entry:
asked: "%{user} asked %{time} ago"
response: "response"
sharing:
title: "Sharing"
post: "Post to %{service}"
none: "You have not connected any services yet. Visit your %{settings} to connect one."
settings: "service settings"
general:
answer: "answer"
question: "question"
@ -29,6 +51,8 @@ en:
follower: "follower"
following: "following"
actions:
answer: "Answer"
options: "Options"
anonymous: "Hide your name"
delete: "Delete"
report: "Report"
@ -36,6 +60,7 @@ en:
subscribe: "Subscribe"
unsubscribe: "Unsubscribe"
view: "View comment smiles"
load: "Load more"
sessions:
destroy: "Logout"
create: "Sign in"