First commit
This commit is contained in:
30
templates/web/contacts.html
Normal file
30
templates/web/contacts.html
Normal file
@ -0,0 +1,30 @@
|
||||
{% extends 'layouts/master.html' %}
|
||||
{% block title %}View{% endblock %}
|
||||
{% block body %}
|
||||
<h1>Contacts</h1>
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Name</th>
|
||||
<th scope="col">Surname</th>
|
||||
<th scope="col">E-Mail</th>
|
||||
<th scope="col">Phone</th>
|
||||
<td></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for contact in contacts %}
|
||||
<tr>
|
||||
<td>{{ contact.name }}</td>
|
||||
<td>{{ contact.surname }}</td>
|
||||
<td>{{ contact.email }}</td>
|
||||
<td>{{ contact.phone }}</td>
|
||||
<td class="text-right">
|
||||
<a class="btn btn-primary" href="{{ url_for('edit_contact', id=contact.id) }}">Edit</a>
|
||||
<a class="btn btn-danger" data-toggle="confirmation" {# data-title="¿Estas seguro?" #} href="{{ url_for('contacts_delete', id=contact.id) }}">Delete</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endblock %}
|
37
templates/web/edit_contact.html
Normal file
37
templates/web/edit_contact.html
Normal file
@ -0,0 +1,37 @@
|
||||
{% extends 'layouts/master.html' %}
|
||||
{% block title %}Edit contact{% endblock %}
|
||||
{% block body %}
|
||||
<h1>Edit contact</h1>
|
||||
<form method="post">
|
||||
{{ form.csrf_token }}
|
||||
<div class="form-group{%if form.name.errors %} has-error{% endif %}">
|
||||
{{ form.name.label }}
|
||||
{{ form.name(class='form-control', value=my_contact.name) }}
|
||||
{% for error in form.name.errors %}
|
||||
<span class="help-block">{{ error }}</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="form-group{%if form.surname.errors %} has-error{% endif %}">
|
||||
{{ form.surname.label }}
|
||||
{{ form.surname(class='form-control', value=my_contact.surname) }}
|
||||
{% for error in form.surname.errors %}
|
||||
<span class="help-block">{{ error }}</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="form-group{%if form.email.errors %} has-error{% endif %}">
|
||||
{{ form.email.label }}
|
||||
{{ form.email(class='form-control', value=my_contact.email) }}
|
||||
{% for error in form.email.errors %}
|
||||
<span class="help-block">{{ error }}</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="form-group{%if form.phone.errors %} has-error{% endif %}">
|
||||
{{ form.phone.label }}
|
||||
{{ form.phone(class='form-control', value=my_contact.phone) }}
|
||||
{% for error in form.phone.errors %}
|
||||
<span class="help-block">{{ error }}</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<input type="submit" class="btn btn-success" value="Save">
|
||||
</form>
|
||||
{% endblock %}
|
20
templates/web/new_contact.html
Normal file
20
templates/web/new_contact.html
Normal file
@ -0,0 +1,20 @@
|
||||
{% extends 'layouts/master.html' %}
|
||||
{% block title %}New contact{% endblock %}
|
||||
{% block body %}
|
||||
<h1>New contact</h1>
|
||||
<form action="{{ url_for('new_contact') }}" method="post">
|
||||
{{ form.csrf_token }}
|
||||
{% for field in form %}
|
||||
{% if field.label.text != 'CSRF Token' %}
|
||||
<div class="form-group{%if field.errors %} has-error{% endif %}">
|
||||
{{ field.label }}
|
||||
{{ field(class='form-control', value='') }}
|
||||
{% for error in field.errors %}
|
||||
<span class="help-block">{{ error }}</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
<input type="submit" class="btn btn-success" value="Add">
|
||||
</form>
|
||||
{% endblock %}
|
Reference in New Issue
Block a user