Skip to content

Commit 539a304

Browse files
authored
Display support tables vertically
1 parent d7c8f21 commit 539a304

File tree

7 files changed

+355
-332
lines changed

7 files changed

+355
-332
lines changed

_includes/support_list.html

Lines changed: 97 additions & 129 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{% capture support_key %}{{ support[0] }}{% endcapture %}
2-
32
{% capture anysupport %}
43
{% for sw in type.software %}
54
{% if sw.support contains support_key or sw.partial contains support_key %}
@@ -9,36 +8,59 @@
98
{% endcapture %}
109

1110
{% if anysupport contains "Y" %}
12-
{% if hide_support_name %}{% else %}
13-
#### {% if support_name %}{{ support_name }}{% else %}{{ support[1].name }} Support{% endif %}
14-
{% endif %}
1511

1612
{% if support[1].note %}{{ support[1].note | markdownify }}{% endif %}
17-
{% assign sw_max = -1 %}
18-
{% assign sw_index = 0 %}
19-
{% assign sw_index_body = 0 %}
20-
{% assign sw_count = 0 %}
21-
{% assign max_sw_per_table = 9 %}
22-
{% assign min_fullwidth_display = 8 %}
2313

24-
{% for abcxyz in (1..9999) %}<!-- we expect to break out of this loop in all cases, so this is fine -->
25-
{% assign sw_count = 0 %}
26-
{% capture sw_len_cols %}{% for sw in type.software offset:sw_index %}{% assign sw_count = sw_count | plus: 1 %}^{% if sw_count == max_sw_per_table %}{% break %}{% elsif forloop.last %}{% break %}{% endif %}{% endfor %}{% endcapture %}
27-
<div class="sw-table t-{{ support[1].name | slugify }}{% if min_fullwidth_display <= sw_len_cols.size %} fullwidth{% endif %}"><table>
28-
<colgroup>
29-
<col class="name" />
30-
<col class="software" span="{{ sw_len_cols | size }}" />
31-
</colgroup>
14+
{% assign popup_above_after = type.software | size | minus: 3 %}
15+
{% if popup_above_after < 3 %}
16+
{% assign popup_above_after = 3 %}
17+
{% endif %}
18+
19+
<div class="support-table {{ include.swtype }}"><table>
3220
<thead>
3321
<tr>
34-
<th>Feature</th>
35-
{% assign sw_count = 0 %}
36-
{% assign sw_index_body = sw_index %}
37-
{% for sw in type.software offset:sw_index %}
38-
{% if sw_max == -1 %}{% assign sw_max = forloop.length %}{% endif %}
39-
{% assign sw_index = sw_index | plus: 1 %}
40-
{% assign sw_count = sw_count | plus: 1 %}
41-
<th class="support-head">
22+
<th>
23+
<!-- Software -->
24+
</th>
25+
{% for ext in support[1].specs %}{% if ext[1].deprecated %}{% else %}
26+
{% capture ext_name %}{{ ext[0] }}{% endcapture %}
27+
28+
{% capture should_show_spec %}
29+
{% for sw in type.software %}
30+
{% if ext[1].hide-on-servers and type.name contains "Servers" %}
31+
32+
{% elsif ext[1].hide-if-no-support %}
33+
{% if sw.support[support_key] contains ext_name or sw.partial[support_key] contains ext_name %}
34+
Y
35+
{% endif %}
36+
{% elsif ext[1].draft %}
37+
{% if sw.support[support_key] contains ext_name or sw.partial[support_key] contains ext_name or sw.na[support_key] contains ext_name %}
38+
Y
39+
{% endif %}
40+
{% else %}
41+
Y
42+
{% endif %}
43+
{% endfor %}
44+
{% endcapture %}
45+
46+
{% if should_show_spec contains "Y" %}
47+
<th class="{% if ext[1].required %}required{% elsif ext[1].draft %}draft{% else %}optional{% endif %}"><a class="spec-name" title="{{ ext[1].description }}" href="{% if ext[1].ext_link %}{{ ext[1].ext_link }}{% else %}{{ site.baseurl }}{{ ext[1].link }}{% endif %}">{{ ext[1].name }}</a></th>
48+
{% endif %}
49+
{% endif %}{% endfor %}
50+
</tr>
51+
</thead>
52+
<tbody>
53+
{% assign sw_index = 0 %}
54+
{% for sw in type.software %}
55+
{% assign sw_index = sw_index | plus: 1 %}
56+
{% if sw_index < popup_above_after %}
57+
{% assign popup_above = false %}
58+
{% else %}
59+
{% assign popup_above = true %}
60+
{% endif %}
61+
62+
<tr class="popup-{% if popup_above %}above{% else %}below{% endif %}">
63+
<td>
4264
{% if sw.link %}<a{% if sw.ircd-ver || sw.net-address %} class="bold"{% endif %} href="{{ sw.link }}">{{ sw.name }}</a>{% else %}{{ sw.name }}{% endif %}
4365
{% if sw.ircd-ver %}<span class="ircd-ver">{{ sw.ircd-ver }}</span>{% endif %}
4466
{% if sw.net-address %}<a class="net-address" href="{{ sw.net-address.link }}">{{ sw.net-address.display }}</a>{% endif %}
@@ -63,129 +85,75 @@
6385
{% endfor %}
6486
</div>
6587
{% endif %}
66-
</th>
67-
{% if sw_count == max_sw_per_table %}{% break %}{% elsif forloop.last %}{% break %}{% endif %}
68-
{% endfor %}
69-
</tr>
70-
</thead>
71-
<tbody>
72-
{% capture length_of_specs %}{% for ext in support[1].specs %}{% if ext[1].deprecated %}{% else %}{% capture ext_name %}{{ ext[0] }}{% endcapture %}{% capture any_draft_support %}{% for sw in type.software %}{% if sw.support[support_key] contains ext_name or sw.partial[support_key] contains ext_name or sw.na[support_key] contains ext_name %}Y{% endif %}{% endfor %}{% endcapture %}{% if any_draft_support contains "Y" %}Y{% endif %}{% endif %}{% endfor %}{% endcapture %}
73-
74-
{% for ext in support[1].specs %}{% if ext[1].deprecated %}{% else %}
75-
76-
{% capture ext_name %}{{ ext[0] }}{% endcapture %}
77-
88+
</td>
89+
{% for ext in support[1].specs %}{% if ext[1].deprecated %}{% else %}
90+
{% capture ext_name %}{{ ext[0] }}{% endcapture %}
7891

79-
{% assign comment = "decide whether to put the popup above or beneath the name. yes, really." %}
80-
81-
{% assign real_index = 0 %}
82-
{% for ext2 in support[1].specs %}{% if ext2[1].deprecated %}{% else %}
83-
{% capture ext2_name %}{{ ext2[0] }}{% endcapture %}
84-
{% capture any_ext_support %}
92+
{% capture should_show_spec %}
8593
{% for sw in type.software %}
86-
{% if ext[1].draft %}
87-
{% if sw.support[support_key] contains ext2_name or sw.partial[support_key] contains ext2_name or sw.na[support_key] contains ext2_name %}
94+
{% if ext[1].hide-on-servers and type.name contains "Servers" %}
95+
96+
{% elsif ext[1].hide-if-no-support %}
97+
{% if sw.support[support_key] contains ext_name or sw.partial[support_key] contains ext_name %}
98+
Y
99+
{% endif %}
100+
{% elsif ext[1].draft %}
101+
{% if sw.support[support_key] contains ext_name or sw.partial[support_key] contains ext_name or sw.na[support_key] contains ext_name %}
88102
Y
89103
{% endif %}
90104
{% else %}
91105
Y
92106
{% endif %}
93107
{% endfor %}
94108
{% endcapture %}
95-
{% if any_ext_support contains "Y" %}
96-
{% assign real_index = real_index | plus: 1 %}
97-
{% if ext2_name == ext_name %}
98-
{% break %}
99-
{% endif %}
100-
{% endif %}
101-
{% endif %}{% endfor %}
102-
103-
{% assign forlooplen = length_of_specs.size | minus: 2 %}
104109

105-
{% if real_index < forlooplen %}
106-
{% assign popup_above = false %}
107-
{% else %}
108-
{% assign popup_above = true %}
109-
{% endif %}
110-
111-
{% capture should_show_spec %}
112-
{% for sw in type.software %}
113-
{% if ext[1].hide-on-servers and type.name contains "Servers" %}
114-
115-
{% elsif ext[1].hide-if-no-support %}
116-
{% if sw.support[support_key] contains ext_name or sw.partial[support_key] contains ext_name %}
117-
Y
118-
{% endif %}
119-
{% elsif ext[1].draft %}
120-
{% if sw.support[support_key] contains ext_name or sw.partial[support_key] contains ext_name or sw.na[support_key] contains ext_name %}
121-
Y
122-
{% endif %}
123-
{% else %}
124-
Y
125-
{% endif %}
126-
{% endfor %}
127-
{% endcapture %}
128-
129-
{% if should_show_spec contains "Y" %}
130-
131-
<tr class="{% if ext[1].required %}required{% elsif ext[1].draft %}draft{% else %}optional{% endif %} popup-{% if popup_above %}above{% else %}below{% endif %}">
132-
<td><span><a class="spec-name" title="{{ ext[1].description }}" href="{% if ext[1].ext_link %}{{ ext[1].ext_link }}{% else %}{{ site.baseurl }}{{ ext[1].link }}{% endif %}">{{ ext[1].name }}</a></span></td>
133-
134-
{% assign sw_count = 0 %}
135-
{% for sw in type.software offset:sw_index_body %}
136-
{% assign sw_count = sw_count | plus: 1 %}
137-
{% if ext[1].deprecated %}{% else %}
138-
<td class="support {% if sw.support[support_key] contains ext_name %}supported{% elsif sw.partial[support_key] contains ext_name %}partial{% elsif sw.na[support_key] contains ext_name %}na{% else %}unsupported{% endif %}">
139-
{% assign show_cap = true %}
140-
{% if sw.support[support_key] contains ext_name %}
141-
{% assign capab = sw.support[support_key][ext_name] %}
142-
{% assign default = 'Yes' %}
143-
{% elsif sw.partial[support_key] contains ext_name %}
144-
{% assign capab = sw.partial[support_key][ext_name] %}
145-
{% assign default = 'Partial' %}
146-
{% elsif sw.na[support_key] contains ext_name %}
147-
{% assign capab = sw.na[support_key][ext_name] %}
148-
{% assign default = 'N/A' %}
149-
{% else %}
150-
{% assign show_cap = false %}
151-
{% endif %}
152-
153-
{% if popup_above %}{% else %}
154-
{% if show_cap %}
155-
{% include show_capability.html %}
110+
{% if should_show_spec contains "Y" %}
111+
<td data-capname="{{ support[1].specs[ext_name].name }}" class="{% if ext[1].required %}required{% elsif ext[1].draft %}draft{% else %}optional{% endif %} support {% if sw.support[support_key] contains ext_name %}supported{% elsif sw.partial[support_key] contains ext_name %}partial{% elsif sw.na[support_key] contains ext_name %}na{% else %}unsupported{% endif %}">
112+
{% assign show_cap = true %}
113+
{% if sw.support[support_key] contains ext_name %}
114+
{% assign capab = sw.support[support_key][ext_name] %}
115+
{% assign default = 'Yes' %}
116+
{% elsif sw.partial[support_key] contains ext_name %}
117+
{% assign capab = sw.partial[support_key][ext_name] %}
118+
{% assign default = 'Partial' %}
119+
{% elsif sw.na[support_key] contains ext_name %}
120+
{% assign capab = sw.na[support_key][ext_name] %}
121+
{% assign default = 'N/A' %}
156122
{% else %}
157-
No
123+
{% assign show_cap = false %}
158124
{% endif %}
159-
{% endif %}
160125

161-
{% if length_of_specs.size >= 5 %}
162-
<div class="hover-popup"><div>
163-
<p class="bold">{{ sw.name }}</p>
164-
<p>{{ ext[1].name }}</p>
165-
{% if info %}
166-
<p class="note">{{ info }}</p>
126+
{% if popup_above %}{% else %}
127+
{% if show_cap %}
128+
{% include show_capability.html %}
129+
{% else %}
130+
No
131+
{% endif %}
167132
{% endif %}
168-
</div></div>
169-
{% endif %}
170133

171-
{% if popup_above %}
172-
{% if show_cap %}
173-
{% include show_capability.html %}
174-
{% else %}
175-
No
134+
<div class="hover-popup"><div>
135+
<p class="bold">{{ sw.name }}</p>
136+
<p>{{ ext[1].name }}</p>
137+
{% if info %}
138+
<p class="note">{{ info }}</p>
139+
{% endif %}
140+
</div></div>
141+
142+
{% if popup_above %}
143+
{% if show_cap %}
144+
{% include show_capability.html %}
145+
{% else %}
146+
No
147+
{% endif %}
176148
{% endif %}
177-
{% endif %}
178149

179-
{% assign info = nil %}
180-
</td>
150+
{% assign info = nil %}
151+
</td>
181152
{% endif %}
182-
{% if sw_count == max_sw_per_table %}{% break %}{% elsif forloop.last %}{% break %}{% endif %}
183-
{% endfor %}
153+
{% endif %}{% endfor %}
184154
</tr>
185-
{% endif %}{% endif %}{% endfor %}
155+
{% endfor %}
186156
</tbody>
187157
</table></div>
188-
{% if sw_index == sw_max %}{% break %}{% endif %}
189-
{% endfor %}
190158

191159
{% endif %}

0 commit comments

Comments
 (0)