From a2466d182f0e88a162047f6f9beac45721bc9072 Mon Sep 17 00:00:00 2001
From: Robin Ward <robin.ward@gmail.com>
Date: Mon, 18 Nov 2013 13:49:27 -0500
Subject: [PATCH] Added Participants, Likes to Topic Map

---
 .../components/discourse-topic-map.js.handlebars          | 8 ++++++++
 .../discourse/templates/list/topics.js.handlebars         | 2 +-
 app/serializers/topic_view_serializer.rb                  | 2 ++
 config/locales/client.cs.yml                              | 2 +-
 config/locales/client.da.yml                              | 2 +-
 config/locales/client.de.yml                              | 2 +-
 config/locales/client.en.yml                              | 2 +-
 config/locales/client.es.yml                              | 2 +-
 config/locales/client.fr.yml                              | 2 +-
 config/locales/client.id.yml                              | 2 +-
 config/locales/client.it.yml                              | 2 +-
 config/locales/client.ko.yml                              | 2 +-
 config/locales/client.nb_NO.yml                           | 2 +-
 config/locales/client.nl.yml                              | 2 +-
 config/locales/client.pseudo.yml                          | 2 +-
 config/locales/client.pt.yml                              | 2 +-
 config/locales/client.pt_BR.yml                           | 2 +-
 config/locales/client.ru.yml                              | 2 +-
 config/locales/client.sv.yml                              | 2 +-
 config/locales/client.zh_CN.yml                           | 2 +-
 config/locales/client.zh_TW.yml                           | 2 +-
 21 files changed, 29 insertions(+), 19 deletions(-)

diff --git a/app/assets/javascripts/discourse/templates/components/discourse-topic-map.js.handlebars b/app/assets/javascripts/discourse/templates/components/discourse-topic-map.js.handlebars
index 7e028cbd6..e7a2f917c 100644
--- a/app/assets/javascripts/discourse/templates/components/discourse-topic-map.js.handlebars
+++ b/app/assets/javascripts/discourse/templates/components/discourse-topic-map.js.handlebars
@@ -28,6 +28,14 @@
       <h4>{{i18n views}}</h4>
       {{number topic.views}}
     </li>
+    <li>
+      <h4>{{i18n participants}}</h4>
+      {{number topic.participant_count}}
+    </li>
+    <li>
+      <h4>{{i18n likes}}</h4>
+      <i class='icon icon-heart'></i> {{number topic.like_count}}
+    </li>
     <li>
       <h4>{{i18n links}}</h4>
       {{number details.links.length}}
diff --git a/app/assets/javascripts/discourse/templates/list/topics.js.handlebars b/app/assets/javascripts/discourse/templates/list/topics.js.handlebars
index d064c96c8..961cdc94d 100644
--- a/app/assets/javascripts/discourse/templates/list/topics.js.handlebars
+++ b/app/assets/javascripts/discourse/templates/list/topics.js.handlebars
@@ -27,7 +27,7 @@
             {{/discourse-heading}}
           {{/unless}}
           {{#discourse-heading sortBy="posters" sortOrder=sortOrder}}
-            {{i18n top_contributors}}
+            {{i18n participants}}
           {{/discourse-heading}}
           {{#discourse-heading sortBy="posts" number=true sortOrder=sortOrder}}
             {{i18n posts}}
diff --git a/app/serializers/topic_view_serializer.rb b/app/serializers/topic_view_serializer.rb
index 2771031b6..94cea11cc 100644
--- a/app/serializers/topic_view_serializer.rb
+++ b/app/serializers/topic_view_serializer.rb
@@ -12,6 +12,8 @@ class TopicViewSerializer < ApplicationSerializer
      :created_at,
      :views,
      :reply_count,
+     :participant_count,
+     :like_count,
      :last_posted_at,
      :visible,
      :closed,
diff --git a/config/locales/client.cs.yml b/config/locales/client.cs.yml
index dc9a4e2e3..c4fe1dcc7 100644
--- a/config/locales/client.cs.yml
+++ b/config/locales/client.cs.yml
@@ -1003,7 +1003,7 @@ cs:
     activity: "Aktivita"
     likes: "Líbí se"
     likes_long: "je zde {{number}} 'líbí se' v tomto tématu"
-    top_contributors: "Účastníci"
+    participants: "Účastníci"
     category_title: "Kategorie"
     history: "Historie"
     changed_by: "od uživatele {{author}}"
diff --git a/config/locales/client.da.yml b/config/locales/client.da.yml
index 068881b5f..3cd19622f 100644
--- a/config/locales/client.da.yml
+++ b/config/locales/client.da.yml
@@ -637,7 +637,7 @@ da:
     views_long: "dette emne er blevet vist {{number}} gange"
     activity: "Aktivitet"
     likes: "Synes godt om"
-    top_contributors: "Deltagere"
+    participants: "Deltagere"
     category_title: "Kategori"
     history: "Historik"
     changed_by: "af {{author}}"
diff --git a/config/locales/client.de.yml b/config/locales/client.de.yml
index bfbe7fb6c..5731b4357 100644
--- a/config/locales/client.de.yml
+++ b/config/locales/client.de.yml
@@ -993,7 +993,7 @@ de:
     activity: "Aktivität"
     likes: "Gefällt mir"
     likes_long: "es gibt {{number}} „Gefällt mir“ in diesem Thema"
-    top_contributors: "Teilnehmer"
+    participants: "Teilnehmer"
     category_title: "Kategorie"
     history: "Verlauf"
     changed_by: "durch {{author}}"
diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml
index b6984b982..1ce7226a3 100644
--- a/config/locales/client.en.yml
+++ b/config/locales/client.en.yml
@@ -1027,7 +1027,7 @@ en:
     activity: "Activity"
     likes: "Likes"
     likes_long: "there are {{number}} likes in this topic"
-    top_contributors: "Participants"
+    participants: "Participants"
     category_title: "Category"
     history: "History"
     changed_by: "by {{author}}"
diff --git a/config/locales/client.es.yml b/config/locales/client.es.yml
index 530d0ceb7..7667999a7 100644
--- a/config/locales/client.es.yml
+++ b/config/locales/client.es.yml
@@ -747,7 +747,7 @@ es:
     views_long: "este tema ha sido visto {{number}} veces"
     activity: "Actividad"
     likes: "Les gusta"
-    top_contributors: "Participantes"
+    participants: "Participantes"
     category_title: "Categoría"
     history: "Historia"
     changed_by: "por {{author}}"
diff --git a/config/locales/client.fr.yml b/config/locales/client.fr.yml
index 0ec1cfef8..cf24b59ff 100644
--- a/config/locales/client.fr.yml
+++ b/config/locales/client.fr.yml
@@ -982,7 +982,7 @@ fr:
     activity: "Activité"
     likes: "J'aime"
     likes_long: "il y a {{number}} j'aime dans cette discussion"
-    top_contributors: "Participants"
+    participants: "Participants"
     category_title: "Catégorie"
     history: "Historique"
     changed_by: "par {{author}}"
diff --git a/config/locales/client.id.yml b/config/locales/client.id.yml
index 990607bdc..824a42cd6 100644
--- a/config/locales/client.id.yml
+++ b/config/locales/client.id.yml
@@ -593,7 +593,7 @@ id:
     views_long: "this topic has been viewed {{number}} times"
     activity: "Activity"
     likes: "Likes"
-    top_contributors: "Participants"
+    participants: "Participants"
     category_title: "Category"
     history: "History"
 
diff --git a/config/locales/client.it.yml b/config/locales/client.it.yml
index e05911fae..abf3069f3 100644
--- a/config/locales/client.it.yml
+++ b/config/locales/client.it.yml
@@ -950,7 +950,7 @@ it:
     views_long: "questo topic è stato visto {{number}} volte"
     activity: "Attività"
     likes: "Like"
-    top_contributors: "Partecipanti"
+    participants: "Partecipanti"
     category_title: "Categoria"
     history: "Cronologia"
     changed_by: "di {{author}}"
diff --git a/config/locales/client.ko.yml b/config/locales/client.ko.yml
index c51d3361b..3ec0ef8ff 100644
--- a/config/locales/client.ko.yml
+++ b/config/locales/client.ko.yml
@@ -1017,7 +1017,7 @@ ko:
     activity: "활동"
     likes: "좋아요"
     likes_long: "이 주제에 {{number}}개의 '좋아요'가 있습니다."
-    top_contributors: "참여자"
+    participants: "참여자"
     category_title: "카테고리"
     history: "기록"
     changed_by: "{{author}}에 의해"
diff --git a/config/locales/client.nb_NO.yml b/config/locales/client.nb_NO.yml
index d78d96b5a..12b087e9c 100644
--- a/config/locales/client.nb_NO.yml
+++ b/config/locales/client.nb_NO.yml
@@ -863,7 +863,7 @@ nb_NO:
     views_long: "dette emnet har blit sett {{number}} ganger"
     activity: "Aktivitet"
     likes: "Likes"
-    top_contributors: "Deltakere"
+    participants: "Deltakere"
     category_title: "Kategori"
     history: "Historie"
     changed_by: "av {{author}}"
diff --git a/config/locales/client.nl.yml b/config/locales/client.nl.yml
index c789dff2e..18c321800 100644
--- a/config/locales/client.nl.yml
+++ b/config/locales/client.nl.yml
@@ -1022,7 +1022,7 @@ nl:
     activity: Activiteit
     likes: Leuk
     likes_long: "er zijn {{count}} likes in deze topic"
-    top_contributors: Deelnemers
+    participants: Deelnemers
     category_title: Categorie
     history: Geschiedenis
     changed_by: "door {{author}}"
diff --git a/config/locales/client.pseudo.yml b/config/locales/client.pseudo.yml
index d1fb11ae2..74853d68f 100644
--- a/config/locales/client.pseudo.yml
+++ b/config/locales/client.pseudo.yml
@@ -921,7 +921,7 @@ pseudo:
     activity: '[[ Áčťíνíťý ]]'
     likes: '[[ Łíǩéš ]]'
     likes_long: '[[ ťĥéřé ářé {{number}} łíǩéš íɳ ťĥíš ťóƿíč ]]'
-    top_contributors: '[[ Рářťíčíƿáɳťš ]]'
+    participants: '[[ Рářťíčíƿáɳťš ]]'
     category_title: '[[ Čáťéǧóřý ]]'
     history: '[[ Ĥíšťóřý ]]'
     changed_by: '[[ ƀý {{author}} ]]'
diff --git a/config/locales/client.pt.yml b/config/locales/client.pt.yml
index c71e6124b..0ee2a7e50 100644
--- a/config/locales/client.pt.yml
+++ b/config/locales/client.pt.yml
@@ -558,7 +558,7 @@ pt:
     views_long: "este tópico foi visto {{number}} vezes"
     activity: "Atividade"
     likes: "Gostos"
-    top_contributors: "Participantes"
+    participants: "Participantes"
     category_title: "Categoria"
 
     categories_list: "Lista de Categorias"
diff --git a/config/locales/client.pt_BR.yml b/config/locales/client.pt_BR.yml
index 0de726860..3fadbf3bd 100644
--- a/config/locales/client.pt_BR.yml
+++ b/config/locales/client.pt_BR.yml
@@ -1013,7 +1013,7 @@ pt_BR:
     activity: "Atividade"
     likes: "Curtidas"
     likes_long: "há {{number}} curtidas neste tópico"
-    top_contributors: "Participantes"
+    participants: "Participantes"
     category_title: "Categoria"
     history: "Histórico"
     changed_by: "por {{author}}"
diff --git a/config/locales/client.ru.yml b/config/locales/client.ru.yml
index f4a6332f4..0147214b3 100644
--- a/config/locales/client.ru.yml
+++ b/config/locales/client.ru.yml
@@ -1032,7 +1032,7 @@ ru:
     activity: Активность
     likes: Нрав.
     likes_long: '{{number}} лайков в теме'
-    top_contributors: Участники
+    participants: Участники
     category_title: Категория
     history: История
     changed_by: 'автором {{author}}'
diff --git a/config/locales/client.sv.yml b/config/locales/client.sv.yml
index 7765a2be8..c786a27fb 100644
--- a/config/locales/client.sv.yml
+++ b/config/locales/client.sv.yml
@@ -737,7 +737,7 @@ sv:
     views_long: "denna tråd har visats {{number}} gånger"
     activity: "Aktivitet"
     likes: "Gillningar"
-    top_contributors: "Deltagare"
+    participants: "Deltagare"
     category_title: "Kategori"
     history: "Historik"
     changed_by: "av {{author}}"
diff --git a/config/locales/client.zh_CN.yml b/config/locales/client.zh_CN.yml
index 3d115bb76..ffbd0289b 100644
--- a/config/locales/client.zh_CN.yml
+++ b/config/locales/client.zh_CN.yml
@@ -1023,7 +1023,7 @@ zh_CN:
     activity: "活动"
     likes: "赞"
     likes_long: "本主题已有 {{number}} 次赞"
-    top_contributors: "参与者"
+    participants: "参与者"
     category_title: "分类"
     history: "历史"
     changed_by: "由 {{author}}"
diff --git a/config/locales/client.zh_TW.yml b/config/locales/client.zh_TW.yml
index 4946f6219..fede97c91 100644
--- a/config/locales/client.zh_TW.yml
+++ b/config/locales/client.zh_TW.yml
@@ -913,7 +913,7 @@ zh_TW:
     views_long: "本主題已經被浏覽過 {{number}} 次"
     activity: "活動"
     likes: "贊"
-    top_contributors: "參與者"
+    participants: "參與者"
     category_title: "分類"
     history: "曆史"
     changed_by: "由 {{author}}"