{% extends "base_authenticated.html" %} {% block title %}Dashboard - QR Code Management{% endblock %} {% block extra_head %} {% endblock %} {% block content %}

Welcome back, {{ session.full_name }}!

Manage your QR codes organized by projects

{% if session.role == 'admin' %}

{{ qr_codes|length }}

Total QR Codes

{{ qr_codes|selectattr('active_status', 'equalto', True)|list|length }}

Active QR Codes

{{ qr_codes|selectattr('active_status', 'equalto', False)|list|length }}

Inactive QR Codes

{{ projects|length if projects else 0 }}

Total Projects

{% endif %}
{% if search_name or search_status %}
Showing {{ qr_codes|length }} results {% if search_name %}matching "{{ search_name }}"{% endif %} {% if search_status %}with status: {{ search_status }}{% endif %} Clear Filters
{% if qr_codes %}

Search Results

{{ qr_codes|length }} QR code{{ 's' if qr_codes|length != 1 else '' }} found {% set projects_with_results = qr_codes|map(attribute='project_id')|select|unique|list|length %} {% if projects_with_results > 0 %} across {{ projects_with_results }} project{{ 's' if projects_with_results != 1 else '' }} {% endif %}
{% for project in projects %} {% set project_search_results = qr_codes|selectattr('project_id', 'equalto', project.id)|list %} {% if project_search_results %}

{{ project.name }}

{% if project.description %}

{{ project.description }}

{% endif %}
{{ project_search_results|length }} QR code{{ 's' if project_search_results|length != 1 else '' }}
{% for qr in project_search_results %}
QR Code for {{ qr.name }}

{{ qr.name }}

{{ qr.location }}
{% if qr.location_address %}
{{ qr.location_address }}
{% endif %} {% if qr.location_event %}
{{ qr.location_event }}
{% endif %}
{{ get_qr_code_checkin_count(qr.id) }} check-ins
{% if qr.qr_url %}
{{ qr.qr_url[:40] }}{% if qr.qr_url|length > 40 %}...{% endif %}
{% endif %} {{ 'Active' if qr.active_status else 'Inactive' }}
{% if session.role == 'admin' %} {% endif %}
{% endfor %}
{% endif %} {% endfor %} {% set unassigned_search_results = qr_codes|selectattr('project_id', 'equalto', None)|list %} {% if unassigned_search_results %}

Unassigned QR Codes

QR codes not assigned to any project

{{ unassigned_search_results|length }} QR code{{ 's' if unassigned_search_results|length != 1 else '' }}
{% for qr in unassigned_search_results %}
QR Code for {{ qr.name }}

{{ qr.name }}

{{ qr.location }}
{% if qr.location_address %}
{{ qr.location_address }}
{% endif %} {% if qr.location_event %}
{{ qr.location_event }}
{% endif %}
{{ get_qr_code_checkin_count(qr.id) }} check-ins
{% if qr.qr_url %}
{{ qr.qr_url[:40] }}{% if qr.qr_url|length > 40 %}...{% endif %}
{% endif %} {{ 'Active' if qr.active_status else 'Inactive' }}
{% if session.role == 'admin' %} {% endif %}
{% endfor %}
{% endif %} {% else %}

No QR Codes Found

No QR codes match your search criteria. Try adjusting your filters.

Clear Filters
{% endif %} {% else %}
{% if projects %}
{% for project in projects %} {% set project_qr_codes = qr_codes|selectattr('project_id', 'equalto', project.id)|list %}

{{ project.name }}

{% if project.description %}

{{ project.description }}

{% endif %}
{{ project_qr_codes|length }} QR Code{{ 's' if project_qr_codes|length != 1 else '' }}
{{ 'Active' if project.active_status else 'Inactive' }}
{% if project_qr_codes %}
{% for qr in project_qr_codes[:12] %}
QR Code for {{ qr.name }}

{{ qr.name }}

{{ qr.location }}
{% if qr.location_address %}
{{ qr.location_address }}
{% endif %}
{{ get_qr_code_checkin_count(qr.id) }} check-ins
{{ 'Active' if qr.active_status else 'Inactive' }}
{% if session.role == 'admin' %} {% endif %}
{% endfor %} {% if project_qr_codes|length > 12 %} View All Project's QR Codes {% endif %}
{% else %}

No QR Codes in this Project

Create your first QR code for this project

Create QR Code
{% endif %}
{% endfor %}
{% endif %}
{% set unassigned_qr_codes = qr_codes|selectattr('project_id', 'equalto', None)|list %} {% if unassigned_qr_codes %}

Unassigned QR Codes

{{ unassigned_qr_codes|length }} QR Code{{ 's' if unassigned_qr_codes|length != 1 else '' }}
{% for qr in unassigned_qr_codes %}
QR Code for {{ qr.name }}

{{ qr.name }}

{{ qr.location }}
{% if qr.location_address %}
{{ qr.location_address }}
{% endif %}
{{ get_qr_code_checkin_count(qr.id) }} check-ins
{% if qr.qr_url %}
{{ qr.qr_url[:50] }}{% if qr.qr_url|length > 50 %}...{% endif %}
{% endif %}
{{ 'Active' if qr.active_status else 'Inactive' }}
{% if session.role == 'admin' %} {% endif %}
{% endfor %}
{% endif %} {% if not qr_codes and not projects %}
{% if search_name or search_status %}

No QR Codes Found

No QR codes match your search criteria. {% if search_name %}Try a different name{% endif %} {% if search_name and search_status %} or {% endif %} {% if search_status %}try changing the status filter{% endif %}.

Clear Filters {% elif not projects %}

Welcome to Your QR Code Dashboard

Get started by creating your first project and QR codes to organize your digital assets effectively.

Create Your First Project {% endif %}
{% endif %}
{% endif %}
{% endblock %} {% block extra_scripts %} {% endblock %}