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>
|
<tr>
|
||||||
<td class="col-sm-1">{{trackbadge track}}</span></td>
|
<td class="col-sm-1">{{trackbadge track}}</span></td>
|
||||||
<td>{{#trackContentLine}}{{lookup @root.now track}}{{/trackContentLine}}</td>
|
<td>{{#trackContentLine}}{{lookup @root.now track}}{{/trackContentLine}}</td>
|
||||||
<td>{{lookup @root.location track}}</td>
|
<td>{{lookup @root.location track}}
|
||||||
<td>{{checkins track}}</td>
|
{{#if (checkins track)}}
|
||||||
|
<a href="#" title="{{checkedin track}}">
|
||||||
|
<span class="badge">{{checkins track}}</span>
|
||||||
|
</a>
|
||||||
|
{{/if}}
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{else}}
|
{{else}}
|
||||||
|
18
html/ptg.js
18
html/ptg.js
@ -33,20 +33,10 @@ Handlebars.registerHelper('roomactive',
|
|||||||
});
|
});
|
||||||
|
|
||||||
Handlebars.registerHelper('checkins', function(track) {
|
Handlebars.registerHelper('checkins', function(track) {
|
||||||
var count = checkins_count(track);
|
return checkins_count(track);
|
||||||
var url = "https://opendev.org/openstack/ptgbot/src/branch/master/README.rst";
|
});
|
||||||
var text;
|
Handlebars.registerHelper('checkedin', function(track) {
|
||||||
var title = "See below or click for how to check in/out";
|
return checkins_tooltip(track);
|
||||||
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) {
|
function checkins_count(track) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user