|
@@ -25,32 +25,6 @@
|
25
|
25
|
});
|
26
|
26
|
</script>
|
27
|
27
|
{% elif field.base_type == 'ref' %}
|
28
|
|
- {% set l_classes = field.allowed_classes %}
|
29
|
|
- {% set ref_objects = dict() %}
|
30
|
|
- {% for l_class in l_classes %}
|
31
|
|
- {% ref_objects.append(l_class.get()) %}
|
32
|
|
- {% if 'fullname' is in l_class.fieldnames() %}
|
33
|
|
- {% set displayfield = 'fullname' %}
|
34
|
|
- {% elif 'name' is in l_class.fieldnames() %}
|
35
|
|
- {% set displayfield = 'name' %}
|
36
|
|
- {% elif 'title' is in l_class.fieldnames() %}
|
37
|
|
- {% set displayfield = 'title' %}
|
38
|
|
- {% elif %}
|
39
|
|
- {% set displayfield = l_class.uid_fieldname()
|
40
|
|
- {% endif %}
|
41
|
|
- uidfield = l_class.uid_fieldname()
|
42
|
|
- {% endfor %}
|
43
|
|
- {% if issubclass(field.__class__, MultipleRef) %}
|
44
|
|
- <input id="{{fieldname}}" class="form-control" name="field_input_{{fieldname}}[]" type="text" value="{{sval}}" >
|
45
|
|
- $(function() {
|
46
|
|
- $('#{{fieldname}}').magicSuggest({
|
47
|
|
- data: ref_objects,
|
48
|
|
- valueField: {{ uidfield }},
|
49
|
|
- displayField: {{ displayfield }}
|
50
|
|
- });
|
51
|
|
-
|
52
|
|
- });
|
53
|
|
- {% endif %}
|
54
|
28
|
{% if value is iterable %}
|
55
|
29
|
{% set sval=value|join(',') %}
|
56
|
30
|
{% else %}
|