Skip to content
Snippets Groups Projects
Commit 96f5745c authored by Tim Jaacks's avatar Tim Jaacks
Browse files

Confluence: group download files by type

parent 3697b4ea
No related branches found
No related tags found
1 merge request!359Confluence: group download files by type
Pipeline #88151 passed with stage
in 26 minutes and 39 seconds
......@@ -54,17 +54,110 @@
</ac:rich-text-body>
</ac:structured-macro>
{%- if MACHINE is defined %}
{%- for machine in MACHINE.split(' ') | sort %}
<h1>{{ machine }}</h1>
<ul>
{#- see https://stackoverflow.com/questions/72654161/dynamically-referencing-a-variable-in-jinja2 #}
{%- set FILES_machine = self._TemplateReference__context.resolve('FILES_' ~ machine | replace("-", "_")) -%}
{%- for machine_file in FILES_machine.split(' ') | sort %}
<li>
<p><a href="{{ machine_file }}">{{ (machine_file | basename) }}</a></p>
</li>
{%- endfor %}
</ul>
<h2>{{ machine }}</h2>
{#- see https://stackoverflow.com/questions/72654161/dynamically-referencing-a-variable-in-jinja2 #}
{%- set SUPPORTED_HARDWARE_machine = self._TemplateReference__context.resolve('SUPPORTED_HARDWARE_' ~ machine | replace("-", "_")).split(',') | sort %}
<h6>Supported Hardware: {% for hardware in SUPPORTED_HARDWARE_machine %}{% if hardware | trim | length %}{{ hardware | trim }}{{ ", " if not loop.last else "" }}{%- endif -%}{%- endfor -%}
</h6>
{%- set FILES_machine = self._TemplateReference__context.resolve('FILES_' ~ machine | replace("-", "_")).split(' ') | sort %}
{%- set used_files = [] %}
<ac:structured-macro ac:name="expand">
<ac:parameter ac:name="title">Downloads</ac:parameter>
<ac:rich-text-body>
<table>
<tbody>
<tr>
<th><b>Image</b></th>
<td>
{%- set files = [] -%}
{%- for file in FILES_machine -%}
{%- if file.endswith(".tar.gz") -%}
{%- set _ = files.append(file) -%}
{%- set _ = used_files.append(file) -%}
{%- endif -%}
{%- endfor -%}
{%- for file in files -%}
<a href="{{ file }}">🔽 {{ (file | basename) }}</a>{{ "<br/>" if not loop.last else "" }}
{%- endfor -%}
</td>
</tr>
<tr>
<th><b>Install Script</b></th>
<td>
{%- set files = [] -%}
{%- for file in FILES_machine -%}
{%- if file.endswith("fng-install.sh") -%}
{%- set _ = files.append(file) -%}
{%- set _ = used_files.append(file) -%}
{%- endif -%}
{%- endfor -%}
{%- for file in files -%}
<a href="{{ file }}">🔽 {{ (file | basename) }}</a>{{ "<br/>" if not loop.last else "" }}
{%- endfor -%}
</td>
</tr>
<tr>
<th><b>SDK</b></th>
<td>
{%- set files = [] -%}
{%- for file in FILES_machine -%}
{%- if "toolchain" in file and file.endswith(".sh") -%}
{%- set _ = files.append(file) -%}
{%- set _ = used_files.append(file) -%}
{%- endif -%}
{%- endfor -%}
{%- for file in files -%}
<a href="{{ file }}">🔽 {{ (file | basename) }}</a>{{ "<br/>" if not loop.last else "" }}
{%- endfor -%}
</td>
</tr>
<tr>
<th><b>Device Trees</b></th>
<td>
{%- set files = [] -%}
{%- for file in FILES_machine -%}
{%- if file.endswith(".dtb") -%}
{%- set _ = files.append(file) -%}
{%- set _ = used_files.append(file) -%}
{%- endif -%}
{%- endfor -%}
{%- for file in files -%}
<a href="{{ file }}">🔽 {{ (file | basename) }}</a>{{ "<br/>" if not loop.last else "" }}
{%- endfor -%}
</td>
</tr>
<tr>
<th><b>Device Tree Overlays</b></th>
<td>
{%- set files = [] -%}
{%- for file in FILES_machine -%}
{%- if file.endswith(".dtbo") -%}
{%- set _ = files.append(file) -%}
{%- set _ = used_files.append(file) -%}
{%- endif -%}
{%- endfor -%}
{%- for file in files -%}
<a href="{{ file }}">🔽 {{ (file | basename) }}</a>{{ "<br/>" if not loop.last else "" }}
{%- endfor -%}
</td>
</tr>
<tr>
<th><b>Misc</b></th>
<td>
{%- set files = [] -%}
{%- for file in FILES_machine -%}
{%- if file not in used_files -%}
{%- set _ = files.append(file) -%}
{%- endif -%}
{%- endfor -%}
{%- for file in files -%}
<a href="{{ file }}">🔽 {{ (file | basename) }}</a>{{ "<br/>" if not loop.last else "" }}
{%- endfor -%}
</td>
</tr>
</tbody>
</table>
</ac:rich-text-body>
</ac:structured-macro>
{%- endfor %}
{%- endif %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment