View raw

1 {# -*- mode: web; -*- #} 2 3 {% extends "base.html" %} 4 {% block title %} 5 Customers 6 {% endblock %} 7 8 {% block actions %} 9 <li><a href="{{ url_for('common.add_item', module='customers', table='Customer' ) }}" class="button">Add customer</a></li> 10 {% endblock %} 11 12 {% block content %} 13 14 <table> 15 <thead> 16 <tr> 17 <th></th> 18 <th>ID</th> 19 <th>Name</th> 20 <th>City</th> 21 <th>Phone</th> 22 <th>E-mail</th> 23 </tr> 24 </thead> 25 <tbody> 26 {% for customer in customers %} 27 <tr> 28 <td> 29 <form method="post" action="{{ url_for('common.edit_item', module='customers', pk=customer.primary_key, table='Customer') }}"> 30 <button>edit</button> 31 </form> 32 <form method="post" action="{{ url_for('common.delete_item', module='customers', pk=customer.primary_key, table='Customer') }}"> 33 <button>delete</button> 34 </form> 35 </td> 36 <td>{{ customer.primary_key }}</td> 37 {% if customer.website %} 38 <td><a href="{{ 'http://' + customer.website }}">{{ customer.name }}</a></td> 39 {% else %} 40 <td>{{ customer.name }}</td> 41 {% endif %} 42 <td>{{ customer.city }}</td> 43 <td>{{ customer.phone }}</td> 44 {% if customer.email %} 45 <td><a href="mailto:{{ customer.email }}">{{ customer.email }}</a></td> 46 {% else %} 47 <td></td> 48 {% endif %} 49 </tr> 50 {% endfor %} 51 </tbody> 52 </table> 53 {% endblock %} 54