Created template

This commit is contained in:
Pierre HUBERT 2021-04-10 19:42:03 +02:00
parent b99c1e4a7f
commit 5373eac5df
6 changed files with 99 additions and 0 deletions

View File

@ -0,0 +1,5 @@
/**
* Notifications settings
*
* @author Pierre Hubert
*/

View File

@ -92,6 +92,20 @@ ComunicWeb.pages.settings.navigationPane = {
openPage("settings/emojies"); openPage("settings/emojies");
}; };
// Custom emojies
const sectionNotifications = createElem2({
appendTo: elemList,
type: "li",
});
var sectionNotificationsLink = createElem2({
appendTo: sectionNotifications,
type: "a",
innerHTML: "<i class='fa fa-bell-o'></i> Notifications"
});
sectionNotificationsLink.onclick = function(){
openPage("settings/notifications");
};
//Account security //Account security
var sectionSecurity = createElem2({ var sectionSecurity = createElem2({
appendTo: elemList, appendTo: elemList,

View File

@ -0,0 +1,22 @@
/**
* Notifications settings
*
* @author Pierre Hubert
*/
class NotificationsSettings {
static async Open(args, target) {
// Load template
const tpl = await Page.loadHTMLTemplate("pages/settings/notifications/NotificationsSection.html");
const el = document.createElement("div")
el.innerHTML = tpl;
target.appendChild(el);
el.querySelectorAll("input[type='checkbox']").forEach(e => {
$(e).iCheck({
checkboxClass: 'icheckbox_flat-blue',
radioClass: 'iradio_flat-blue'
});
});
}
}

View File

@ -30,6 +30,14 @@ ComunicWeb.pages.settings.sectionsList = {
handler: "EmojiesSection.Open" handler: "EmojiesSection.Open"
}, },
/**
* Notifications
*/
notifications: {
title: "Notifications",
handler: "NotificationsSettings.Open"
},
/** /**
* Security settings * Security settings
*/ */

View File

@ -0,0 +1,48 @@
<!-- Notifications section -->
<!-- Web app section -->
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">tr("Web application")</h3>
</div>
<!-- /.box-header -->
<!-- form start -->
<div class="box-body">
<div class="form-group">
<label>
<input type="checkbox"> tr("Allow sound for notifications")
</label>
</div>
</div>
<!-- /.box-body -->
<div class="box-footer">
<button type="submit" class="btn btn-primary">tr("Update")</button>
</div>
</div>
<!-- Push notifications section -->
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">tr("Push notifications")</h3>
</div>
<!-- /.box-header -->
<!-- form start -->
<div class="box-body">
<p>tr("Note: These parameters applies only for the mobile version of the application!")</p>
<div class="form-group">
<label>
<input type="checkbox"> tr("Allow conversation notifications")
</label>
</div>
</div>
<!-- /.box-body -->
<div class="box-footer">
<button type="submit" class="btn btn-primary">tr("Update")</button>
</div>
</div>

View File

@ -287,6 +287,7 @@ class Dev {
"css/pages/settings/sections/customEmojis.css", "css/pages/settings/sections/customEmojis.css",
"css/pages/settings/sections/security.css", "css/pages/settings/sections/security.css",
"css/pages/settings/sections/password.css", "css/pages/settings/sections/password.css",
"css/pages/settings/sections/notifications.css",
"css/pages/settings/sections/globalLogout.css", "css/pages/settings/sections/globalLogout.css",
"css/pages/settings/sections/accountImage.css", "css/pages/settings/sections/accountImage.css",
"css/pages/settings/sections/privacy.css", "css/pages/settings/sections/privacy.css",
@ -557,6 +558,7 @@ class Dev {
"js/pages/settings/sections/language.js", "js/pages/settings/sections/language.js",
"js/pages/settings/sections/emojis.js", "js/pages/settings/sections/emojis.js",
"js/pages/settings/sections/security.js", "js/pages/settings/sections/security.js",
"js/pages/settings/sections/notifications.js",
"js/pages/settings/sections/password.js", "js/pages/settings/sections/password.js",
"js/pages/settings/sections/globalLogout.js", "js/pages/settings/sections/globalLogout.js",
"js/pages/settings/sections/accountImage.js", "js/pages/settings/sections/accountImage.js",