Add an 'About' section to the relay

This commit is contained in:
asonix
2022-11-21 14:23:37 -06:00
parent 5043892981
commit a77a4cde22
9 changed files with 174 additions and 70 deletions
+42 -13
View File
@@ -4,7 +4,7 @@ data::Node,
templates::{info, instance, statics::index_css},
};
@(nodes: &[Node], config: &Config)
@(local: &[Node], nodes: &[Node], config: &Config)
<!doctype html>
<html>
@@ -24,16 +24,23 @@ templates::{info, instance, statics::index_css},
</div>
</header>
<main>
<section>
<h3>@nodes.len() Connected Servers</h3>
@if nodes.is_empty() {
<p>There are no connected servers at this time.</p>
} else {
@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 nodes {
@for node in local {
@if let Some(inst) = node.instance.as_ref() {
<li>
@:instance(inst, node.info.as_ref().map(|info| { info.software.as_ref() }), node.contact.as_ref(), &node.base)
@:instance(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() {
@@ -45,10 +52,32 @@ templates::{info, instance, statics::index_css},
}
</ul>
}
</section>
<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>
@:instance(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>
@:info(inf, &node.base)
</li>
}
}
}
</ul>
</article>
}
<article>
<h3>Joining</h3>
<article class="joining">
<section class="joining">
@if config.restricted_mode() {
<h4>
This relay is Restricted
@@ -80,8 +109,8 @@ templates::{info, instance, statics::index_css},
Consult the documentation for your server. It's likely that it follows either
Mastodon or Pleroma's relay formatting.
</p>
</article>
</section>
</section>
</article>
</main>
<footer>
@if let Some(blurb) = config.footer_blurb() {