3 lines
1.6 KiB
HTML
3 lines
1.6 KiB
HTML
{% extends 'base.html' %}{% from 'macros.html' import page_header,bars,idea_card with context %}
|
|
{% block content %}{{ page_header(t('analytics'),t('analytics_hint')) }}<div class="action-row"><form method="get" class="inline-form"><label>{{ t('period') }}<select name="days">{% for val,key in [('7','week'),('30','month'),('90','quarter')] %}<option value="{{ val }}" {{ 'selected' if request.args.get('days','30')==val }}>{{ t(key) }}</option>{% endfor %}</select></label><button class="button secondary">{{ t('apply') }}</button></form><a class="button primary" href="{{ url_for('web.export_excel',days=request.args.get('days','30')) }}">↓ {{ t('export_excel') }}</a></div><div class="detail-grid"><section class="panel"><h2>{{ t('monthly') }}</h2>{{ bars(months,t('monthly')) }}</section><section class="panel"><h2>{{ t('categories') }}</h2>{{ bars(groups,t('categories')) }}</section><section class="panel"><h2>{{ t('geography') }}</h2>{{ bars(geography,t('geography')) }}</section><section class="panel"><h2>{{ t('growth') }}</h2><table><thead><tr><th>{{ t('category') }}</th><th>{{ t('current') }}</th><th>{{ t('previous') }}</th><th>{{ t('growth') }}</th></tr></thead><tbody>{% for item in growth %}<tr><td>{{ item.label }}</td><td>{{ item.current }}</td><td>{{ item.previous }}</td><td>{% if item.previous %}{{ ((item.current-item.previous)/item.previous*100)|round|int }}%{% else %}{{ t('no_comparison') }}{% endif %}</td></tr>{% endfor %}</tbody></table></section></div><h2>{{ t('opportunities') }}</h2><div class="ideas-grid">{% for item in top %}{{ idea_card(item) }}{% endfor %}</div>{% endblock %}
|