Skip to content

Instantly share code, notes, and snippets.

@gergob
Created January 11, 2015 21:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gergob/360c832a87d4af1cfb75 to your computer and use it in GitHub Desktop.
Save gergob/360c832a87d4af1cfb75 to your computer and use it in GitHub Desktop.
{% extends "index.html" %}
{% block title %}Contacts{% endblock %}
{% block content %}
<h2>Contacts</h2>
{% if contacts %}
<p>There are {{ contacts | length }} contacts in the database.</p>
{% if contacts|length > 0 %}
<table role="grid">
<tr>
<th>First Name</th>
<th>Last Name</th>
<th>Birthday</th>
<th>Email</th>
<th>Website</th>
<th>Work Phone</th>
<th>Home Phone</th>
<th>Mobile Phone</th>
<th>MongoDB ID</th>
</tr>
{% for contact in contacts %}
<tr>
<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>
</tr>
{% endfor %}
</table>
{% 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