relay/templates/index.rs.html

125 lines
3.4 KiB
HTML
Raw Permalink Normal View History

@use crate::{
config::{Config, UrlKind},
data::Node,
2023-01-23 14:38:55 +00:00
templates::{info_html, instance_html, statics::index_css},
};
2020-03-20 18:40:18 +00:00
2022-11-21 20:23:37 +00:00
@(local: &[Node], nodes: &[Node], config: &Config)
2020-03-20 18:40:18 +00:00
<!doctype html>
<html>
<head lang="en">
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>@config.hostname() | ActivityPub Relay</title>
<link rel="stylesheet" href="/static/@index_css.name" type="text/css" />
</head>
<body>
<header>
<div class="header-text">
<h1>@Config::software_name()<span class="smaller">@Config::software_version()</span></h1>
<p>on @config.hostname()</p>
</div>
</header>
<main>
2022-11-21 20:23:37 +00:00
@if !local.is_empty() || config.local_blurb().is_some() {
<article>
<h3>About</h3>
<section class="local-explainer">
@if let Some(blurb) = config.local_blurb() {
@blurb
} else {
<p>These domains are run by the same admins as this relay.</p>
}
</section>
@if !local.is_empty() {
<ul>
@for node in local {
@if let Some(inst) = node.instance.as_ref() {
<li>
2023-01-23 14:38:55 +00:00
@:instance_html(inst, node.info.as_ref().map(|info| { info.software.as_ref() }), node.contact.as_ref(),
2022-11-21 20:23:37 +00:00
&node.base)
</li>
} else {
@if let Some(inf) = node.info.as_ref() {
<li>
2023-01-23 14:38:55 +00:00
@:info_html(inf, &node.base)
2022-11-21 20:23:37 +00:00
</li>
}
}
}
</ul>
}
</article>
}
<article>
<h3>Joining</h3>
2022-11-21 20:23:37 +00:00
<section class="joining">
@if config.restricted_mode() {
<h4>
This relay is Restricted
</h4>
<p>
This relay is currently in Restricted Mode, which means servers need to be approved ahead of time by the relay
administrator. Please contact the admin before attempting to join.
</p>
} else {
<p>
If you are the admin of a server that supports activitypub relays, you can add
this relay to your server.
</p>
}
<h4>Mastodon</h4>
<p>
Mastodon admins can add this relay by adding
<pre>@config.generate_url(UrlKind::Inbox)</pre> in their relay settings.
</p>
<h4>Pleroma</h4>
<p>
Pleroma admins can add this relay by adding
<pre>@config.generate_url(UrlKind::Actor)</pre> to their relay settings.
</p>
<h4>Others</h4>
<p>
Consult the documentation for your server. It's likely that it follows either
Mastodon or Pleroma's relay formatting.
</p>
2022-11-21 20:23:37 +00:00
</section>
</article>
@if !nodes.is_empty() {
<article>
<h3>@nodes.len() Connected Servers</h3>
<ul>
@for node in nodes {
@if let Some(inst) = node.instance.as_ref() {
<li>
2023-01-23 14:38:55 +00:00
@:instance_html(inst, node.info.as_ref().map(|info| { info.software.as_ref() }), node.contact.as_ref(),
&node.base)
</li>
} else {
@if let Some(inf) = node.info.as_ref() {
<li>
2023-01-23 14:38:55 +00:00
@:info_html(inf, &node.base)
</li>
}
}
}
</ul>
</article>
}
</main>
<footer>
2022-11-21 17:16:21 +00:00
@if let Some(blurb) = config.footer_blurb() {
<div>@blurb</div>
}
<p>
The source code for this project can be found at
<a href="@config.source_code()">@config.source_code()</a>
</p>
</footer>
</body>
2020-03-20 18:40:18 +00:00
</html>