Erste Funktionalität der Menükarte per GET/POST, keine API; Umstrukturierung der Tabelle als Bootstrap-div; HTML/CSS-Cleanup

This commit is contained in:
Sebastian Seedorf
2016-03-25 13:33:42 +01:00
parent 92a5ff8eda
commit f99271ee01
202 changed files with 25173 additions and 853 deletions

View File

@@ -1,188 +1,62 @@
extends ./wrapper
mixin menu-item-adm(name, desc, price, prefix, newItem)
.row
.col-md-1
if newItem
button.btn.btn-sm.btn-success(type="submit",form="#{prefix}")
+icon("ok")
else
form(style="display:inline",method="post",action="")
input(type='hidden',name='del',value='#{prefix}')
button.btn.btn-sm.btn-danger(type="submit")
+icon("remove")
button.btn.btn-sm.btn-primary(type="submit",form="#{prefix}")
+icon("edit")
form.col-md-11(id="#{prefix}",method="post",action="")
.col-md-9
input(type='hidden',name='nametag',value='#{prefix}')
+input-val-simple("text",prefix + "-name","Name","name","name",name)
+input-val-simple("text",prefix + "-desc","Beschreibung","desc","desc",desc)
.col-md-3.text-right
+input-group("","€")
input.form-control(type="number",id="#{prefix + '-price'}",name="price",value="#{price}").text-right
mixin menu-item(name, desc, price)
.row
.col-md-9
span.lead= name
br
span.small= desc
.col-md-3(style="display: flex;flex-direction: column;justify-content: center;")
p.text-right #{price.toFixed(2).replace(/(\d)(?=(\d{3})+\,)/g, '$1,').replace(/^(.*)\.(.*)$/g, '$1,$2€')}
mixin menu-cat(name, anchor, content, adm, prefix)
a(name= anchor)
h2= name
.container
.row
.col-md-10.col-md-offset-1.stripe
if adm
each val, index in content
+menu-item-adm(val.name, val.desc, val.price, prefix + "-" + index, "")
+menu-item-adm("", "", "", prefix + "-new", "x")
else
each val, index in content
+menu-item(val.name, val.desc, val.price)
mixin menu-part(part, adm, prefix)
each val, index in part
+menu-cat(val.name, val.anchor, val.items, adm, prefix + "-" + index)
block vars
- var pageTitle = 'Speisekarte'
block content
.center-page
h1 Speisen
a(name="vorspeise")
h2 Vorspeisen
table#menu-1
tbody
tr
td Suppe Süß-Sauer
p Beschreibung
td 3,50€
tr
td Rei-s-uppe
p Beschreibung
td 4,90€
tr
td Rei-s-alat
p Beschreibung
td 5,50€
tr
td Beste Freundschaft
p Beschreibung
td 5,50€
a(name="suppe")
h2 Suppen
table#menu-1
tbody
tr
td Suppe Süß-Sauer
p Beschreibung
td 3,50€
tr
td Rei-s-uppe
p Beschreibung
td 4,90€
tr
td Rei-s-alat
p Beschreibung
td 5,50€
tr
td Beste Freundschaft
p Beschreibung
td 5,50€
a(name="hauptspeise")
h2 Hauptspeisen
table#menu-1
tbody
tr
td Suppe Süß-Sauer
p Beschreibung
td 3,50€
tr
td Rei-s-uppe
p Beschreibung
td 4,90€
tr
td Rei-s-alat
p Beschreibung
td 5,50€
tr
td Beste Freundschaft
p Beschreibung
td 5,50€
a(name="junior")
h2 Für Junior-Reisesser
table#menu-1
tbody
tr
td Suppe Süß-Sauer
p Beschreibung
td 3,50€
tr
td Rei-s-uppe
p Beschreibung
td 4,90€
tr
td Rei-s-alat
p Beschreibung
td 5,50€
tr
td Beste Freundschaft
p Beschreibung
td 5,50€
a(name="dessert")
h2 Desserts
table#menu-1
tbody
tr
td Suppe Süß-Sauer
p Beschreibung
td 3,50€
tr
td Rei-s-uppe
p Beschreibung
td 4,90€
tr
td Rei-s-alat
p Beschreibung
td 5,50€
tr
td Beste Freundschaft
p Beschreibung
td 5,50€
+menu-part(menuJSON.food, isAdmin, "f")
h1 Getränke
a(name="haus")
h2 Auf Art des Hauses
table#menu-1
tbody
tr
td Suppe Süß-Sauer
p Beschreibung
td 3,50€
tr
td Rei-s-uppe
p Beschreibung
td 4,90€
tr
td Rei-s-alat
p Beschreibung
td 5,50€
tr
td Beste Freundschaft
p Beschreibung
td 5,50€
a(name="alkoholfrei")
h2 Alkoholfrei
table#menu-1
tbody
tr
td Suppe Süß-Sauer
p Beschreibung
td 3,50€
tr
td Rei-s-uppe
p Beschreibung
td 4,90€
tr
td Rei-s-alat
p Beschreibung
td 5,50€
tr
td Beste Freundschaft
p Beschreibung
td 5,50€
a(name="alkohol")
h2 Mit Alkohol
table#menu-1
tbody
tr
td Suppe Süß-Sauer
p Beschreibung
td 3,50€
tr
td Rei-s-uppe
p Beschreibung
td 4,90€
tr
td Rei-s-alat
p Beschreibung
td 5,50€
tr
td Beste Freundschaft
p Beschreibung
td 5,50€
a(name="spirituose")
h2 Spriritus
table#menu-1
tbody
tr
td Suppe Süß-Sauer
p Beschreibung
td 3,50€
tr
td Rei-s-uppe
p Beschreibung
td 4,90€
tr
td Rei-s-alat
p Beschreibung
td 5,50€
tr
td Beste Freundschaft
p Beschreibung
td 5,50€
+menu-part(menuJSON.drinks, isAdmin, "d")