{% extends base_template|default:"base.html" %} {% load i18n %} {% load static %} {% load asset_tags %} {% block head %} {% if asset.geom or asset.lon or asset.lat %} {% endif %} {% endblock head %} {% block extra_head %} {% if asset.geom or asset.lon or asset.lat %} {% endif %} {% endblock extra_head %} {% block upleft %} {% if mobile_view and back_url %} {% elif mobile_view or is_mobile %} {% else %} {% endif %} {% endblock upleft %} {% block title %} {% if mobile_view %} {{ asset.code }} - {% translate "Détails" %} {% else %} {{ product_name }} {% endif %} {% endblock title %} {% block upright %} {% endblock upright %} {% block content %}
{% if allowed_update_fields and not mobile_view %}

{% translate "Asset" %} : {{ asset.code }}

{% if thematic.icon %} {% endif %} {% if thematic.name %} {{ thematic.name }} — {% endif %} {{ asset_verbose_name }}
{% if 'archive' in allowed_actions %} {% endif %} {% if 'replace' in allowed_actions %} {% endif %}
{% else %}

{% if thematic.icon %} {% endif %} {% translate "Asset" %} : {{ asset }}

{% if thematic.icon %} {% endif %} {% if thematic.name %} {{ thematic.name }} — {% endif %} {{ asset_verbose_name }}
{% endif %} {% if mobile_view and allowed_update_fields %}
{% if 'archive' in allowed_actions %} {% endif %} {% if 'replace' in allowed_actions %} {% endif %}
{% endif %}
{% translate "Informations générales" %}
{% if asset.validation_status is not None or 'validation_status' in allowed_update_fields %} {% endif %} {% if asset.funding_program or 'funding_program' in allowed_update_fields %} {% endif %} {% get_asset_specific_fields asset as asset_specific_fields %} {% if asset_specific_fields %} {% endif %} {% for field in asset_specific_fields %} {% endfor %}
{% translate "Code" %}
{{ asset.code }}
{% translate "Nom" %} (FR)
{{ asset.name_fr|default:"-" }}
{% translate "Nom" %} (NL)
{{ asset.name_nl|default:"-" }}
{% translate "Statut" %}
{% if asset.status == 'active' %} {{ asset.get_status_display }} {% elif asset.status == 'damaged' %} {{ asset.get_status_display }} {% elif asset.status == 'to_replace' %} {{ asset.get_status_display }} {% else %} {{ asset.get_status_display }} {% endif %}
{% translate "Statut de validation" %}
{% if asset.validation_status == 'validated' %} {{ asset.get_validation_status_display }} {% elif asset.validation_status == 'to_be_validated' %} {{ asset.get_validation_status_display }} {% elif asset.validation_status == 'to_be_completed' %} {{ asset.get_validation_status_display }} {% elif asset.validation_status == 'rejected' %} {{ asset.get_validation_status_display }} {% else %} {{ asset.get_validation_status_display|default:"-" }} {% endif %}
{% translate "Catégorie" %}
{{ asset.category|default:"-" }}
{% translate "Installé le" %}
{{ asset.installation_date|date:"d/m/Y"|default:"-" }}
{% translate "N° de série" %}
{{ asset.serial_number|default:"-" }}
{% translate "Marque" %}
{{ asset.brand|default:"-" }}
{% translate "Programme / Financement" %}
{{ asset.funding_program|default:"-" }}
{% translate "Durée de garantie" %}
{% if asset.warranty_duration %} {{ asset.warranty_duration }} {% translate "mois" %} {% with remaining=asset|warranty_remaining_months %} {% if remaining is not None %} — {% if remaining > 0 %} {% blocktranslate with n=remaining %}{{ n }} mois restants{% endblocktranslate %} {% elif remaining == 0 %} {% translate "Expire ce mois-ci" %} {% else %} {% blocktranslate with n=remaining|cut:"-" %}Expirée ({{ n }} mois){% endblocktranslate %} {% endif %} {% endif %} {% endwith %} {% else %}-{% endif %}
{% translate "Dernière inspection" %}
{{ asset.last_inspection_date|date:"d/m/Y"|default:"-" }}
{% translate "Attributs spécifiques" %}
{{ field.label }}
{{ field.display_value }}
{% if field.field_type == 'boolean' %} {% elif field.field_type == 'select' %} {% elif field.field_type == 'number' %} {% elif field.field_type == 'date' %} {% else %} {% endif %}
{% asset_documents asset %} {% block extra_blocks %}{% endblock extra_blocks %} {% if is_admin and content_type %}
{% translate "Chargement des permissions…" %}
{% endif %} {% get_asset_parents asset as parent_groups %} {% get_asset_children_tree asset as children_tree %} {% if parent_groups or children_tree or allowed_update_fields %}
{% translate "Assets liés" %}
{% if allowed_update_fields %} {% endif %}
{% if not parent_groups and not children_tree %}

{% translate "Aucun asset lié." %}

{% endif %} {% include "assets/components/asset_children_tree.html" with children_tree=parent_groups editable=allowed_update_fields parent_model=asset_model parent_id=asset.id %} {% include "assets/components/asset_children_tree.html" with children_tree=children_tree editable=allowed_update_fields parent_model=asset_model parent_id=asset.id %}
{% endif %} {% if asset_replacements and asset_replacements|length > 1 %}
{% translate "Historique des remplacements" %}
{% for replacement in asset_replacements %}
{% if thematic_code %} {{ replacement.code }} {% else %} {{ replacement.code }} {% endif %}
{% if not forloop.last %}
{% endif %}
{% endfor %}
{% for replacement in asset_replacements %} {% endfor %}
{% translate "Code" %} {% translate "Statut" %} {% translate "Installé le" %} {% translate "Désinstallé le" %} {% translate "Durée" %}
{% if thematic_code %} {{ replacement.code }} {% else %} {{ replacement.code }} {% endif %} {% if replacement.status == 'active' %} {{ replacement.get_status_display }} {% elif replacement.status == 'damaged' %} {{ replacement.get_status_display }} {% elif replacement.status == 'to_replace' %} {{ replacement.get_status_display }} {% elif replacement.status == 'removed' %} {{ replacement.get_status_display }} {% else %} {{ replacement.get_status_display }} {% endif %} {{ replacement.installation_date|date:"d/m/Y H:i"|default:"-" }} {{ replacement.uninstallation_date|date:"d/m/Y H:i"|default:"-" }} {% if replacement.installation_date and replacement.uninstallation_date %} {% with duration=replacement.uninstallation_date|timeuntil:replacement.installation_date %} {{ duration }} {% endwith %} {% elif replacement.installation_date %} {% translate "En service" %} {% else %} - {% endif %}
{% endif %}
{% asset_model_card asset %} {% asset_location_link asset %}
{% translate "Géolocalisation" %}
{% if asset.lon and asset.lat %} {% load l10n %} {% endif %}
{{ asset.lon|default:"-" }}
{{ asset.lat|default:"-" }}
{% if asset.geom %}
{% if asset.geom.geom_type == 'Point' %} Point {% elif asset.geom.geom_type == 'LineString' %} Ligne: {{ asset.geom.num_points }} points {% elif asset.geom.geom_type == 'Polygon' %} Polygone: {{ asset.geom.num_points }} points {% else %} {{ asset.geom.geom_type }} {% endif %}
{% endif %}
{% asset_interventions asset %}
{% asset_inspections asset %}
{% include 'assets/components/asset_history.html' %}
{% if 'replace' in allowed_actions %} {% endif %} {% if allowed_update_fields %} {% endif %} {% if intersection_assets_geojson %} {{ intersection_assets_geojson|json_script:"intersection-assets-geojson" }} {% endif %} {% if connection_lines_geojson %} {{ connection_lines_geojson|json_script:"connection-lines-geojson" }} {% endif %} {% endblock content %} {% block script %} {% endblock script %} {% block extra_scripts %} {% endblock extra_scripts %}