43 lines
2.0 KiB
HTML
43 lines
2.0 KiB
HTML
{% extends "multiTracker.html" %}
|
|
{# establish the to be tracked data. Display Name, factorio/AP internal name, display image #}
|
|
{%- set science_packs = [
|
|
("Logistic Science Pack", "logistic-science-pack",
|
|
"https://wiki.factorio.com/images/thumb/Logistic_science_pack.png/32px-Logistic_science_pack.png"),
|
|
("Military Science Pack", "military-science-pack",
|
|
"https://wiki.factorio.com/images/thumb/Military_science_pack.png/32px-Military_science_pack.png"),
|
|
("Chemical Science Pack", "chemical-science-pack",
|
|
"https://wiki.factorio.com/images/thumb/Chemical_science_pack.png/32px-Chemical_science_pack.png"),
|
|
("Production Science Pack", "production-science-pack",
|
|
"https://wiki.factorio.com/images/thumb/Production_science_pack.png/32px-Production_science_pack.png"),
|
|
("Utility Science Pack", "utility-science-pack",
|
|
"https://wiki.factorio.com/images/thumb/Utility_science_pack.png/32px-Utility_science_pack.png"),
|
|
("Space Science Pack", "space-science-pack",
|
|
"https://wiki.factorio.com/images/thumb/Space_science_pack.png/32px-Space_science_pack.png"),
|
|
] -%}
|
|
{%- block custom_table_headers %}
|
|
{#- macro that creates a table header with display name and image -#}
|
|
{%- macro make_header(name, img_src) %}
|
|
<th class="center-column">
|
|
<img src="{{ img_src}}"
|
|
alt="{{ name }}">
|
|
</th>
|
|
{% endmacro -%}
|
|
{#- call the macro to build the table header -#}
|
|
{%- for name, internal_name, img_src in science_packs %}
|
|
{{ make_header(name, img_src) }}
|
|
{% endfor -%}
|
|
{% endblock %}
|
|
{% block custom_table_row scoped %}
|
|
{% if games[player] == "Factorio" %}
|
|
{%- set player_inventory = named_inventory[team][player] -%}
|
|
{%- set prog_science = player_inventory["progressive-science-pack"] -%}
|
|
{%- for name, internal_name, img_src in science_packs %}
|
|
<td class="center-column">{% if player_inventory[internal_name] or prog_science > loop.index0 %}✔{% endif %}</td>
|
|
{% endfor -%}
|
|
{% else %}
|
|
{%- for _ in science_packs %}
|
|
<td class="center-column">❌</td>
|
|
{% endfor -%}
|
|
{% endif %}
|
|
{% endblock%}
|