use first type token as default type token, thus showing the correct fields in the create form
This commit is contained in:
parent
319a7b0cb9
commit
62077c5dfb
2 changed files with 7 additions and 9 deletions
|
@ -396,6 +396,8 @@ class CreateConceptForm(CreateObjectForm):
|
|||
parentType.getChildren([subtypePred]))
|
||||
types = [dict(token=ConceptTypeInfo(t).token, title=t.title)
|
||||
for t in tconcepts]
|
||||
if self.defaultTypeToken is None and types:
|
||||
self.defaultTypeToken = types[0]['token']
|
||||
if include or include is None:
|
||||
return util.KeywordVocabulary(types + self.listTypes(include, ('hidden',)))
|
||||
return util.KeywordVocabulary(types)
|
||||
|
|
|
@ -78,7 +78,10 @@
|
|||
id="dialog_form" class="dialog"
|
||||
dojoType="dijit.form.Form"
|
||||
tal:define="qualifier request/qualifier|view/qualifier|string:resource;
|
||||
innerForm request/inner_form|view/inner_form|string:inner_form.html;
|
||||
innerForm
|
||||
request/inner_form|view/inner_form|string:inner_form.html;
|
||||
typesVocabulary python:
|
||||
view.getTypesVocabulary((qualifier,));
|
||||
typeToken view/typeToken;
|
||||
fixedType view/fixedType;
|
||||
langInfo view/languageInfo;
|
||||
|
@ -104,8 +107,7 @@
|
|||
'${view/virtualTargetUrl}/$innerForm')">
|
||||
<option value=".loops/concepts/note"
|
||||
i18n:translate=""
|
||||
tal:repeat="type python:
|
||||
view.getTypesVocabulary((qualifier,))"
|
||||
tal:repeat="type typesVocabulary"
|
||||
tal:content="type/title"
|
||||
tal:attributes="value type/token;
|
||||
selected python:type.token == typeToken">
|
||||
|
@ -115,12 +117,6 @@
|
|||
<input type="hidden" name="form.type"
|
||||
tal:condition="fixedType"
|
||||
tal:attributes="value typeToken" />
|
||||
<script type="text/javascript"
|
||||
tal:condition="not:fixedType"
|
||||
tal:content="string:replaceFieldsNode(
|
||||
'form.fields', 'form.type',
|
||||
'${view/virtualTargetUrl}/$innerForm')">
|
||||
</script>
|
||||
</th></tr></tbody>
|
||||
|
||||
<tbody><tr><td colspan="5">
|
||||
|
|
Loading…
Add table
Reference in a new issue