diff --git a/assets/js/dashboard.js b/assets/js/dashboard.js index 2df0eb7..dd89445 100644 --- a/assets/js/dashboard.js +++ b/assets/js/dashboard.js @@ -1 +1,14 @@ -import '../scss/dashboard.scss'; \ No newline at end of file +import '../scss/dashboard.scss'; +import Vue from "vue"; +import Toasted from "vue-toasted"; +import Notification from "../vue/Notification"; + +Vue.use(Toasted, { + iconPack: 'fontawesome' +}); + +new Vue({ + components: { Notification }, + template: "", + // router +}).$mount("#notification"); \ No newline at end of file diff --git a/assets/js/newchild.js b/assets/js/newchild.js deleted file mode 100644 index ee413a9..0000000 --- a/assets/js/newchild.js +++ /dev/null @@ -1 +0,0 @@ -import '../scss/newchild.scss' \ No newline at end of file diff --git a/assets/scss/_menu.scss b/assets/scss/_menu.scss new file mode 100644 index 0000000..07e5393 --- /dev/null +++ b/assets/scss/_menu.scss @@ -0,0 +1,25 @@ +@import "variables"; + +.center-icon { + line-height: 50px; +} + +.grey-navbar { + background-color: $navbar-grey; +} + +.passive-bell { + position: relative; + cursor: pointer; +} + +.new-notification { + position: absolute; + content: ""; + height: 5px; + width: 5px; + border-radius: 50%; + top: 18px; + right: 4px; + background-color: red; +} \ No newline at end of file diff --git a/assets/scss/_variables.scss b/assets/scss/_variables.scss index 21184b0..466c489 100644 --- a/assets/scss/_variables.scss +++ b/assets/scss/_variables.scss @@ -5,6 +5,7 @@ $card-main-grey: #E2E2E2; $card-secondary-grey: #C4C4C4; $grey-light: #ededed; $label-color: #707070; +$navbar-grey: #F2F2F2; $pure-white: #FFFFFF; diff --git a/assets/scss/dashboard.scss b/assets/scss/dashboard.scss index 3c95bba..1fd4da1 100644 --- a/assets/scss/dashboard.scss +++ b/assets/scss/dashboard.scss @@ -1,6 +1,7 @@ @import "variables"; +@import "menu"; // Usefull class to center your content in the
tag .main-full-height { - height: calc(100vh - 82px); + height: calc(100vh - 83px); } \ No newline at end of file diff --git a/assets/vue/Notification.vue b/assets/vue/Notification.vue new file mode 100644 index 0000000..608c3ec --- /dev/null +++ b/assets/vue/Notification.vue @@ -0,0 +1,37 @@ + + + + + \ No newline at end of file diff --git a/src/Entity/Notification.php b/src/Entity/Notification.php index 3ce7b2d..426b657 100644 --- a/src/Entity/Notification.php +++ b/src/Entity/Notification.php @@ -6,7 +6,7 @@ use Doctrine\ORM\Mapping as ORM; /** - * @ApiResource() + * @ApiResource(mercure="true") * @ORM\Entity(repositoryClass="App\Repository\NotificationRepository") */ class Notification diff --git a/src/Repository/NotificationRepository.php b/src/Repository/NotificationRepository.php new file mode 100644 index 0000000..4757593 --- /dev/null +++ b/src/Repository/NotificationRepository.php @@ -0,0 +1,50 @@ +createQueryBuilder('c') + ->andWhere('c.exampleField = :val') + ->setParameter('val', $value) + ->orderBy('c.id', 'ASC') + ->setMaxResults(10) + ->getQuery() + ->getResult() + ; + } + */ + + /* + public function findOneBySomeField($value): ?Notification + { + return $this->createQueryBuilder('c') + ->andWhere('c.exampleField = :val') + ->setParameter('val', $value) + ->getQuery() + ->getOneOrNullResult() + ; + } + */ +} diff --git a/templates/admin/home/index.html.twig b/templates/admin/home/index.html.twig index 2c34d96..ac93aa1 100644 --- a/templates/admin/home/index.html.twig +++ b/templates/admin/home/index.html.twig @@ -195,3 +195,7 @@ {% endblock %} + +{% block javascripts %} + {{ encore_entry_script_tags('dashboard') }} +{% endblock %} \ No newline at end of file diff --git a/templates/admin/newFood.html.twig b/templates/admin/newFood.html.twig index ccd4772..d747d19 100644 --- a/templates/admin/newFood.html.twig +++ b/templates/admin/newFood.html.twig @@ -33,4 +33,6 @@ {% endblock %} - +{% block javascripts %} + {{ encore_entry_script_tags('dashboard') }} +{% endblock %} \ No newline at end of file diff --git a/templates/admin/newMeal.html.twig b/templates/admin/newMeal.html.twig index 08b17e8..97c7856 100644 --- a/templates/admin/newMeal.html.twig +++ b/templates/admin/newMeal.html.twig @@ -20,6 +20,7 @@ {% endblock %} {% block javascripts %} + {{ encore_entry_script_tags('dashboard') }} {{ encore_entry_script_tags('newMeal') }} {% endblock %} diff --git a/templates/admin/notification/index.html.twig b/templates/admin/notification/index.html.twig index d006a8a..e9776a3 100644 --- a/templates/admin/notification/index.html.twig +++ b/templates/admin/notification/index.html.twig @@ -43,4 +43,8 @@ +{% endblock %} + +{% block javascripts %} + {{ encore_entry_script_tags('dashboard') }} {% endblock %} \ No newline at end of file diff --git a/templates/dashboard/newchild.html.twig b/templates/dashboard/newchild.html.twig index 63a3877..6ab1369 100644 --- a/templates/dashboard/newchild.html.twig +++ b/templates/dashboard/newchild.html.twig @@ -4,7 +4,6 @@ {% block stylesheets %} - {{ encore_entry_link_tags('newchild') }} {{ encore_entry_link_tags('dashboard') }} {% endblock %} @@ -47,4 +46,8 @@ +{% endblock %} + +{% block javascripts %} + {{ encore_entry_script_tags('dashboard') }} {% endblock %} \ No newline at end of file diff --git a/templates/partials/menu.html.twig b/templates/partials/menu.html.twig index 5675d98..88e5c05 100644 --- a/templates/partials/menu.html.twig +++ b/templates/partials/menu.html.twig @@ -1,27 +1,23 @@ {% block body %} -