Skip to content

Instantly share code, notes, and snippets.

@aliceridgway
Created October 23, 2021 15:22
Show Gist options
  • Save aliceridgway/21fceecfab2b4a3ca11a094b2ca1f03b to your computer and use it in GitHub Desktop.
Save aliceridgway/21fceecfab2b4a3ca11a094b2ca1f03b to your computer and use it in GitHub Desktop.
Django Todo App - index.html - no links
{% extends 'base.html' %}
{% block content %}
<div class="jumbotron">
<div class="container">
<h1>My To Do List</h1>
<p>{{todos|length}} items</p>
<button type="button" class="btn btn-primary">Add New</button>
</div>
</div>
<div class="container">
<div>
{% if todos %}
{% for todo in todos %}
<div class="card m-2 p-2 flex-row justify-content-between">
<div>
<h4>{{ todo.title }}</h4>
<small> {{todo.notes}}</small>
</div>
<div>
<button type="button" class="btn btn-outline-secondary">Edit</button>
<button type="button" class="btn btn-outline-success">Mark Complete</button>
</div>
</div>
{% endfor %}
{% else %}
<p>There's nothing on the list!</p>
{% endif %}
</div>
</div>
{% endblock %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment