From eeb7caee31e97e3ad2bfa748ba96ebd0563e3006 Mon Sep 17 00:00:00 2001 From: awnzl <31739165+awnzl@users.noreply.github.com> Date: Wed, 19 Feb 2025 01:23:45 +0200 Subject: [PATCH 1/3] add csv import tab and a csv file handling to form.html --- templates/uadmin/vilna/form.html | 211 +++++++++++++++++++++++++++++++ 1 file changed, 211 insertions(+) diff --git a/templates/uadmin/vilna/form.html b/templates/uadmin/vilna/form.html index 60c88cf..b004d42 100644 --- a/templates/uadmin/vilna/form.html +++ b/templates/uadmin/vilna/form.html @@ -107,6 +107,11 @@

General

  • {{.Name}}
  • {{end}} {{end}} + {{ if .Schema.CSVImporter }} +
  • + CSV Import +
  • + {{end}} {{ $MainModel := .Schema.Name }} {{ $MainModelS := .Schema.ModelName }} @@ -580,6 +585,30 @@

    General

    + {{ if .Schema.CSVImporter }} + {{ $CSVFileInfo := "A CSV file should respect the fields order of this form"}} + {{ $HasHeaders := "CSV file without headers" }} +
    +
    +
    + {{$CSVFileInfo}} +
    +
    + {{$HasHeaders}} +
    +
    + + +
    +
    + +
    +
    + {{ end }} {{ if eq .Schema.ModelID 0 }} {{ else }} {{ range $inlineIndex, $inlineSchema := .Schema.Inlines }} @@ -1352,9 +1381,191 @@ $('#' + inputID).val("delete"); }); + + + + +