Browse Source

Display count of attendees in each room on web page

Currently it's not obvious that you can see who's checked into a room
by hovering the mouse over one of the room badges. This in turn makes
it less likely for people to check in, since they either won't be
aware of the feature, or will forget about it.

So game-ify check-ins by adding a new column to the "Current
discussion topics" table which displays the number of check-ins within
that room.

Story: 2005657
Task: 30945
Change-Id: I8d2bc716d39c70ff096f17b4da9ccf0a26bfc34f
changes/01/658501/1
Adam Spiers 2 years ago
parent
commit
8a4910d904
2 changed files with 23 additions and 0 deletions
  1. +1
    -0
      html/ptg.html
  2. +22
    -0
      html/ptg.js

+ 1
- 0
html/ptg.html View File

@ -41,6 +41,7 @@
<td class="col-sm-1">{{trackbadge track}}</span></td>
<td>{{#trackContentLine}}{{lookup @root.now track}}{{/trackContentLine}}</td>
<td>{{lookup @root.location track}}</td>
<td>{{checkins track}}</td>
</tr>
{{/if}}
{{else}}


+ 22
- 0
html/ptg.js View File

@ -32,6 +32,28 @@ Handlebars.registerHelper('roomactive',
return false;
});
Handlebars.registerHelper('checkins', function(track) {
var count = checkins_count(track);
var url = "https://opendev.org/openstack/ptgbot/src/branch/master/README.rst";
var text;
var title = "See below or click for how to check in/out";
if (count == 0) {
text = 'No check-ins';
} else {
text = count + ' check-in' + (count == 1 ? '' : 's');
title = checkins_tooltip(track) + ".\n\n" + title + '.';
}
return new Handlebars.SafeString(
'<a href="' + url + '" target="blank" class="checkins" title="'
+ title + '">' + text + '</a>'
);
});
function checkins_count(track) {
var room_checkins = checkins['#' + track];
return room_checkins ? Object.keys(room_checkins).length : 0;
}
function checkins_tooltip(track) {
var room_checkins = checkins['#' + track];
if (room_checkins) {


Loading…
Cancel
Save