mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-04 20:40:14 +03:00
Merge f7704b8652
into 2444e6a793
This commit is contained in:
commit
47aefdf68a
|
@ -374,6 +374,10 @@ class HTMLFormRenderer(BaseRenderer):
|
|||
'base_template': 'input.html',
|
||||
'input_type': 'time'
|
||||
},
|
||||
serializers.FileField: {
|
||||
'base_template': 'file_input.html',
|
||||
'input_type': 'file'
|
||||
},
|
||||
serializers.BooleanField: {
|
||||
'base_template': 'checkbox.html'
|
||||
},
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
{% extends "rest_framework/horizontal/input.html" %}
|
||||
|
||||
{% block input %}
|
||||
<input name="{{ field.name }}" type="{{ style.input_type }}" {% if style.placeholder %}placeholder="{{ style.placeholder }}"{% endif %} {% if field.value %}value="{{ field.value }}"{% endif %}>
|
||||
{% endblock %}
|
|
@ -3,7 +3,9 @@
|
|||
<label class="col-sm-2 control-label {% if style.hide_label %}sr-only{% endif %}">{{ field.label }}</label>
|
||||
{% endif %}
|
||||
<div class="col-sm-10">
|
||||
{% block input %}
|
||||
<input name="{{ field.name }}" class="form-control" type="{{ style.input_type }}" {% if style.placeholder %}placeholder="{{ style.placeholder }}"{% endif %} {% if field.value %}value="{{ field.value }}"{% endif %}>
|
||||
{% endblock %}
|
||||
{% if field.errors %}
|
||||
{% for error in field.errors %}<span class="help-block">{{ error }}</span>{% endfor %}
|
||||
{% endif %}
|
||||
|
|
Loading…
Reference in New Issue
Block a user