Commit ded8da55 authored by Давид Ли's avatar Давид Ли

web 26

parent a83f5c88
{% csrf_token %}
{% if not fields_only %}
<form action="{{ action_url }}" method="{{ request_method|default:'get' }}">
{% csrf_token %}
{% endif %}
{% for error in form.non_field_errors %}
<p class="text-danger">{{ error }}</p>
<div class="alert alert-danger">{{ error }}</div>
{% endfor %}
{% for field in form %}
<label>Title:</label><br>
<input type="text" name="title" value="{{ article.title }}">
{% for error in form.title.errors %}
<p class="text-danger">{{ error }}</p>
{% endfor %}
<br>
<div class="my-4">
{{ field.label }}
{{ field }}
</div>
{% if field.errors %}
{% for error in field.errors %}
<div class="alert alert-danger">{{ error }}</div>
{% endfor %}
<label>Text:</label><br>
<textarea name="text">{{ article.text }}</textarea><br>
{% for error in form.text.errors %}
<p class="text-danger">{{ error }}</p>
{% endfor %}
{% endif %}
<label>Author:</label><br>
<input type="text" name="author" value="{{ article.author }}"><br>
{% for error in form.author.errors %}
<p class="text-danger">{{ error }}</p>
{% endfor %}
<br>
<input type="submit" value="{{ btn_text|default:'Send' }}" class="btn btn-primary">
\ No newline at end of file
{% if not fields_only %}
<button class="btn btn-success">{{ btn_text|default:'Submit' }}</button>
</form>
{% endif %}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment