{% macro printer_status_badge(status, size='sm') %} {% set status_config = { 'online': { 'color': 'green', 'icon': 'fa-check-circle', 'text': 'Online', 'description': 'Drucker ist einsatzbereit' }, 'offline': { 'color': 'red', 'icon': 'fa-times-circle', 'text': 'Offline', 'description': 'Drucker ist nicht erreichbar' }, 'busy': { 'color': 'blue', 'icon': 'fa-spinner', 'text': 'Beschäftigt', 'description': 'Drucker druckt gerade' }, 'idle': { 'color': 'yellow', 'icon': 'fa-pause-circle', 'text': 'Bereit', 'description': 'Drucker ist online aber inaktiv' }, 'available': { 'color': 'green', 'icon': 'fa-check-circle', 'text': 'Verfügbar', 'description': 'Drucker ist verfügbar' }, 'error': { 'color': 'red', 'icon': 'fa-exclamation-triangle', 'text': 'Fehler', 'description': 'Drucker hat einen Fehler' } } %} {% set config = status_config.get(status, status_config['offline']) %} {% set size_classes = { 'xs': 'px-2 py-1 text-xs', 'sm': 'px-3 py-1 text-sm', 'md': 'px-4 py-2 text-base', 'lg': 'px-6 py-3 text-lg' } %} {{ config.text }} {% endmacro %} {% macro printer_status_indicator(status, show_text=true) %} {% set status_config = { 'online': { 'color': 'green', 'icon': 'fa-circle', 'text': 'Online' }, 'offline': { 'color': 'red', 'icon': 'fa-circle', 'text': 'Offline' }, 'busy': { 'color': 'blue', 'icon': 'fa-circle', 'text': 'Beschäftigt' }, 'idle': { 'color': 'yellow', 'icon': 'fa-circle', 'text': 'Bereit' }, 'available': { 'color': 'green', 'icon': 'fa-circle', 'text': 'Verfügbar' } } %} {% set config = status_config.get(status, status_config['offline']) %}
{{ printer.location or 'Kein Standort' }}