first commit
This commit is contained in:
51
public_web/templates/game/partials/sidebar_map.html
Normal file
51
public_web/templates/game/partials/sidebar_map.html
Normal file
@@ -0,0 +1,51 @@
|
||||
{#
|
||||
Map Accordion Content
|
||||
Shows discovered locations grouped by region
|
||||
#}
|
||||
{% if discovered_locations %}
|
||||
{# Group locations by region #}
|
||||
{% set regions = {} %}
|
||||
{% for loc in discovered_locations %}
|
||||
{% set region = loc.region %}
|
||||
{% if region not in regions %}
|
||||
{% set _ = regions.update({region: []}) %}
|
||||
{% endif %}
|
||||
{% set _ = regions[region].append(loc) %}
|
||||
{% endfor %}
|
||||
|
||||
{% for region_name, locations in regions.items() %}
|
||||
<div class="map-region">
|
||||
<div class="map-region-name">{{ region_name }}</div>
|
||||
<div class="map-locations">
|
||||
{% for loc in locations %}
|
||||
<div class="map-location {% if loc.is_current %}current{% endif %}"
|
||||
{% if not loc.is_current %}
|
||||
hx-post="{{ url_for('game.do_travel', session_id=session_id) }}"
|
||||
hx-vals='{"location_id": "{{ loc.location_id }}"}'
|
||||
hx-target="#narrative-content"
|
||||
hx-swap="innerHTML"
|
||||
hx-confirm="Travel to {{ loc.name }}?"
|
||||
{% endif %}>
|
||||
<span class="map-location-icon">
|
||||
{% if loc.location_type == 'town' %}🏘️
|
||||
{% elif loc.location_type == 'tavern' %}🍺
|
||||
{% elif loc.location_type == 'wilderness' %}🌲
|
||||
{% elif loc.location_type == 'dungeon' %}⚔️
|
||||
{% elif loc.location_type == 'ruins' %}🏚️
|
||||
{% else %}📍
|
||||
{% endif %}
|
||||
</span>
|
||||
<span class="map-location-name">{{ loc.name }}</span>
|
||||
<span class="map-location-type">
|
||||
{% if loc.is_current %}(here){% else %}{{ loc.location_type }}{% endif %}
|
||||
</span>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<div class="quest-empty">
|
||||
No locations discovered yet.
|
||||
</div>
|
||||
{% endif %}
|
||||
Reference in New Issue
Block a user