I have a node js application which handles all the client requests. I created the views using the express handlebars plugin. So I have a main layout and several views and partials. The main layout receives the views in the body and shows the complete web page.
The partial vinav.handlebars is the navigation bar included in the main layout. It shows a navigation bar with "Login", "Register", ("Logout" if logged) and "Dashboard". The Dashboard page is always shown even if the user is not logged in.
So, for example, if the user clicks "Login" the server gets the /users/login command and sends back the login handlebars view which will be inserted in the {{{body}}} of the main layout.
Now I want to show the login page as a Bootstrap 4 popup in the main layout, I mean, leaving the Dashboard page intact (it must be always shown). I spent the whole day trying to find a way to show and handle the popup but I was not able to find a solution.
I know handlebars is logic-less, so I can't add pure javascript. I also know it has helpers, but I can't figure out how to handle this with an helper.
The popup for the login could be something like this (and another similar for Register):
I have a node js application which handles all the client requests. I created the views using the express handlebars plugin. So I have a main layout and several views and partials. The main layout receives the views in the body and shows the complete web page.
mainlayout.handlebar
The partial vinav.handlebars is the navigation bar included in the main layout. It shows a navigation bar with "Login", "Register", ("Logout" if logged) and "Dashboard". The Dashboard page is always shown even if the user is not logged in.
vinav.handlebars
So, for example, if the user clicks "Login" the server gets the /users/login command and sends back the login handlebars view which will be inserted in the {{{body}}} of the main layout.
login.handlebars
The same for Register. Everything works fine.
Now I want to show the login page as a Bootstrap 4 popup in the main layout, I mean, leaving the Dashboard page intact (it must be always shown). I spent the whole day trying to find a way to show and handle the popup but I was not able to find a solution.
I know handlebars is logic-less, so I can't add pure javascript. I also know it has helpers, but I can't figure out how to handle this with an helper.
The popup for the login could be something like this (and another similar for Register):
loginpopup.handlebars
Any idea? Can someone helpme?
Thanks Roberto