mirror of
https://github.com/welton89/RRBEC.git
synced 2026-04-05 13:35:42 +00:00
create views comandas
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -1,12 +1,33 @@
|
||||
{% extends "base.html" %}
|
||||
{% load static %}
|
||||
|
||||
|
||||
|
||||
|
||||
{% block 'title' %}
|
||||
Type Pay
|
||||
Comandas{% endblock %}
|
||||
{% block 'head' %}
|
||||
<link rel="stylesheet" href="{% static 'comandas/css/comandas.css' %}">
|
||||
{% endblock %}
|
||||
|
||||
{% block 'body' %}
|
||||
Body Type Pay
|
||||
|
||||
body>
|
||||
<div class="grid-container">
|
||||
|
||||
{% for comanda in comandas %}
|
||||
|
||||
<div href="{% url 'viewcomanda' %}?parametro={{ comanda.id }}" class="card"> <a href="{% url 'viewcomanda' %}?parametro={{ comanda.id }}">{{comanda.name}} </a>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
{% endfor %}
|
||||
|
||||
|
||||
</div>
|
||||
</body>
|
||||
|
||||
|
||||
|
||||
|
||||
{% endblock %}
|
||||
29
gestaoRaul/comandas/templates/viewcomanda.html
Normal file
29
gestaoRaul/comandas/templates/viewcomanda.html
Normal file
@@ -0,0 +1,29 @@
|
||||
{% extends "base.html" %}
|
||||
{% load static %}
|
||||
|
||||
|
||||
|
||||
|
||||
{% block 'title' %}
|
||||
Comandas{% endblock %}
|
||||
{% block 'head' %}
|
||||
<link rel="stylesheet" href="{% static 'comandas/css/viewcomanda.css' %}">
|
||||
{% endblock %}
|
||||
{% block 'body' %}
|
||||
|
||||
body>
|
||||
<div class="grid-container">
|
||||
<h4>{{comanda.id}}</h4>
|
||||
<h4>{{comanda.name}}</h4>
|
||||
<h4>{{comanda.mesa}}</h4>
|
||||
<h4>{{comanda.dt_open}}</h4>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</body>
|
||||
|
||||
|
||||
|
||||
|
||||
{% endblock %}
|
||||
@@ -4,6 +4,7 @@ from . import views
|
||||
|
||||
urlpatterns = [
|
||||
path('', views.comandas, name='comandas'),
|
||||
path('viewcomanda/', views.viewComanda, name='viewcomanda'),
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,19 @@
|
||||
from django.shortcuts import render
|
||||
from django.shortcuts import render, redirect
|
||||
|
||||
from comandas.models import Comanda
|
||||
|
||||
# Create your views here.
|
||||
|
||||
def comandas(request):
|
||||
return render(request, 'comandas.html')
|
||||
comandas = Comanda.objects.all()
|
||||
return render(request, 'comandas.html', {'comandas': comandas})
|
||||
|
||||
|
||||
|
||||
|
||||
def viewComanda(request):
|
||||
id = request.GET.get('parametro')
|
||||
comanda_id = int(id)
|
||||
comanda = Comanda.objects.get(id=comanda_id)
|
||||
|
||||
return render(request, 'viewcomanda.html', {'comanda': comanda})
|
||||
Reference in New Issue
Block a user