caveman/gatherer/templates/trends.html

87 lines
3.0 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>#FediBuzz: {% if language.is_some() %}{{ language.as_ref().unwrap() }}{% else %}Trends in the Fediverse{% endif %}</title>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="icon" type="image/png" sizes="16x16" href="/assets/favicon16.png"/>
<link rel="icon" type="image/png" sizes="48x48" href="/assets/favicon48.png"/>
<link rel="stylesheet" title="Default" type="text/css" href="/assets/style.css?11"/>
<meta property="og:url" content="https://fedi.buzz/"/>
<meta property="og:type" content="website"/>
<meta property="og:title" content="FediBuzz"/>
<meta property="og:description" content="Trends in the Fediverse"/>
<meta property="og:image" content="https://fedi.buzz/assets/favicon48.png"/>
<meta name="lightning" content="astro@getalby.com"/>
<meta name="flattr:id" content="4xdw9w"/>
</head>
<body>
<header>
<h1>Fedi&#173;Buzz</h1>
<p>Trends in the Fedi&#173;verse</p>
</header>
<nav>
<h2>By language:</h2>
<ul class="languages">
<li>
{% if language == None %}
<b>any</b>
{% else %}
<a href="/">any</a>
{% endif %}
</li>
{% for l in languages[..50.min(languages.len())] %}
<li>
{% if language.as_ref() == Some(l) %}
<b>{{ l }}</b>
{% else %}
<a href="/in/{{ l }}">{{ l }}</a>
{% endif %}
</li>
{% endfor %}
</ul>
</nav>
<main>
{% for ((_until, period, result), title) in results.iter().zip(["Now", "Today", "This week"]) %}
<section>
<h2>{{ title }}</h2>
{% for (score, tag) in result %}
<article data-images="{{ tag_images.get(tag.name).unwrap() }}">
<div class="title" data-hours="{{ tag.hour_scores_data(4 * period.deref()) }}">
<h3>{{ tag.spelling() }}</h3>
<p class="score">{{ format!("{}{:.0}%", if *score > 1. { "+" } else { "" }, 100. * *score - 100.) }}</p>
</div>
<ul class="hosts">
{% for (_count, host) in tag.hosts_set().into_iter().rev().take(5) %}
<li>
<a href="https://{{ host }}/tags/{{ tag.name }}">
{{ host }}
</a>
</li>
{% endfor %}
</ul>
</article>
{% endfor %}
</section>
{% endfor %}
</main>
<footer>
<p>
run by <a rel="me" href="https://c3d2.social/@astro">@astro&#173;@c3d2.social</a>
</p>
<p>
Get live ActivityPub content with the <a rel="me" href="https://relay.fedi.buzz">#FediBuzz relay</a>
</p>
</footer>
<script type="text/javascript" src="/assets/hour_graphs.js?4">
</script>
<script type="text/javascript" src="/assets/tag_images.js?3">
</script>
</body>
</html>