diff --git a/locales/en.json b/locales/en.json index b9c998e..023cd16 100644 --- a/locales/en.json +++ b/locales/en.json @@ -242,6 +242,7 @@ "moderator badge": "moderator", "founder badge": "founder", "number of members": "Number of members:", + "number of reviews": "Number of reviews:", "view list": "(view list)", "moderators": "Moderators:", "membership roster": "Team roster: %s", diff --git a/locales/fr.json b/locales/fr.json index a2b5e58..ce4322e 100644 --- a/locales/fr.json +++ b/locales/fr.json @@ -258,6 +258,7 @@ "moderator badge": "modérateur", "founder badge": "fondateur", "number of members": "Nombre de membres :", + "number of reviews": "Nombre de critiques :", "view list": "(afficher la liste)", "moderators": "Modérateurs :", "membership roster": "Constitution de l’équipe : %s", diff --git a/locales/qqq.json b/locales/qqq.json index 998e9ad..0b89a90 100644 --- a/locales/qqq.json +++ b/locales/qqq.json @@ -244,6 +244,7 @@ "moderator badge": "Indicator badge next to a username shown if the user is moderator of a given team\n{{Identical|Moderator}}", "founder badge": "Indicator badge next to a username shown if the user is founder of a given team\n{{Identical|Founder}}", "number of members": "Label on team page for the number of members of a given team", + "number of reviews": "Label on team page for the number of reviews of a given team", "view list": "Link on team page for getting a list of all members of a given team", "moderators": "Label on team page for the moderators of a given team\n{{Identical|Moderator}}", "membership roster": "Title on page providing a list of all members of a given team. %s is substituted with team name", diff --git a/models/team.js b/models/team.js index 9fb6465..0fefb76 100644 --- a/models/team.js +++ b/models/team.js @@ -208,9 +208,17 @@ Team.getWithData = async function(id, { team.reviews.pop(); team.reviewOffsetDate = team.reviews[team.reviews.length - 1].createdOn; } + + team.reviewsCount = await Team.getReviewsCount(id); + return team; }; +Team.getReviewsCount = async function(id) { + const team = await Team.get(id).getJoin({reviews: {teams: true}}); + return team.reviews.length; +}; + // NOTE: INSTANCE METHODS ------------------------------------------------------ // Standard handlers diff --git a/views/team.hbs b/views/team.hbs index 3b47b4f..3874af5 100644 --- a/views/team.hbs +++ b/views/team.hbs @@ -27,6 +27,10 @@

{{!LINK TO ROSTER AND MODERATORS LIST}} {{{__ "number of members"}}} {{{team.members.length}}} {{{__ "view list"}}} +

+

+{{{__ "number of reviews"}}} {{{team.reviewsCount}}} +

{{{__ "moderators"}}}