{% extends "base.html" %} {% block title %}{{ t('dashboard.title') }} - {{ wiki_name }}{% endblock %} {% block content %}

{{ t('dashboard.title') }}

{{ total }} {{ t('dashboard.total_articles') }}
{{ "%.0f"|format(avg_score * 100) }}% {{ t('dashboard.avg_quality') }}
{{ maturity_dist.get('mature', 0) }} {{ t('dashboard.mature') }}
{{ maturity_dist.get('review', 0) }} {{ t('dashboard.review') }}
{{ maturity_dist.get('draft', 0) }} {{ t('dashboard.draft') }}
{{ maturity_dist.get('stub', 0) }} {{ t('dashboard.stub') }}

{{ t('dashboard.maturity_distribution') }}

{% set total_count = total or 1 %} {% if maturity_dist.get('mature', 0) > 0 %}
{{ maturity_dist.mature }}
{% endif %} {% if maturity_dist.get('review', 0) > 0 %}
{{ maturity_dist.review }}
{% endif %} {% if maturity_dist.get('draft', 0) > 0 %}
{{ maturity_dist.draft }}
{% endif %} {% if maturity_dist.get('stub', 0) > 0 %}
{{ maturity_dist.stub }}
{% endif %}

{{ t('dashboard.by_category') }}

{% if cat_data %}
{% set max_count = cat_data[0].count if cat_data else 1 %} {% for cat in cat_data %} {% endfor %}
{% else %}

{{ t('dashboard.no_category_data') }}

{% endif %}

{{ t('dashboard.recent_activity') }}

{% if recent %}
{% for a in recent %}
{{ a.title | truncate(40, True, '...') }}
{{ a.category.split('/')[0] }} {{ a.last_modified[:10] if a.last_modified else '' }}
{% endfor %}
{% else %}

{{ t('dashboard.no_recent_activity') }}

{% endif %}

{{ t('dashboard.tag_cloud') }}

{% if tag_cloud %}
{% set max_tag_count = tag_cloud[0].count if tag_cloud else 1 %} {% for item in tag_cloud %} {% set size = 0.75 + (item.count / max_tag_count) * 0.9 %} {% set opacity = 0.6 + (item.count / max_tag_count) * 0.4 %} {{ item.tag }} {% endfor %}
{% else %}

{{ t('dashboard.no_tags') }}

{% endif %}
{% if access_stats %}

{{ t('dashboard.top_articles') }}

{% if access_stats.top_articles %} {% for item in access_stats.top_articles %} {% endfor %}
{{ t('dashboard.article') }}{{ t('dashboard.views') }}
{{ item.article_id | truncate(30) }} {{ item.views }}
{% else %}

{{ t('dashboard.no_data') }}

{% endif %}

{{ t('dashboard.top_queries') }}

{% if access_stats.top_queries %} {% for item in access_stats.top_queries %} {% endfor %}
{{ t('dashboard.query') }}{{ t('dashboard.count') }}
{{ item.query }} {{ item.count }}
{% else %}

{{ t('dashboard.no_data') }}

{% endif %}
{% endif %}

{{ t('dashboard.quality_table') }}

{% for r in reports %} {% endfor %}
{{ t('common.title') }} {{ t('common.category') }} {{ t('common.maturity') }} {{ t('common.quality') }} {{ t('dashboard.issues') }}
{{ r.title }} {{ r.category }} {{ r.maturity }}
{{ "%.0f"|format(r.score * 100) }}%
{% if r.errors > 0 %}{{ r.errors }}E{% endif %} {% if r.warnings > 0 %}{{ r.warnings }}W{% endif %} {% if r.errors == 0 and r.warnings == 0 %}OK{% endif %}
{% endblock %}