Browse Source

Using new parent-repository shared components

master
Mobius K 2 years ago
parent
commit
6a2b3e13f1
  1. 47
      routes/index.pug

47
routes/index.pug

@ -1,5 +1,10 @@
extends /bluetooth-class/templates/layout
include /shared/components/checkbox
include /shared/components/radio
include /shared/components/column
include /shared/components/row
block content
// Project header and code result of the generated form below
@ -115,46 +120,30 @@ block content
}
}
// Mixins used to generate checkboxes and radio buttons
mixin checkbox(group, key, value)
.mdc-layout-grid__cell
.mdc-form-field
.mdc-checkbox
input.mdc-checkbox__native-control(type="checkbox", id=group + key, value=value)
.mdc-checkbox__background
svg.mdc-checkbox__checkmark(viewBox="0 0 24 24")
path.mdc-checkbox__checkmark-path(fill="none", d="M1.73,12.91 8.1,19.28 22.79,4.59")
label(for=group + key) #{key}
mixin radio(group, key, value)
.mdc-layout-grid__cell
.mdc-form-field
.mdc-radio
input.mdc-radio__native-control(type="radio", name=group, id=group + key, value=value)
.mdc-radio__background
.mdc-radio__outer-circle
.mdc-radio__inner-circle
label(for=group + key) #{key}
// Input selections per group
h2 Major service
.mdc-layout-grid__inner
+row()
each value, key in codes.majorServices
+checkbox("majorService", key, value)
+column()
.mdc-form-field
+checkbox("majorService", key, value)
h3 Major device
.mdc-layout-grid__inner
+row()
each value, key in codes.majorDevices
+radio("majorDevice", key, value)
+column()
.mdc-form-field
+radio("majorDevice", key, value)
h4 Minor device
.minor-devices
each devices, groupKey in codes.minorDevices
.mdc-layout-grid__inner(class=groupKey)
+row()(class=groupKey)
each value, key in devices
+radio("minorDevice" + groupKey, key, value)
+column()
.mdc-form-field
+radio("minorDevice" + groupKey, key, value)
else
.mdc-layout-grid__cell--span-12
+column("span-12")
p No options for this combination

Loading…
Cancel
Save