mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-04 20:40:14 +03:00
Added child template for file inputs to get rid of outer white box
This commit is contained in:
parent
dbb435ca31
commit
70cf08a0a2
|
@ -375,7 +375,7 @@ class HTMLFormRenderer(BaseRenderer):
|
|||
'input_type': 'time'
|
||||
},
|
||||
serializers.FileField: {
|
||||
'base_template': 'input.html',
|
||||
'base_template': 'file_input.html',
|
||||
'input_type': 'file'
|
||||
},
|
||||
serializers.BooleanField: {
|
||||
|
|
|
@ -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