From 07ebb1bc60460d1b07d8e69e1cfc871991a4187b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= Date: Mon, 12 Nov 2018 18:51:08 +0100 Subject: [PATCH] feature: add notifications --- src/dependencies.pug | 4 ++-- src/header.pug | 7 +++++-- src/index.pug | 1 + src/page-notifications.pug | 7 +++++++ src/scripts/hd-widgets.js | 3 --- src/styles/main.scss | 19 ++++++++++++++++++- www/lib/sib-chat | 2 +- www/lib/sib-router | 2 +- 8 files changed, 35 insertions(+), 10 deletions(-) create mode 100644 src/page-notifications.pug diff --git a/src/dependencies.pug b/src/dependencies.pug index 8b4f5ba..51b5905 100644 --- a/src/dependencies.pug +++ b/src/dependencies.pug @@ -31,9 +31,9 @@ link(href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,6 //- local link(rel='import', href='/lib/sib-core/sib-display.html') link(rel='import', href='/lib/sib-router/sib-router.html') -link(rel='import', href='/lib/sib-chat/sib-chat.html') +//- link(rel='import', href='/lib/sib-chat/sib-chat.html') //- cdn link(rel='import', href="https://cdn.happy-dev.fr/sib-core/sib-display.html") link(rel='import', href="https://cdn.happy-dev.fr/sib-router/sib-router.html") - link(rel='import', href="https://cdn.happy-dev.fr/sib-chat/sib-chat.html") \ No newline at end of file +link(rel='import', href="https://cdn.happy-dev.fr/sib-chat/sib-chat.html") \ No newline at end of file diff --git a/src/header.pug b/src/header.pug index 09a153c..55d364b 100644 --- a/src/header.pug +++ b/src/header.pug @@ -8,10 +8,13 @@ i#search-icon.icon-magnifier(aria-hidden='true') i#close-search-icon.icon-close(aria-hidden='true') -#notification +details + summary#notifications-button + #notifications + include page-notifications.pug #profile img(src="/images/user.jpg") span | Profile - span.icon-arrow-down \ No newline at end of file + span.icon-arrow-down diff --git a/src/index.pug b/src/index.pug index 55c5582..8b6f88d 100644 --- a/src/index.pug +++ b/src/index.pug @@ -6,6 +6,7 @@ html(lang="en") title HD App meta(name="viewport", content="width=device-width, initial-scale=1.0") meta(http-equiv="X-UA-Compatible", content="ie=edge") + link(rel="icon" type="image/png" href="/images/logo.png") include dependencies.pug body header#header diff --git a/src/page-notifications.pug b/src/page-notifications.pug new file mode 100644 index 0000000..eb38c1f --- /dev/null +++ b/src/page-notifications.pug @@ -0,0 +1,7 @@ +div.frame + h1 Notifications + + sib-display( + data-src=`${sdn}/notifications/` + data-fields='summary' +) \ No newline at end of file diff --git a/src/scripts/hd-widgets.js b/src/scripts/hd-widgets.js index 7f0c784..ffc98ed 100644 --- a/src/scripts/hd-widgets.js +++ b/src/scripts/hd-widgets.js @@ -119,7 +119,6 @@ document.addEventListener('WebComponentsReady', function(event) { } render() { - console.log(this.value); this.innerHTML = this.template; } } @@ -134,7 +133,6 @@ document.addEventListener('WebComponentsReady', function(event) { } render() { - console.log(this.value); this.innerHTML = this.template; } } @@ -153,7 +151,6 @@ document.addEventListener('WebComponentsReady', function(event) { } render() { - console.log(this.value); this.innerHTML = this.template; } } diff --git a/src/styles/main.scss b/src/styles/main.scss index bc832b2..c284231 100644 --- a/src/styles/main.scss +++ b/src/styles/main.scss @@ -92,9 +92,26 @@ h4 { flex: 1 1 0px; } -#notification { +#notifications-button { @include icon(bell); font-size: 1.5em; + cursor: pointer; + list-style-type: none; +} + +#notifications{ + position: absolute; + right: 0; + bottom: 0; + height: 0; + left: 0; + z-index: 1; + >div{ + position: absolute; + top: 0; + right: 0; + + } } #profile { diff --git a/www/lib/sib-chat b/www/lib/sib-chat index e34a92a..f6d3c2d 160000 --- a/www/lib/sib-chat +++ b/www/lib/sib-chat @@ -1 +1 @@ -Subproject commit e34a92abb9529af222b952302b8b25f4b1884905 +Subproject commit f6d3c2d846eabb3e3b236f218ec5878b81597967 diff --git a/www/lib/sib-router b/www/lib/sib-router index 5bd3e54..e46f24a 160000 --- a/www/lib/sib-router +++ b/www/lib/sib-router @@ -1 +1 @@ -Subproject commit 5bd3e541b92f4998af96b959a6304527824ed7f8 +Subproject commit e46f24ad020d5eeb38a40b42a0f95b9f08a88dd6