documents_add_update.html.tpl 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. {{ define "content" }}
  2. <div class="container">
  3. {{$update := .Options.Get "update"}}
  4. {{if $update}}
  5. {{template "breadcrumb" toSlice "Documenti" (all "Document") (.Data|string) (.Data.ID|show "Document") "Aggiorna" "current"}}
  6. {{else}}
  7. {{template "breadcrumb" toSlice "Documenti" (all "Document") "Aggiungi" "current"}}
  8. {{end}}
  9. {{template "add_update_header" dict "update" $update "addTitle" "Crea nuovo documento" "updateTitle" (printf "Aggiorna documento %s" (.Data|string))}}
  10. {{$form := "form_documents_add_update"}}
  11. <form
  12. class="needs-validation"
  13. action="{{if $update}}{{.Data.ID|update "Document"}}{{else}}{{create "Document"}}{{end}}"
  14. method="POST"
  15. role="form"
  16. id={{$form}}>
  17. {{$options := ` { name: "Name",id: "document_name",label: "Nome",placeholder: "Nome",type: "text",required: "true"} `}}
  18. {{template "input" dict "options" ($options|yaml) "value" (.Data|field "Name") "update" $update}}
  19. {{$options := ` { name: "CloudPath",id: "document_cloud_path",label: "Cartella di lavoro remota",placeholder: "Documents/",type: "text",required: "true"} `}}
  20. {{template "input" dict "options" ($options|yaml) "value" (.Data|field "CloudPath") "update" $update}}
  21. {{$options := `
  22. name: "KeepArtifacts"
  23. id: "document_keep_artifacts"
  24. label: "Mantieni gli artefatti"
  25. formClass: "form-group form-check"
  26. help: "Se selezionato carica sulla cartella remota gli artefatti derivati dalla produzione del documento (es: markdown, odt, etc.). "
  27. `}}
  28. {{template "checkbox" dict "options" ($options|yaml) "value" (.Data|field "KeepArtifacts") "update" $update}}
  29. {{$options := `
  30. name: "generator_type_id"
  31. id: "generator_type_id"
  32. label: "Tipo di generatore"
  33. title: "Seleziona il tipo di generatore"
  34. `}}
  35. {{template "select" dict "options" ($options|yaml) "data" (.Data|field "AllGeneratorTypes") "selected" (.Data|field "SelectedGeneratorType") "update" $update "form" $form}}
  36. {{ $options := ` { cancelTitle: "Annulla", saveTitle: "Salva", model: "Document"} ` }}
  37. {{template "submit_cancel_buttons" dict "options" ($options|yaml) "id" (.Data|field "ID") "update" $update}}
  38. </form>
  39. </div>
  40. {{ end }}