41 lines
2.5 KiB
HTML
41 lines
2.5 KiB
HTML
{% extends 'base.html' %}{% from 'macros.html' import page_header,empty with context %}
|
|
{% block content %}{{ page_header(t('competitors'),t('competitors_hint')) }}
|
|
<section aria-labelledby="competitor-summary">
|
|
<h2 id="competitor-summary">{{ t('competitor_summary') }}</h2>
|
|
{% if companies %}
|
|
<div class="stats-grid">
|
|
{% for label, value in summary.items() %}
|
|
<div class="stat-card">
|
|
<div class="stat-title">{{ t(label) }}</div>
|
|
<strong class="stat-value">{{ value }}</strong>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
{% else %}
|
|
<p class="panel">{{ t('no_monitored_sites') }}</p>
|
|
{% endif %}
|
|
</section>
|
|
{% if user.role in ['admin','analyst'] %}<form class="filter-panel panel" method="post"><input type="hidden" name="csrf" value="{{ csrf }}"><label>{{ t('company') }}<input name="name" required maxlength="100"></label><label class="search-label">{{ t('website') }}<input name="url" type="url" required placeholder="{{ t('website_hint') }}"></label><button class="button primary">+ {{ t('add') }}</button></form>{% endif %}
|
|
{% if companies %}
|
|
<div class="company-grid">
|
|
{% for company in companies %}
|
|
<article class="panel company-card">
|
|
<div class="company-icon">{{ company.name[0] }}</div>
|
|
<h2>{{ company.name }}</h2>
|
|
<a href="{{ company.url }}" target="_blank" rel="noopener noreferrer">{{ t('website') }} ↗</a>
|
|
<p><span class="status-dot {{ company.status }}"></span>{{ t(company.status) }}</p>
|
|
<small>{{ t('last_update') }}: {% if company.updated %}{{ company.updated[:16]|replace('T',' ') }} UTC{% else %}{{ t('date_unknown') }}{% endif %}</small>
|
|
<p>
|
|
{% if company.last_change %}
|
|
{{ t('last_detected_change') }}: <time datetime="{{ company.last_change }}">{{ day(company.last_change) }}</time>
|
|
{% else %}
|
|
{{ t('no_detected_changes') }}
|
|
{% endif %}
|
|
</p>
|
|
</article>
|
|
{% endfor %}
|
|
</div>
|
|
{% endif %}
|
|
<h2>{{ t('alerts') }}</h2>
|
|
{% for item in changes %}<article class="panel change-card"><div class="section-heading"><h2>{{ item.name }}</h2><span>{{ day(item.created) }}</span></div><h3>{{ t('change') }}</h3><p>{{ t('change_hint') }}</p><h3>{{ t('why_important') }}</h3><p>{{ t('hypothesis') }}</p><h3>{{ t('reaction') }}</h3><p>{{ t('reaction_hint') }}</p><a href="{{ item.url }}" target="_blank" rel="noopener noreferrer">{{ t('original') }} ↗</a><details><summary>{{ t('details') }}</summary><h4>{{ t('previous') }}</h4><p>{{ item.previous }}</p><h4>{{ t('current') }}</h4><p>{{ item.current }}</p></details></article>{% else %}{{ empty() }}{% endfor %}{% endblock %}
|