{% extends "base.html" %} {% from "macros.html" import render_stat_card, render_job_status_badge, render_job_type_icon, render_empty_state, render_breadcrumb %} {% block title %}Dashboard - Document Generator{% endblock %} {% block breadcrumb %} {{ render_breadcrumb([ {'title': 'Dashboard'} ]) }} {% endblock %} {% block content %}

Dashboard

Welcome back, {{ current_user.name }}!

{{ render_stat_card( title="Templates", value=stats.templates, icon="bi-file-earmark-text", color="primary", subtitle="Active templates" ) }}
{{ render_stat_card( title="Total Jobs", value=stats.jobs.total if stats.jobs is mapping else stats.jobs, icon="bi-gear", color="info", subtitle="All time" ) }}
{% if stats.jobs is mapping %} {{ render_stat_card( title="Completed", value=stats.jobs.completed, icon="bi-check-circle", color="success", subtitle="Successful jobs" ) }} {% else %} {{ render_stat_card( title="Recent Jobs", value=stats.recent_jobs|length, icon="bi-clock-history", color="warning", subtitle="Last 5 jobs" ) }} {% endif %}
{% if stats.jobs is mapping %} {{ render_stat_card( title="Running", value=stats.jobs.running, icon="bi-arrow-clockwise", color="warning", subtitle="In progress" ) }} {% else %} {{ render_stat_card( title="Active", value="0", icon="bi-activity", color="secondary", subtitle="Running now" ) }} {% endif %}

Quick Actions

New Template

Upload a new document template

Upload
Generate Documents

Create documents from templates

Generate
Merge PDFs

Combine multiple PDF files

Merge
Compress PDF

Reduce PDF file size

Compress
Recent Jobs
View All
{% if stats.recent_jobs %}
{% for job in stats.recent_jobs %} {% endfor %}
Type Details Status Created Actions
{{ render_job_type_icon(job.job_type) }} {{ job.job_type|title }} {% if job.job_type == 'docgen' and job.template %} {{ job.template.title }} {% set input_meta = job.get_input_meta() %} {% if input_meta.total_rows %}
{{ input_meta.total_rows }} rows {% endif %} {% elif job.job_type == 'merge' %} {% set input_meta = job.get_input_meta() %} PDF Merge {% if input_meta.file_count %}
{{ input_meta.file_count }} files {% endif %} {% elif job.job_type == 'compress' %} {% set input_meta = job.get_input_meta() %} PDF Compress {% if input_meta.original_filename %}
{{ input_meta.original_filename }} {% endif %} {% else %} {{ job.job_type|title }} Job {% endif %}
{{ render_job_status_badge(job.status) }} {{ moment(job.created_at).fromNow() if moment else job.created_at.strftime('%m/%d %H:%M') }} {% if job.job_type == 'docgen' %} View {% else %} View {% endif %}
{% else %} {{ render_empty_state( title="No Recent Jobs", description="You haven't run any jobs yet. Start by uploading a template or using our PDF tools.", icon="bi-clock-history", action_text="Get Started", action_url=url_for('templates.new') ) }} {% endif %}
{% endblock %} {% block extra_js %} {% endblock %}