Add user language in settings, use that field as language for UI
This commit is contained in:
parent
e74916d395
commit
fb3ac68cc0
7 changed files with 80 additions and 47 deletions
|
@ -27,6 +27,7 @@
|
|||
{{include file="field_input.tpl" field=$email}}
|
||||
{{include file="field_password.tpl" field=$password4}}
|
||||
{{include file="field_custom.tpl" field=$timezone}}
|
||||
{{include file="field_select.tpl" field=$language}}
|
||||
{{include file="field_input.tpl" field=$defloc}}
|
||||
{{include file="field_checkbox.tpl" field=$allowloc}}
|
||||
|
||||
|
@ -147,7 +148,7 @@
|
|||
(function(){
|
||||
var elm = $("#id_{{$desktop_notifications.0}}_onoff");
|
||||
var ckbox = $("#id_{{$desktop_notifications.0}}");
|
||||
|
||||
|
||||
if (getNotificationPermission() === 'granted') {
|
||||
ckbox.val(1);
|
||||
elm.find(".off").addClass("hidden");
|
||||
|
@ -156,18 +157,18 @@
|
|||
if (getNotificationPermission() === null) {
|
||||
elm.parent(".field.yesno").hide();
|
||||
}
|
||||
|
||||
|
||||
$("#id_{{$desktop_notifications.0}}_onoff").on("click", function(e){
|
||||
|
||||
|
||||
if (Notification.permission === 'granted') {
|
||||
localStorage.setItem('notification-permissions', ckbox.val()==1 ? 'granted' : 'denied');
|
||||
} else if (Notification.permission === 'denied') {
|
||||
localStorage.setItem('notification-permissions', 'denied');
|
||||
|
||||
|
||||
ckbox.val(0);
|
||||
elm.find(".on").addClass("hidden");
|
||||
elm.find(".off").removeClass("hidden");
|
||||
|
||||
|
||||
} else if (Notification.permission === 'default') {
|
||||
Notification.requestPermission(function(choice) {
|
||||
if (choice === 'granted') {
|
||||
|
@ -181,10 +182,10 @@
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
//console.log(getNotificationPermission());
|
||||
|
||||
|
||||
|
||||
|
||||
})
|
||||
})();
|
||||
</script>
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
{{include file="field_input.tpl" field=$email}}
|
||||
{{include file="field_password.tpl" field=$password4}}
|
||||
{{include file="field_custom.tpl" field=$timezone}}
|
||||
{{include file="field_select.tpl" field=$language}}
|
||||
{{include file="field_input.tpl" field=$defloc}}
|
||||
{{include file="field_checkbox.tpl" field=$allowloc}}
|
||||
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
{{include file="field_input.tpl" field=$email}}
|
||||
{{include file="field_password.tpl" field=$password4}}
|
||||
{{include file="field_custom.tpl" field=$timezone}}
|
||||
{{include file="field_select.tpl" field=$language}}
|
||||
{{include file="field_input.tpl" field=$defloc}}
|
||||
{{include file="field_checkbox.tpl" field=$allowloc}}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue