chore: cleanup base.html, minor issue and g.user initialisation (#3615)

Co-authored-by: Vlad Stan <stan.v.vlad@gmail.com>
This commit is contained in:
dni ⚡
2025-12-04 10:21:40 +01:00
committed by GitHub
co-authored by Vlad Stan
parent 1fe35070f4
commit 73634e5161
8 changed files with 24 additions and 25 deletions
+18 -5
View File
@@ -45,7 +45,7 @@
<lnbits-wallet-new></lnbits-wallet-new>
<lnbits-header-wallets></lnbits-header-wallets>
<router-view v-if="isVueRoute" :key="$route.path"></router-view>
<!-- FastAPI Content -->
<!-- FastAPI Content from extensions -->
<div v-else>{% block page %}{% endblock %}</div>
</q-page>
</q-page-container>
@@ -60,11 +60,24 @@
window[key] = WINDOW_SETTINGS[key]
})
</script>
{% include('components.vue') %} {% include('pages.vue') %} {% block
vue_templates %}{% endblock %} {% for url in INCLUDED_JS %}
<!-- vue templates -->
{% include('components.vue') %} {% include('pages.vue') %}
<!-- vue extension templates -->
{% block vue_templates %}{% endblock %}
<!-- scripts libraries -->
{% for url in INCLUDED_JS %}
<script src="{{ static_url_for('static', url) }}"></script>
{% endfor %} {% block scripts %}{% endblock %} {% for url in
INCLUDED_COMPONENTS %}
{% endfor %}
<!-- user init -->
{% if user %}
<script>
window.g.user = LNbits.map.user(JSON.parse({{ user | tojson | safe }}));
</script>
{% endif %}
<!-- scripts from extensions -->
{% block scripts %}{% endblock %}
<!-- components js -->
{% for url in INCLUDED_COMPONENTS %}
<script src="{{ static_url_for('static', url) }}"></script>
{% endfor %}
</body>
-5
View File
@@ -1,9 +1,4 @@
{% macro window_vars(user) -%}
<script id="window-vars-script">
{% if user %}
window.user = JSON.parse({{ user | tojson | safe }});
{% endif %}
</script>
<script>
//Needed for Vue to create the app on first load (although called on every page, its only loaded once)
window.app = Vue.createApp({