Commit c4acd81f authored by Curtis Adam's avatar Curtis Adam

Show an appropriate tooltip for the connection indicator

parent 744a8e09
......@@ -1803,8 +1803,9 @@
"connection": {
"title": "Um 🍅__lastAppTitle__ online nutzen zu können, ist eine WebSocket-Verbindung zum Server erforderlich.",
"webSocket": "WebSocket-Check",
"connected": "okay",
"disconnected": "keine Verbindung"
"connected": "Good server connection",
"connecting": "Critical server connection",
"disconnected": "No server connection"
},
"admin": {
"allLearnedCardsets": "Nach dem Leitner-Plan gelernte Karten über alle Karteien",
......
......@@ -1804,8 +1804,9 @@
"connection": {
"title": "Um 🍅__lastAppTitle__ online nutzen zu können, ist eine WebSocket-Verbindung zum Server erforderlich.",
"webSocket": "WebSocket-Check",
"connected": "okay",
"disconnected": "keine Verbindung"
"connected": "Gute Serveranbindung",
"connecting": "Kritische Serververbindung",
"disconnected": "Keine Serververbindung"
},
"admin": {
"allLearnedCardsets": "Nach dem Leitner-Plan gelernte Karten über alle Karteien",
......
......@@ -636,6 +636,17 @@ Template.registerHelper("getSignal", function () {
}
});
Template.registerHelper("getSignalTooltip", function () {
switch (Session.get('connectionStatus')) {
case (0):
return TAPi18n.__('connection.disconnected');
case (1):
return TAPi18n.__('connection.connected');
case (2):
return TAPi18n.__('connection.connecting');
}
});
Template.registerHelper("isShuffledCardset", function (cardset_id) {
if (cardset_id !== undefined) {
let cardset = Cardsets.findOne({_id: cardset_id}, {fields: {shuffled: 1}});
......
<template name="mainNavigationTopItemConnectionStatus">
<li class="{{getVisibility}} connection-status">
<i class="fa fa-circle {{getSignal}}"></i>
<i class="fa fa-circle {{getSignal}}" title="{{getSignalTooltip}}"></i>
</li>
</template>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment