~emersion/drmdb

000801dc63666c8e884631a529e1b4ef57bf8f2f — Simon Ser 2 years ago e3e3179
Simplify templates
2 files changed, 5 insertions(+), 9 deletions(-)

M public/formats.html
M public/properties.html
M public/formats.html => public/formats.html +4 -7
@@ 24,19 24,16 @@
        </tr>
    </thead>
    <tbody>
        {{$total := .Total}}
        {{$planes := .Planes}}
        {{$drivers := .Drivers}}
        {{range .Formats}}
        <tr>
            {{$row := .}}
            <td class="pre">{{.Modifier}}</td>
            <td class="pre">{{.Format}}</td>
            {{range $plane, $_ := $planes}}
            <td>{{pct (index $row.Planes $plane) $total}}</td>
            {{range $plane, $_ := $.Planes}}
            <td>{{pct (index $row.Planes $plane) $.Total}}</td>
            {{end}}
            {{range $drv, $_ := $drivers}}
            <td>{{pct (index $row.Drivers $drv) $total}}</td>
            {{range $drv, $_ := $.Drivers}}
            <td>{{pct (index $row.Drivers $drv) $.Total}}</td>
            {{end}}
        </tr>
        {{end}}

M public/properties.html => public/properties.html +1 -2
@@ 16,13 16,12 @@
        </tr>
    </thead>
    <tbody>
        {{$drivers := .Drivers}}
        {{range $name, $prop := .Properties}}
        <tr>
            <td class="pre">{{$name}}</td>
            <td>{{$prop.Type}}</td>
            <td>{{$prop.ObjectType}}</td>
            {{range $drv, $_ := $drivers}}
            {{range $drv, $_ := $.Drivers}}
            {{if index $prop.Drivers $drv}}
            <td class="status-supported">✓</td>
            {{else}}