Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
{% extends "index.html" %}
{% block title %}Contacts{% endblock %}
{% block content %}
{% if contacts %}
<p>There are {{ contacts | length }} contacts in the database.</p>
{% if contacts|length > 0 %}
<table role="grid">
<th>First Name</th>
<th>Last Name</th>
<th>Work Phone</th>
<th>Home Phone</th>
<th>Mobile Phone</th>
<th>MongoDB ID</th>
{% for contact in contacts %}
<td>{{ contact['first_name'] }}</td>
<td>{{ contact['last_name'] }}</td>
<td>{{ contact['birthday'] }}</td>
<td>{{ contact['email'] }}</td>
<td>{{ contact['website'] }}</td>
<td>{{ contact['work_phone'] }}</td>
<td>{{ contact['home_phone'] }}</td>
<td>{{ contact['mobile_phone'] }}</td>
<td>{{ contact['_id'] }}</td>
{% endfor %}
{% endif %}
{% else %}
<p>No contacts in the database.</p>
{% endif %}
{% endblock %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.