mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-01 04:10:06 -05:00
lots of things working
This commit is contained in:
@@ -2,19 +2,31 @@
|
||||
{% load django_tables2 %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block title %}Rezepte{% endblock %}
|
||||
{% block title %}{% trans "Cookbook" %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<h3>
|
||||
{% trans "Cookbook" %}
|
||||
</h3>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
{% trans "Search" %}
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form action="" method="get">
|
||||
{{ filter.form.as_p }}
|
||||
<input type="submit"/>
|
||||
</form>
|
||||
{% for obj in filter.qs %}
|
||||
{{ obj.name }} - ${{ obj.price }}<br/>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
<br/>
|
||||
|
||||
{% if recipes %}
|
||||
{% render_table recipes %}
|
||||
{% render_table table %}
|
||||
{% else %}
|
||||
<div class="alert alert-danger" role="alert">
|
||||
Log dich ein um die Rezepte zu sehen!
|
||||
{% trans "Log in to view Recipies" %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
|
||||
@@ -1,35 +1,50 @@
|
||||
{% extends "base.html" %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
{% if form.errors %}
|
||||
<p>Your username and password didn't match. Please try again.</p>
|
||||
{% endif %}
|
||||
{% if form.errors %}
|
||||
<div class="alert alert-danger" role="alert">
|
||||
{% trans "Your username and password didn't match. Please try again." %}
|
||||
</div>
|
||||
|
||||
{% if next %}
|
||||
{% if user.is_authenticated %}
|
||||
<p>Your account doesn't have access to this page. To proceed,
|
||||
please login with an account that has access.</p>
|
||||
{% else %}
|
||||
<p>Please login to see this page.</p>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
<form method="post" action="{% url 'login' %}">
|
||||
{% csrf_token %}
|
||||
<table>
|
||||
<tr>
|
||||
<td>{{ form.username.label_tag }}</td>
|
||||
<td>{{ form.username }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ form.password.label_tag }}</td>
|
||||
<td>{{ form.password }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<input type="submit" value="login" />
|
||||
<input type="hidden" name="next" value="{{ next }}" />
|
||||
</form>
|
||||
<form role="form" class="form-horizontal" method="post" action="{% url 'login' %}">
|
||||
{% csrf_token %}
|
||||
<div class="form-group">
|
||||
|
||||
<div class="form-group row">
|
||||
<label for='{{ form.username.label_tag }}' class="col-sm-2 col-form-label">{{ form.username.label }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" id="{{ form.username.id_for_label }}"
|
||||
name="{{ form.username.html_name }}"/>
|
||||
</div>
|
||||
{% if form.username.errors %}
|
||||
<div class="alert alert-danger" role="alert">
|
||||
{{ form.username.errors }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label for='{{ form.password.label_tag }}' class="col-sm-2 col-form-label">{{ form.password.label }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" id="{{ form.password.id_for_label }}"
|
||||
name="{{ form.password.html_name }}" type="password"/>
|
||||
</div>
|
||||
{% if form.password.errors %}
|
||||
<div class="alert alert-danger" role="alert">
|
||||
{{ form.password.errors }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<input type="submit" class="btn btn-primary" value="login"/>
|
||||
<input type="hidden" name="next" value="{{ next }}"/>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
{% endblock %}
|
||||
@@ -68,7 +68,7 @@
|
||||
<ul class="pagination justify-content-center">
|
||||
{% block pagination.allpages %}
|
||||
<li class="page-item">
|
||||
{% blocktrans %}{% endblocktrans %}
|
||||
|
||||
</li>
|
||||
{% for page in table.paginator.page_range %}
|
||||
{% with range_start=current_page|add:"-3" range_end=current_page|add:"3" page_count_minus_5=page_count|add:"-5" page_count_minus_1=page_count|add:"-1" %}
|
||||
|
||||
Reference in New Issue
Block a user