code: basic create view and HX-Header integration (first htmx)

This commit is contained in:
2024-01-28 00:53:49 +01:00
parent c439220409
commit 9feb2f4ae7
10 changed files with 103 additions and 19 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
{% extends "admin/base.jinja" %}
{% extends base|none("admin/base.jinja") %}
{% macro input(name, value="", type="text") -%}
<input type="{{ type }}" name="{{ name }}" value="{{ value }}">
@@ -7,7 +7,7 @@
{% block content %}
Create {{item_model.name}} in {{item_info.name}}
<form>
<form action="{{item_model.add_url}}" method="POST">
{% set fields = item_info.display_list %}
{% for field in fields %}
<p><label>{{field}}</label>{{ input(field) }}</p>