caveman/gatherer/templates/trends.html

80 lines
2.6 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?3"/>
<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/favicon48.png">
</head>
<body>
<header>
<h1>FediBuzz</h1>
<p>Trends in the Fediverse</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"]) %}
<article>
<h2>{{ title }}</h2>
{% for (score, tag) in result %}
<section>
<div class="title" data-hours="{{ tag.hour_scores_data(48) }}">
<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>
</section>
{% endfor %}
</article>
{% endfor %}
</main>
<footer>
<p>
made by <a href="https://chaos.social/@astro">@astro@chaos.social</a>
</p>
</footer>
<script type="text/javascript" src="/assets/hour_graphs.js">
</script>
</body>
</html>