Browse Source

Use a badge to show check-ins in "now" display

To reduce waste of horizontal space, show check-ins as a badge
instead of a full text column.

Change-Id: Ia769d21d5402b97568bfe796bff2f11f02105dac
changes/95/658795/1
Thierry Carrez 2 years ago
parent
commit
a6e3c0bbbf
2 changed files with 11 additions and 16 deletions
  1. +7
    -2
      html/ptg.html
  2. +4
    -14
      html/ptg.js

+ 7
- 2
html/ptg.html View File

@ -40,8 +40,13 @@
<tr>
<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>
<td>{{lookup @root.location track}}
{{#if (checkins track)}}
<a href="#" title="{{checkedin track}}">
<span class="badge">{{checkins track}}</span>
</a>
{{/if}}
</td>
</tr>
{{/if}}
{{else}}


+ 4
- 14
html/ptg.js View File

@ -33,20 +33,10 @@ Handlebars.registerHelper('roomactive',
});
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>'
);
return checkins_count(track);
});
Handlebars.registerHelper('checkedin', function(track) {
return checkins_tooltip(track);
});
function checkins_count(track) {


Loading…
Cancel
Save