69 lines
2.6 KiB
HTML
69 lines
2.6 KiB
HTML
{% extends "base.html" %}
|
|
{% load django_tables2 %}
|
|
{% load crispy_forms_tags %}
|
|
{% load static %}
|
|
{% load i18n %}
|
|
|
|
{% block title %}{% trans "Cookbook" %}{% endblock %}
|
|
|
|
{% block extra_head %}
|
|
{{ filter.form.media }}
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
{% if filter %}
|
|
<form action="" method="get" id="search_form">
|
|
{% csrf_token %}
|
|
{{ form.non_field_errors }}
|
|
<div class="row">
|
|
<div class="col md-12">
|
|
<div class="input-group">
|
|
<input type="text" class="form-control" placeholder="{% trans 'Search recipe ...' %}"
|
|
id="{{ filter.form.name.id_for_label }}" name="{{ filter.form.name.name }}"
|
|
aria-describedby="button-addon4">
|
|
<div class="input-group-append" id="button-addon4">
|
|
<button class="btn btn-primary" type="submit"><i class="fas fa-search"></i></button>
|
|
<button class="btn btn-warning" type="button" onclick="window.location = window.location.pathname;"><i class="fas fa-backspace"></i></button>
|
|
<button class="btn btn-success" type="button" onclick="location.href='{% url 'new_recipe' %}'"><i class="fas fa-plus-circle"></i></button>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row ">
|
|
<div class="col-md-2 offset-md-10" style="text-align: right">
|
|
<a class="" data-toggle="collapse" href="#collapse_adv_search" role="button"
|
|
aria-expanded="false"
|
|
aria-controls="collapse_adv_search"><i
|
|
class="fas fa-search"></i> {% trans 'Advanced Search' %}</a>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="collapse col-md-12" id="collapse_adv_search">
|
|
<div>
|
|
{{ filter.form.keywords | as_crispy_field }}
|
|
</div>
|
|
<div>
|
|
{{ filter.form.ingredients | as_crispy_field }}
|
|
</div>
|
|
<div>
|
|
{{ filter.form.internal | as_crispy_field }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
{% endif %}
|
|
<br/>
|
|
|
|
{% if user.is_authenticated and recipes %}
|
|
{% render_table recipes %}
|
|
{% else %}
|
|
<div class="alert alert-danger" role="alert">
|
|
{% trans "Log in to view Recipies" %}
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% endblock %} |