Commit 763f7638 authored by Romain Hunault's avatar Romain Hunault

Merge branch 'cherry-pick-96998426' into '129-check-sort-order-for-devices-2'

Merge branch 'group-by-vendor-fix-sort' into 'master'

See merge request !157
parents 20992914 403adeab
......@@ -177,30 +177,31 @@ search: exclude
<th scope="col">Available<br>through</br></th>
</tr>
</thead>
{% assign devices = "" | split: " " %}
{% for device in site.data.devices %}
{% assign devices = devices | push: device[1] %}
{% endfor %}
{%- assign devices = "" | split: " " -%}
{%- for device in site.data.devices -%}
{%- assign devices = devices | push: device[1] -%}
{%- endfor -%}
{% assign sorted = devices | sort_natural: 'name' | sort_natural: 'vendor' %}
{% assign lastVendor = "" %}
{% assign nbDevices = 0 %}
{%- for device in sorted %}
{%- assign nbDevices = nbDevices | plus:'1' %}
{%- assign lastVendor = device.vendor %}
<tbody id="myTable">
{%- assign devices_by_vendor = devices | group_by: 'vendor' | sort_natural: 'name' -%}
{%- assign nbDevices = 0 -%}
{%- for vendor in devices_by_vendor -%}
<tbody id="{{ vendor.name }}">
{%- assign sorted = vendor.items | sort_natural: 'name' -%}
{%- for device in sorted -%}
{%- assign nbDevices = nbDevices | plus:'1' -%}
<tr>
<td class="brand">{{device.vendor}} </td>
<td>{{device.name}} {%- if device.is_beta %} (beta) {%- endif %} <br> <a href="{{device.codename }}">Install / build</a> </td>
<td class="brand">{{ vendor.name }}</td>
<td>{{device.name}} {%- if device.is_beta %} (beta) {%- endif %}<br />
<a href="{{ device.codename }}">Install / build</a>
</td>
<td>{{ device.codename}}</td>
<td>{{ device.versions }}</td>
<td>{%- if device.models %}
{%- for model in device.models %}
{{ model }} <br />
{{ model }} <br />
{%- endfor %}
{% else %}
{{ device.codename }}
{{ device.codename }}
{%- endif %}
</td>
<td class="release">{{ device.release }} </td>
......@@ -208,30 +209,30 @@ search: exclude
<td class="battery">
{% if device.removable_battery %}
{% if device.removable_battery == 0 %}
No
No
{% else %}
Yes
Yes
{% endif %}
{% else %}
NA
NA
{% endif %}
</td>
<td class="sim">
{% if device.sim_slots %}
{% if device.sim_slots == 2 %}
Dual sim
Dual sim
{% else %}
Single sim
Single sim
{% endif %}
{% else %}
NA
NA
{% endif %}
</td>
<td class="region">
{% if device.region %}
{{ device.region }}
{{ device.region }}
{% else %}
NA
NA
{% endif%}
</td>
<td class="channel">{{ device.status }} </td>
......@@ -267,6 +268,7 @@ search: exclude
{% endif %}
</td>
</tr>
{%- endfor %}
</tbody>
{%- endfor %}
</table>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment