✨ pgmr: Display installation stats from repo
Based on tracking data, coming full circle here.
This commit is contained in:
1 parent
4d8a6faac3
commit
6367ab8bf9
2 files changed
+10
No files matched your search
@@ -233,6 +233,7 @@
|
||||
<small data-bind="visible: homepage"><i class="fa fa-home"></i> <a data-bind="attr: {href: homepage}" target="_blank">{{ _('Homepage') }}</a></small>
|
||||
<small data-bind="visible: license"><i class="fa fa-gavel"></i> <span data-bind="text: license"></span></small>
|
||||
<small data-bind="visible: author"><i class="fa fa-user"></i> <span data-bind="text: author"></span></small>
|
||||
<small data-bind="visible: $data.stats !== undefined"><i class="fa fa-server"></i> <span data-bind="text: $data.stats !== undefined ? formatNumberK($data.stats.installations) : 0"></span></small>
|
||||
<small> </small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -621,6 +621,15 @@ function formatTemperature(temp, showF, offThreshold) {
|
||||
}
|
||||
}
|
||||
|
||||
function formatNumberK(num) {
|
||||
if (num > 1000) {
|
||||
num = num / 1000.0;
|
||||
return _.sprintf("%.2fk", num);
|
||||
} else {
|
||||
return _.sprintf("%i", num);
|
||||
}
|
||||
}
|
||||
|
||||
function pnotifyAdditionalInfo(inner) {
|
||||
return '<div class="pnotify_additional_info">'
|
||||
+ '<div class="pnotify_more"><a href="#" onclick="$(this).children().toggleClass(\'icon-caret-right icon-caret-down\').parent().parent().next().slideToggle(\'fast\')">More <i class="icon-caret-right"></i></a></div>'
|
||||
|
||||
Reference in new issue
Block a user