{% extends "shared/frontend/base.html" %} {% block title %}{{ location.name }} - BMC Hub{% endblock %} {% block extra_css %} {% endblock %} {% block content %}
Lokation #{{ location.id }} {% set type_label = { 'kompleks': 'Kompleks', 'bygning': 'Bygning', 'etage': 'Etage', 'rum': 'Rum', 'kantine': 'Kantine', 'moedelokale': 'Mødelokale', 'customer_site': 'Kundesite', 'vehicle': 'Køretøj' }.get(location.location_type, location.location_type) %} {% set type_color = { 'kompleks': '#0f4c75', 'bygning': '#1abc9c', 'etage': '#3498db', 'rum': '#e67e22', 'kantine': '#d35400', 'moedelokale': '#16a085', 'customer_site': '#9b59b6', 'vehicle': '#8e44ad' }.get(location.location_type, '#6c757d') %} {{ type_label }} {% if location.has_cross_field %} Krydsfelt {% endif %} {% if location.is_active %} Aktiv {% else %} Inaktiv {% endif %}
Navn
{{ location.name }}
Overordnet
{% if location.parent_location_id and location.parent_location_name %} {{ location.parent_location_name }} {% else %} Ingen {% endif %}
Kontakter
{{ location.contacts|length if location.contacts else 0 }}
Tjenester
{{ location.services|length if location.services else 0 }}
Grundlæggende oplysninger

{{ location.name }}

{{ type_label }}

{% if location.customer_id and location.customer_name %} {{ location.customer_name }} {% else %} {% endif %}

{% if location.is_active %}Aktiv{% else %}Inaktiv{% endif %}

{% if location.phone %} {{ location.phone }} {% else %} {% endif %}

{% if location.email %} {{ location.email }} {% else %} {% endif %}

Adresse

{{ location.address_street | default('—') }}

{{ location.address_city | default('—') }}

{{ location.address_postal_code | default('—') }}

{{ location.address_country | default('DK') }}

Noter

{{ location.notes | default('') }}

Metadata

{{ location.created_at | default('—') }}

{{ location.updated_at | default('—') }}

Hierarki (træ)
{% if location.hierarchy or location.children %} {% else %} Ingen relationer registreret {% endif %}
Kontaktpersoner
{% if location.contacts %}
{% for contact in location.contacts %}
{% if contact.related_contact_id %} {{ contact.contact_name }} {% else %} {{ contact.contact_name }} {% endif %}

{% if contact.role %}{{ contact.role }}{% endif %} {% if contact.is_primary %}Primær{% endif %}

{% if contact.contact_email %}

{{ contact.contact_email }}

{% endif %} {% if contact.contact_phone %}

{{ contact.contact_phone }}

{% endif %}
{% endfor %}
{% else %}

Ingen kontakter registreret

{% endif %}
Åbningstider
{% if location.operating_hours %}
{% for hours in location.operating_hours %} {% endfor %}
Dag Åbner Lukker Status Handlinger
{{ hours.day_name }} {{ hours.open_time | default('—') }} {{ hours.close_time | default('—') }} {% if hours.is_open %} Åben {% else %} Lukket {% endif %}
{% else %}

Ingen åbningstider registreret

{% endif %}
Tjenester
{% if location.services %}
{% for service in location.services %}
{{ service.service_name }}
{% if service.is_available %}Tilgængelig{% else %}Ikke tilgængelig{% endif %}
{% endfor %}
{% else %}

Ingen tjenester registreret

{% endif %}
Kapacitetssporing
{% if location.capacity %}
{% for cap in location.capacity %} {% set usage_pct = ((cap.used_capacity / cap.total_capacity) * 100) | int %}
{{ cap.capacity_type }}
{{ cap.used_capacity }} / {{ cap.total_capacity }}
{{ usage_pct }}% i brug
{% endfor %}
{% else %}

Ingen kapacitetsdata registreret

{% endif %}
Overordnet lokation
{% if location.parent_location_id and location.parent_location_name %} {{ location.parent_location_name }} {% else %} Ingen (øverste niveau) {% endif %}
Underlokationer
{% if location.children %} {% else %} Ingen underlokationer {% endif %}
Tilføj underlokation
Fuld formular

Den hurtige formular opretter direkte under {{ location.name }}. Brug fuld formular, hvis du også vil sætte adresse, noter eller GPS med det samme.

Vægstik
Netværksstik registreret direkte på denne lokation.
Oversigt {% if location.location_type in ['customer_site', 'bygning', 'etage', 'rum'] %} {% endif %}
{% if location.location_type not in ['customer_site', 'bygning', 'etage', 'rum'] %} Vægstik kan oprettes på kundesites, bygninger, etager og rum. {% elif location.wall_outlets %}
{% for outlet in location.wall_outlets %} {% endfor %}
StikStatusPatchpanelSwitch
{{ outlet.outlet_number }}{% if outlet.category %}
{{ outlet.category }}
{% endif %}
{{ outlet.status }}{{ outlet.patch_panel or '—' }}{% if outlet.patch_port %} / {{ outlet.patch_port }}{% endif %}{{ outlet.switch_name or '—' }}{% if outlet.switch_port %} / {{ outlet.switch_port }}{% endif %}
{% else %}Ingen vægstik registreret endnu.{% endif %}
Hierarki (træ)
{% if location.hierarchy or location.children %} {% else %} Ingen relationer registreret {% endif %}
{% if location.location_type == 'rum' and location.has_cross_field %}
Krydsfelt
Patchfelter og porte i dette rum.
{% for field in location.cross_fields %}
{{ field.name }} {{ field.port_count }} porte
{% for port in field.ports %}{% set port_class = 'assigned' if port.outlet_id and port.outlet_status == 'active' else (port.outlet_status if port.outlet_id else '') %}{% endfor %}
{% else %}Ingen krydsfelter oprettet endnu.{% endfor %}
{% endif %}
Hardware på lokation
{% if location.hardware %}
{% for hw in location.hardware %}
{{ hw.brand }} {{ hw.model }}
{{ hw.asset_type }}{% if hw.serial_number %} · {{ hw.serial_number }}{% endif %}
{{ hw.status }}
{% endfor %}
{% else %} Ingen hardware registreret på denne lokation {% endif %}
Ændringshistorik
{% if location.audit_log %}
{% for entry in location.audit_log | reverse %}
{{ entry.event_type }}

{{ entry.created_at }}

{% if entry.user_id %} {{ entry.user_id }} {% endif %}
{% if entry.changes %}

{{ entry.changes }}

{% endif %}
{% endfor %}
{% else %}

Ingen historik tilgængelig

{% endif %}
{% endblock %} {% block scripts %} {% endblock %}