forked from mmistakes/jekyll-theme-skinny-bones
-
Notifications
You must be signed in to change notification settings - Fork 5
/
devices-table.html
69 lines (58 loc) · 2.66 KB
/
devices-table.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
---
layout: default
title: Devices
description: Overview of which features works and which doesn't
---
<div id="page-wrapper">
<!-- Banner -->
<section id="banner">
<div class="content">
<h2>{{ page.title }}</h2>
<p>{{ page.description }}</p>
</div>
</section>
<!-- Main -->
<section id="blog" class="container" >
<!-- assign sections_sorted = site.data.sections | sort: 'order' -->
<table>
{% for device in site.devices %}
{% if device == site.devices[0] %}
<tr>
<th> Device </th>
<th> Device Released </th>
<th> Linux Kernel </th>
{% for cat in device.portStatus %}<th>{{ cat.categoryName }}</th>
{% endfor %}
</tr>
{% endif %}
<tr>
<td><a href="{{ device.url | relative_url }}" >{{ device.name }}</a></td>
<td>{{ device.deviceReleased }}</td>
<td>{{ device.linuxKernel }}</td>
{% if device.portStatus.size > 0 %}
{% for cat in device.portStatus %}
{% assign working = 0 %} {% assign notworking = 0 %} {% assign nottested = 0 %} {% assign unknown = 0 %}
{% for feature in cat.features %}
{% if feature.value == "Y" %}
{% assign working = working | plus: 1 %}
{% elsif feature.value == "N" %}
{% assign notworking = notworking | plus: 1 %}
{% elsif feature.value == "P" %}
{% assign working = working | plus: 0.5 %}
{% assign notworking = notworking | plus: 0.5 %}
{% elsif feature.value == "?" %}
{% assign nottested = nottested | plus: 1 %}
{% elsif feature.value == "-" %}
{% else %}
{% assign unknown = unknown | plus: 1 %}
{% endif %}
{% endfor %}
{% assign total = working | plus: notworking | plus:nottested | round %}
<td class="{{cat.categoryName}}" style="{% if working == total %}color: #4e9a06;{%elsif working == 0 %}color: #a40000; {%else%}color: #f57900{%endif%}" > {{ working }} / {{ total }} {%if unknown > 0 %}/ ({{unknown}}?) {%endif%} </td>
{% endfor %}
{% endif %}
</tr>
{% endfor %}
</table>
<div style="clear:both; "><a href="{{ '/devices' | relative_url }}" class="button alt">List</a><br/><br/></div>
</section>