Enemies
-
+
+ — New encounter —
+ {% for e in encounters %}
+ {{ e.name }}
+ {% endfor %}
+
Add to tracker
diff --git a/templates/tracker/index.html.twig b/templates/tracker/index.html.twig
index d8d289d..7d9ca82 100644
--- a/templates/tracker/index.html.twig
+++ b/templates/tracker/index.html.twig
@@ -4,77 +4,35 @@
{% block body %}
-
Combat tracker
- {% if combatants %}· {{ combatants|length }} {% endif %}
-
-
+
Encounters
+
- {% if not combatants %}
+ {% if not encounters %}
- No combatants yet. Go to Enemies , tick the ones you want (set a count for
- multiples), and choose Add to tracker .
+ No encounters yet. Name one above, or go to Enemies , tick the combatants
+ you want and add them to a new encounter.
{% else %}
-
- {% for c in combatants %}
- {% set pct = c.hpPercent %}
- {% set bar = c.isDown ? 'bg-secondary' : (pct <= 25 ? 'bg-danger' : (pct <= 50 ? 'bg-warning' : 'bg-success')) %}
-
-
-
-
-
- {{ c.label }}
- {% if c.isDown %}Down {% endif %}
-
- {% if c.enemy %}
-
stat block
- {% endif %}
-
-
-
-
-
- {{ c.currentHp }} / {{ c.maxHp }}
-
-
-
-
-
-
-
-
-
+
{% endif %}
diff --git a/templates/tracker/show.html.twig b/templates/tracker/show.html.twig
new file mode 100644
index 0000000..bc51e2b
--- /dev/null
+++ b/templates/tracker/show.html.twig
@@ -0,0 +1,93 @@
+{% extends 'base.html.twig' %}
+
+{% block title %}{{ encounter.name }} · Tracker · dmtools{% endblock %}
+
+{% block body %}
+
+
+
+
Add enemies
+ {% if encounter.combatants|length %}
+
+ {% endif %}
+
+
+
+
+ {% if not encounter.combatants|length %}
+
+
+ No combatants. Use Add enemies to pick some from the list.
+
+
+ {% else %}
+
+ {% for c in encounter.combatants %}
+ {% set pct = c.hpPercent %}
+ {% set bar = c.isDown ? 'bg-secondary' : (pct <= 25 ? 'bg-danger' : (pct <= 50 ? 'bg-warning' : 'bg-success')) %}
+
+
+
+
+
+ {{ c.label }}
+ {% if c.isDown %}Down {% endif %}
+
+ {% if c.enemy %}
+
stat block
+ {% endif %}
+
+
+
+
+
+ {{ c.currentHp }} / {{ c.maxHp }}
+
+
+
+
+
+
+
+
+
+ {% endfor %}
+
+ {% endif %}
+{% endblock %}