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
This commit is contained in:
parent
8a4910d904
commit
a6e3c0bbbf
@ -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}}
|
||||
|
18
html/ptg.js
18
html/ptg.js
@ -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…
x
Reference in New Issue
Block a user