Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
A
ap-12_django
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Давид Ли
ap-12_django
Commits
ded8da55
Commit
ded8da55
authored
Jan 18, 2024
by
Давид Ли
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
web 26
parent
a83f5c88
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
19 deletions
+21
-19
article_form.html
ap_12/templates/partial/article_form.html
+21
-19
No files found.
ap_12/templates/partial/article_form.html
View file @
ded8da55
{% 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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment