',
$.confirm({
title: 'Authentification requise',
content: content,
@@ -102,14 +102,39 @@ function requestAuth(data, callback, focus_next = null) {
},
onOpen: function() {
var that = this;
+ var capslock = -1 ; // 1 -> caps on ; 0 -> caps off ; -1 or 2 -> unknown
this.$content.find('input').on('keypress', function(e) {
if (e.keyCode == 13)
that.$confirmButton.click();
+
+ var s = String.fromCharCode(e.which);
+ if ((s.toUpperCase() === s && s.toLowerCase() !== s && !e.shiftKey)|| //caps on, shift off
+ (s.toUpperCase() !== s && s.toLowerCase() === s && e.shiftKey)) { //caps on, shift on
+ capslock = 1 ;
+ } else if ((s.toLowerCase() === s && s.toUpperCase() !== s && !e.shiftKey)|| //caps off, shift off
+ (s.toLowerCase() !== s && s.toUpperCase() === s && e.shiftKey)) { //caps off, shift on
+ capslock = 0 ;
+ }
+ if (capslock == 1)
+ $('.capslock .glyphicon').show() ;
+ else if (capslock == 0)
+ $('.capslock .glyphicon').hide() ;
+ });
+ // Capslock key is not detected by keypress
+ this.$content.find('input').on('keydown', function(e) {
+ if (e.which == 20) {
+ capslock = 1-capslock ;
+ }
+ if (capslock == 1)
+ $('.capslock .glyphicon').show() ;
+ else if (capslock == 0)
+ $('.capslock .glyphicon').hide() ;
});
},
onClose: function() {
if (focus_next)
this._lastFocused = focus_next;
}
+
});
}
diff --git a/kfet/templates/kfet/kpsul.html b/kfet/templates/kfet/kpsul.html
index 402bc895..c6cffc69 100644
--- a/kfet/templates/kfet/kpsul.html
+++ b/kfet/templates/kfet/kpsul.html
@@ -114,10 +114,10 @@
-
-
-
-
+
+
+
+
diff --git a/kfet/views.py b/kfet/views.py
index f95fb2c6..7083d489 100644
--- a/kfet/views.py
+++ b/kfet/views.py
@@ -490,7 +490,8 @@ class AccountGroupUpdate(UpdateView):
class AccountNegativeList(ListView):
queryset = (AccountNegative.objects
- .select_related('account', 'account__cofprofile__user'))
+ .select_related('account', 'account__cofprofile__user')
+ .exclude(account__trigramme='#13'))
template_name = 'kfet/account_negative.html'
context_object_name = 'negatives'
@@ -501,12 +502,13 @@ class AccountNegativeList(ListView):
'overdraft_duration': Settings.OVERDRAFT_DURATION(),
}
negs_sum = (AccountNegative.objects
+ .exclude(account__trigramme='#13')
.aggregate(
bal = Coalesce(Sum('account__balance'),0),
offset = Coalesce(Sum('balance_offset'),0),
)
)
- context['negatives_sum'] = negs_sum['bal'] + negs_sum['offset']
+ context['negatives_sum'] = negs_sum['bal'] - negs_sum['offset']
return context
# -----