summaryrefslogtreecommitdiff
path: root/app/templates/modules/customers.html
blob: 776ab8df0b07cf574d8355001785ababc57f2b5b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
{# -*- mode: web; -*- #}

{% extends "base.html" %}
{% block title %}
Customers
{% endblock %}

{% block actions %}
<li><a href="{{ url_for('common.add_item', module='customers', table='Customer' ) }}" class="button">Add customer</a></li>
{% endblock %}

{% block content %}

<table>
    <thead>
	<tr>
	    <th></th>
	    <th>ID</th>
	    <th>Name</th>
	    <th>City</th>
	    <th>Phone</th>
	    <th>E-mail</th>
	</tr>
    </thead>
    <tbody>
	{% for customer in customers %}
	<tr>
	    <td>
		<form method="post" action="{{ url_for('common.edit_item', module='customers', pk=customer.primary_key, table='Customer') }}">
		    <button>edit</button>
		</form>
		<form method="post" action="{{ url_for('common.delete_item', module='customers', pk=customer.primary_key, table='Customer') }}">
		    <button>delete</button>
		</form>
	    </td>
	    <td>{{ customer.primary_key }}</td>
	    {% if customer.website %}
	    <td><a href="{{ 'http://' + customer.website }}">{{ customer.name }}</a></td>
	    {% else %}
	    <td>{{ customer.name }}</td>
	    {% endif %}
	    <td>{{ customer.city }}</td>
	    <td>{{ customer.phone }}</td>
	    {% if customer.email %}
	    <td><a href="mailto:{{ customer.email }}">{{ customer.email }}</a></td>
	    {% else %}
	    <td></td>
	    {% endif %}
	</tr>
	{% endfor %}
    </tbody>
</table>
{% endblock %}
Copyright 2019--2024 Marius PETER