Add form and Add search
This commit is contained in:
@ -1,13 +1,46 @@
|
||||
{% extends 'layouts/master.html' %}
|
||||
{% set active_page = "buscador" %}
|
||||
{% block title %}Buscador{% endblock %}
|
||||
{% block body %}
|
||||
<h1>Buscador</h1>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<form >
|
||||
<input type="text" id="nombre" class="form-control" name="nombre" placeholder="Buscar...">
|
||||
<input type="submit" class="form-control" value="Buscar">
|
||||
<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">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{% 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>
|
||||
<td><a href="#" class="btn btn-success">+</a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% endif %}
|
||||
{% endblock %}
|
6
templates/items/programadas.html
Normal file
6
templates/items/programadas.html
Normal file
@ -0,0 +1,6 @@
|
||||
{% extends 'layouts/master.html' %}
|
||||
{% set active_page = "programadas" %}
|
||||
{% block title %}Programadas{% endblock %}
|
||||
{% block body %}
|
||||
<h1>Programadas</h1>
|
||||
{% endblock %}
|
@ -8,6 +8,10 @@
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<ul class="nav nav-pills nav-justified">
|
||||
<li role="presentation" {% if active_page == "buscador" %}class="active"{% endif %}><a href="{{ url_for('buscador') }}">Buscador</a></li>
|
||||
<li role="presentation" {% if active_page == "programadas" %}class="active"{% endif %}><a href="{{ url_for('programadas') }}">Programadas</a></li>
|
||||
</ul>
|
||||
{% block body %}{% endblock %}
|
||||
</div>
|
||||
</body>
|
||||
|
Reference in New Issue
Block a user