Skip to content
Permalink
Browse files

merge class:form-control with form_attrs

  • Loading branch information...
wardi committed Jan 22, 2019
1 parent 7e5a316 commit c59b1b8013f27900cf0fb2c85d8b0c46c9a0239b
@@ -9,8 +9,7 @@
"validators": "if_empty_same_as(name) unicode",
"form_snippet": "large_text.html",
"form_attrs": {
"data-module": "slug-preview-target",
"class": "form-control"
"data-module": "slug-preview-target"
}
}
},
@@ -8,7 +8,7 @@
value=data.get(field.field_name, '').split()[0],
error=errors[field.field_name],
classes=['control-medium'],
attrs=field.form_attrs if 'form_attrs' in field else {"class": "form-control"},
attrs=dict({"class": "form-control"}, **(field.get('form_attrs', {}))),
is_required=h.scheming_field_required(field)
)
%}
@@ -19,7 +19,7 @@
value=date,
error=errors[field.field_name + '_date'],
classes=['control-medium'],
attrs=field.form_attrs if 'form_attrs' in field else {"class": "form-control"},
attrs=dict({"class": "form-control"}, **(field.get('form_attrs', {}))),
is_required=h.scheming_field_required(field)
)
%}
@@ -34,7 +34,7 @@
value=time,
error=errors[field.field_name + '_time'],
classes=['control-medium'],
attrs=field.form_attrs if 'form_attrs' in field else {"class": "form-control"},
attrs=dict({"class": "form-control"}, **(field.get('form_attrs', {}))),
is_required=h.scheming_field_required(field)
)
%}
@@ -24,7 +24,7 @@
value=date,
error=errors[field.field_name + '_date'],
classes=['control-medium'],
attrs=field.form_attrs if 'form_attrs' in field else {"class": "form-control"},
attrs=dict({"class": "form-control"}, **(field.get('form_attrs', {}))),
is_required=h.scheming_field_required(field)
)
%}
@@ -39,7 +39,7 @@
value=time,
error=errors[field.field_name + '_time'],
classes=['control-medium'],
attrs=field.form_attrs if 'form_attrs' in field else {"class": "form-control"},
attrs=dict({"class": "form-control"}, **(field.get('form_attrs', {}))),
is_required=h.scheming_field_required(field)
)
%}
@@ -55,7 +55,7 @@
selected=tz,
error=errors[field.field_name + '_tz'],
classes=['control-medium'],
attrs=field.form_attrs if 'form_attrs' in field else {"class": "form-control"},
attrs=dict({"class": "form-control"}, **(field.get('form_attrs', {}))),
is_required=h.scheming_field_required(field)
)
%}
@@ -7,7 +7,7 @@
placeholder=h.scheming_language_text(field.form_placeholder),
value=h.scheming_display_json_value(data[field.field_name], indent=field.get('indent', 2)),
error=errors[field.field_name],
attrs=field.form_attrs or {"class": "form-control"},
attrs=dict({"class": "form-control"}, **(field.get('form_attrs', {}))),
is_required=h.scheming_field_required(field),
)
%}
@@ -8,7 +8,7 @@
value=data[field.field_name],
error=errors[field.field_name],
classes=['control-full', 'control-large'],
attrs=field.form_attrs if 'form_attrs' in field else {"class": "form-control"},
attrs=dict({"class": "form-control"}, **(field.get('form_attrs', {}))),
is_required=h.scheming_field_required(field)
)
%}
@@ -7,7 +7,7 @@
placeholder=h.scheming_language_text(field.form_placeholder),
value=data[field.field_name],
error=errors[field.field_name],
attrs=field.form_attrs or {"class": "form-control"},
attrs=dict({"class": "form-control"}, **(field.get('form_attrs', {}))),
is_required=h.scheming_field_required(field)
)
%}
@@ -25,7 +25,8 @@
style="display: block"
id="field-{{ field.field_name }}"
name="{{ field.field_name }}"
{{ form.attributes(field.get('form_select_attrs', {})) }}>
{{ form.attributes(dict(
{"class": "form-control"}, **field.get('form_select_attrs', {}))) }}>
{%- for val, label in choices -%}
<option id="field-{{ field.field_name }}-{{ val }}"
value="{{ val }}"
@@ -25,7 +25,7 @@
selected=data[field.field_name],
error=errors[field.field_name],
classes=['control-medium'],
attrs=field.form_attrs if 'form_attrs' in field else {"class": "form-control"},
attrs=dict({"class": "form-control"}, **(field.get('form_attrs', {}))),
is_required=h.scheming_field_required(field)
)
%}
@@ -8,7 +8,7 @@
value=data[field.field_name],
error=errors[field.field_name],
classes=field.classes if 'classes' in field else ['control-medium'],
attrs=field.form_attrs if 'form_attrs' in field else {"class": "form-control"},
attrs=dict({"class": "form-control"}, **(field.get('form_attrs', {}))),
is_required=h.scheming_field_required(field)
)
%}
@@ -7,7 +7,7 @@
placeholder=h.scheming_language_text(field.form_placeholder),
value=data[field.field_name],
error=errors[field.field_name],
attrs=field.form_attrs or {"class": "form-control"},
attrs=dict({"class": "form-control"}, **(field.get('form_attrs', {}))),
is_required=h.scheming_field_required(field),
)
%}

0 comments on commit c59b1b8

Please sign in to comment.
You can’t perform that action at this time.