2017-08-01 09:22:15 +02:00
|
|
|
{% extends 'layouts/master.html' %}
|
2017-08-06 00:38:21 +02:00
|
|
|
{% set active_page = "buscador" %}
|
2017-08-01 09:22:15 +02:00
|
|
|
{% block title %}Buscador{% endblock %}
|
|
|
|
{% block body %}
|
|
|
|
<h1>Buscador</h1>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-xs-12">
|
2017-08-06 00:38:21 +02:00
|
|
|
<form method="post">
|
|
|
|
{{ form.csrf_token }}
|
|
|
|
{% for input in form %}
|
|
|
|
{% if input.type != 'CSRFTokenField' %}
|
|
|
|
<div class="form-group">
|
|
|
|
{# Label #}
|
|
|
|
{{ input.label }}
|
|
|
|
{# Input #}
|
|
|
|
{{ input(class="form-control") }}
|
|
|
|
{# Errors #}
|
|
|
|
{% if input.errors %}
|
|
|
|
<div class="has-error">
|
|
|
|
{% for error in input.errors %}
|
|
|
|
<label class="help-block">
|
|
|
|
{{ error }}
|
|
|
|
</label>
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
<input type="submit" class="btn btn-primary" value="Buscar">
|
2017-08-01 09:22:15 +02:00
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
2017-08-06 00:38:21 +02:00
|
|
|
{% if results %}
|
|
|
|
<table class="table">
|
|
|
|
{% for item in results %}
|
|
|
|
<tr>
|
|
|
|
<td><img class="img-responsive" src="{{ item.pictureURL }}" alt="{{ item.title }}"></td>
|
|
|
|
<td>{{ item.title }}</td>
|
|
|
|
<td>{{ item.price }}</td>
|
2017-08-07 19:54:39 +02:00
|
|
|
<td>
|
|
|
|
<form action="{{ url_for('programadas_nuevo') }}" method="post">
|
|
|
|
<input type="hidden" name="itemId" value="{{ item.itemId }}">
|
|
|
|
<input type="hidden" name="title" value="{{ item.title }}">
|
|
|
|
<input type="hidden" name="price" value="{{ item.price }}">
|
|
|
|
<input type="hidden" name="pictureURL" value="{{ item.pictureURL }}">
|
|
|
|
<input type="submit" class="btn btn-success" value="+">
|
|
|
|
</form>
|
|
|
|
</td>
|
2017-08-06 00:38:21 +02:00
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
</table>
|
|
|
|
{% endif %}
|
2017-08-01 09:22:15 +02:00
|
|
|
{% endblock %}
|