chore: move core/templates into templates/, remove unused and deprecate macro (#3804)
This commit is contained in:
@@ -1,3 +0,0 @@
|
|||||||
{% extends "base.html" %} {% from "macros.jinja" import window_vars with context
|
|
||||||
%} {% block scripts %} {{ window_vars(user) }} {% endblock %} {% block page %}{%
|
|
||||||
endblock %}
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
{% extends "public.html" %} {% from "macros.jinja" import window_vars with
|
|
||||||
context %} {% block scripts %} {{ window_vars() }} {% endblock %} {% block page
|
|
||||||
%} {% endblock %}
|
|
||||||
@@ -200,7 +200,7 @@ async def index(
|
|||||||
) -> HTMLResponse:
|
) -> HTMLResponse:
|
||||||
return template_renderer().TemplateResponse(
|
return template_renderer().TemplateResponse(
|
||||||
request,
|
request,
|
||||||
"index.html",
|
"base.html",
|
||||||
{
|
{
|
||||||
"user": user.json(),
|
"user": user.json(),
|
||||||
},
|
},
|
||||||
@@ -211,7 +211,7 @@ async def index(
|
|||||||
@generic_router.get("/node/public")
|
@generic_router.get("/node/public")
|
||||||
@generic_router.get("/first_install", dependencies=[Depends(check_first_install)])
|
@generic_router.get("/first_install", dependencies=[Depends(check_first_install)])
|
||||||
async def index_public(request: Request) -> HTMLResponse:
|
async def index_public(request: Request) -> HTMLResponse:
|
||||||
return template_renderer().TemplateResponse(request, "index.html", {"public": True})
|
return template_renderer().TemplateResponse(request, "base.html", {"public": True})
|
||||||
|
|
||||||
|
|
||||||
@generic_router.get("/uuidv4/{hex_value}")
|
@generic_router.get("/uuidv4/{hex_value}")
|
||||||
|
|||||||
@@ -55,7 +55,6 @@ def static_url_for(static: str, path: str) -> str:
|
|||||||
def template_renderer(additional_folders: list | None = None) -> Jinja2Templates:
|
def template_renderer(additional_folders: list | None = None) -> Jinja2Templates:
|
||||||
folders = [
|
folders = [
|
||||||
"lnbits/templates",
|
"lnbits/templates",
|
||||||
"lnbits/core/templates",
|
|
||||||
settings.extension_builder_working_dir_path.as_posix(),
|
settings.extension_builder_working_dir_path.as_posix(),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@@ -90,6 +90,9 @@
|
|||||||
{% if not public %}
|
{% if not public %}
|
||||||
window.g.isPublicPage = false
|
window.g.isPublicPage = false
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
window.app = Vue.createApp({
|
||||||
|
el: '#vue',
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<!-- scripts from extensions -->
|
<!-- scripts from extensions -->
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
{% extends "public.html" %} {% from "macros.jinja" import window_vars with
|
{% extends "base.html" %} {% block page_container %}
|
||||||
context %} {% block scripts %} {{ window_vars() }} {% endblock %} {% block
|
|
||||||
page_container %}
|
|
||||||
<lnbits-error
|
<lnbits-error
|
||||||
code="{{ status_code | safe }}"
|
code="{{ status_code | safe }}"
|
||||||
message="{{ message | safe }}"
|
message="{{ message | safe }}"
|
||||||
|
|||||||
@@ -1,9 +1,5 @@
|
|||||||
{% macro window_vars(user) -%}
|
{% macro window_vars(user) -%}
|
||||||
<script>
|
<script>
|
||||||
//Needed for Vue to create the app on first load (although called on every page, its only loaded once)
|
// deprecated dont use window_vars anymore
|
||||||
window.app = Vue.createApp({
|
|
||||||
el: '#vue',
|
|
||||||
mixins: [window.windowMixin]
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
{%- endmacro %}
|
{%- endmacro %}
|
||||||
|
|||||||
Reference in New Issue
Block a user