Fix Buefy "row grids" when viewing parent; add basic file upload support

This commit is contained in:
Lance Edgar 2019-05-23 16:29:29 -05:00
parent 5998941741
commit d7c8b80da5
8 changed files with 125 additions and 38 deletions

View file

@ -20,6 +20,10 @@
<b-field horizontal
label="${form.get_label(field.name)}"
## TODO: is this class="file" really needed?
% if isinstance(field.schema.typ, deform.FileData):
class="file"
% endif
% if field.error:
type="is-danger"
:message='${form.messages_json(field.error.messages())|n}'
@ -58,6 +62,28 @@
</div>
</script>
<script type="text/javascript">
let TailboneFormData = {
## TODO: ugh, this seems pretty hacky. need to declare some data models
## for various field components to bind to...
% if not form.readonly:
% for field in form.fields:
% if field in dform:
<% field = dform[field] %>
% if isinstance(field.schema.typ, colander.Date):
field_model_${field.name}: null,
% elif isinstance(field.schema.typ, deform.FileData):
field_model_${field.name}: null,
% endif
% endif
% endfor
% endif
}
</script>
<div id="tailbone-form-app">
<tailbone-form></tailbone-form>