#4: add base template; extend base template in views
This commit is contained in:
parent
fe7fce76c0
commit
b7311f2308
7 changed files with 110 additions and 62 deletions
|
|
@ -1,6 +1,12 @@
|
|||
<h2>#{{ issue.id }}: {{ issue.title }}</h2>
|
||||
<p>
|
||||
<b>Project:</b> {{ issue.project }}<br/>
|
||||
<b>Created:</b> {{ issue.create_date }}
|
||||
</p>
|
||||
<p>{{ issue.text }}</p>
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Issue: {{ issue.title }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h2>#{{ issue.id }}: {{ issue.title }}</h2>
|
||||
<p>
|
||||
<b>Project:</b> {{ issue.project }}<br/>
|
||||
<b>Created:</b> {{ issue.create_date }}
|
||||
</p>
|
||||
<p>{{ issue.text }}</p>
|
||||
{% endblock %}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,19 @@
|
|||
{% if issue_list %}
|
||||
<ul>
|
||||
{% for issue in issue_list %}
|
||||
<li>
|
||||
<a href="{% url 'issues:detail' issue.id %}">{{ issue.title }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% else %}
|
||||
<p>No issues.</p>
|
||||
{% endif %}
|
||||
{% extends "base.html" %}
|
||||
|
||||
<p><a href="{% url 'issues:new' %}">Create new issue</a></p>
|
||||
{% block title %}Issues{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% if issue_list %}
|
||||
<ul>
|
||||
{% for issue in issue_list %}
|
||||
<li>
|
||||
<a href="{% url 'issues:detail' issue.id %}">{{ issue.title }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% else %}
|
||||
<p>No issues.</p>
|
||||
{% endif %}
|
||||
|
||||
<p><a href="{% url 'issues:new' %}">Create new issue</a></p>
|
||||
{% endblock %}
|
||||
|
|
|
|||
|
|
@ -1,15 +1,21 @@
|
|||
<h2>Create new issue</h2>
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% if error_message %}<p><strong>{{ error_message }}</strong></p>{% endif %}
|
||||
{% block title %}Create issue{% endblock %}
|
||||
|
||||
<form action="{% url 'issues:new' %}" method="post">
|
||||
{% csrf_token %}
|
||||
<table>
|
||||
{{ form.as_table }}
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<input type="submit" value="Create issue" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
{% block content %}
|
||||
<h2>Create new issue</h2>
|
||||
|
||||
{% if error_message %}<p><strong>{{ error_message }}</strong></p>{% endif %}
|
||||
|
||||
<form action="{% url 'issues:new' %}" method="post">
|
||||
{% csrf_token %}
|
||||
<table>
|
||||
{{ form.as_table }}
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<input type="submit" value="Create issue" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
|
|
|||
Reference in a new issue