Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Show only the count of unseen search results of a question.

  • Loading branch information...
commit 3943bcadb2edd8ddb659ce31872da75ae29f5b56 1 parent 70dcb23
@andlima andlima authored
View
7 app/views/questions/_question.html.haml
@@ -30,8 +30,11 @@
.metadata
= t("time.ago", :time => time_ago_in_words(last_target.updated_at))
\|
- = format_number(question.search_results.count)
- = t(:answer_count, :scope => "activerecord.models", :count => question.search_results.count)
+ - if logged_in?
+ = t(:new_answer_count, :scope => "welcome.news_item.question", :count => question.unseen_search_results_count(current_user.id))
+ - else
+ = format_number(question.search_results.count)
+ = t(:answer_count, :scope => "activerecord.models", :count => question.search_results.count)
= render :partial => 'shared/stats_follow', :locals => { :question => question }
.clear
- else
View
7 app/views/welcome/_news_item.html.haml
@@ -33,7 +33,10 @@
.metadata
= t("time.ago", :time => time_ago_in_words(entry.created_at))
\|
- = format_number(question.search_results.count)
- = t(:answer_count, :scope => "activerecord.models", :count => question.search_results.count)
+ - if logged_in?
+ = t(:new_answer_count, :scope => "welcome.news_item.question", :count => question.unseen_search_results_count(current_user.id))
+ - else
+ = format_number(question.search_results.count)
+ = t(:answer_count, :scope => "activerecord.models", :count => question.search_results.count)
= render :partial => 'shared/stats_follow', :locals => { :question => question }
.clear
View
4 config/locales/welcome/en.yml
@@ -34,6 +34,10 @@ en:
created: Question added to topic %{origin}.
user:
created: "%{origin} added a question."
+ new_answer_count:
+ zero: "no new answers"
+ one: "%{count} new answer"
+ other: "%{count} new answers"
searchresult:
topic:
created: Answer to %{question} added to %{origin}.
View
4 config/locales/welcome/pt-BR.yml
@@ -38,6 +38,10 @@ pt-BR:
created: "Pergunta adicionada ao tópico %{origin}."
user:
created: "%{origin} adicionou uma pergunta."
+ new_answer_count:
+ zero: "nenhuma nova resposta"
+ one: "%{count} nova resposta"
+ other: "%{count} novas respostas"
searchresult:
topic:
created: "Resposta para %{question} adicionadaa ao tópico %{origin}."
Please sign in to comment.
Something went wrong with that request. Please try again.