feat: dynamic login and registering (#3604)

This commit is contained in:
dni ⚡
2025-12-04 11:50:45 +01:00
committed by GitHub
parent 73634e5161
commit 625fa6503c
11 changed files with 49 additions and 34 deletions
+15 -7
View File
@@ -33,23 +33,28 @@
<body data-theme="bitcoin">
<div id="vue">
<q-layout view="hHh lpR lfr" v-cloak>
<lnbits-disclaimer></lnbits-disclaimer>
<lnbits-disclaimer v-if="g.user && !g.isPublicPage"></lnbits-disclaimer>
<lnbits-qrcode-scanner @detect="handleScan"></lnbits-qrcode-scanner>
<lnbits-theme></lnbits-theme>
<lnbits-header></lnbits-header>
{% block drawer %}
<lnbits-drawer></lnbits-drawer>
{% endblock %} {% block page_container %}
<lnbits-drawer v-if="g.user && !g.isPublicPage"></lnbits-drawer>
{% block page_container %}
<q-page-container>
<q-page class="q-px-md q-py-lg" :class="{'q-px-lg': $q.screen.gt.xs}">
<lnbits-wallet-new></lnbits-wallet-new>
<lnbits-header-wallets></lnbits-header-wallets>
<lnbits-wallet-new
v-if="g.user && !g.isPublicPage"
></lnbits-wallet-new>
<lnbits-header-wallets
v-if="g.user && !g.isPublicPage"
></lnbits-header-wallets>
<router-view v-if="isVueRoute" :key="$route.path"></router-view>
<!-- FastAPI Content from extensions -->
<div v-else>{% block page %}{% endblock %}</div>
</q-page>
</q-page-container>
{% endblock %} {% block footer %}
{% endblock %}
<!-- Footer -->
{% block footer %}
<lnbits-footer />
{% endblock %}
</q-layout>
@@ -72,6 +77,9 @@
{% if user %}
<script>
window.g.user = LNbits.map.user(JSON.parse({{ user | tojson | safe }}));
{% if not public %}
window.g.isPublicPage = false
{% endif %}
</script>
{% endif %}
<!-- scripts from extensions -->
@@ -14,6 +14,7 @@
</q-banner>
<q-toolbar>
<q-btn
v-if="!g.isPublicPage"
dense
flat
round
+1 -14
View File
@@ -1,14 +1 @@
{% extends "base.html" %} {% block beta %}{% endblock %} {% block drawer_toggle
%}{% endblock %} {% block drawer %}{% endblock %} {% block toolbar_title %}
<a
href="/"
class="inherit q-btn q-btn-item non-selectable no-outline q-btn--flat q-btn--rectangle q-btn--actionable q-focusable q-hoverable q-btn--no-uppercase q-btn--wrap q-btn--dense q-btn--active"
style="font-size: 20px"
>
{% if USE_CUSTOM_LOGO %}
<img height="30px" alt="Logo" src="{{ USE_CUSTOM_LOGO }}" />
{%else%} {% if SITE_TITLE != 'LNbits' %} {{ SITE_TITLE }} {% else %}
<span><strong>LN</strong>bits</span>
{% endif %} {% endif %}
</a>
{% endblock %}
{% extends "base.html" %}