rendering of navbar through default.volt

Started by mihak, April 21, 2021, 07:51:57 PM

Previous topic - Next topic
April 21, 2021, 07:51:57 PM Last Edit: April 21, 2021, 07:53:57 PM by mihak
Help me understand how does the rendering of navbar header work...


- I created a <span> entry as a last <li> item within <header> of mvc/app/views/layouts/default.volt:

<li><span class="navbar-text" id="theme_toggle">toggle</span></li>


This <span> appears very inconsistently - it is visible on some pages (License, Reporting, Firewall) but missing on others (Dashboard, System, Interfaces). You can see the screenshots of the top right corner on the License page and on the dashboard below - one has a "toggle" addition, the other one doesn't...


Perhaps default.volt is not the right place to add modifications to the Navbar?


Rendered with a toggle: https://i.imgur.com/gqS6zZ3.png
Rendered without it: https://i.imgur.com/EAKEUwk.png






The static pages like the dashboard have a separate file for this. See this example commit to both:

https://github.com/opnsense/core/commit/6d0bb082f0

Barely caught this info from the cropped screenshot... Make sure to give all the relevant information in an obvious fashion to avoid non-responses.


Cheers,
Franco

oh wow, and we need to maintain consistency between both fbegin.inc and default.volt?
If I would add a theme toggle (dark/light) there, how should I implement it to persist upgrades?