Add an 'About' section to the relay
This commit is contained in:
+11
-11
@@ -4,15 +4,15 @@
|
||||
@(contact: &Contact, base: &IriString)
|
||||
|
||||
<div class="admin">
|
||||
<div class="left">
|
||||
<figure class="avatar">
|
||||
<img src="@contact.avatar" alt="@contact.display_name's avatar">
|
||||
</figure>
|
||||
</div>
|
||||
<div class="right">
|
||||
<p class="display-name"><a href="@contact.url">@contact.display_name</a></p>
|
||||
<p class="username">
|
||||
@@@contact.username@if let Some(authority) = base.authority_str() {@@@authority}
|
||||
</p>
|
||||
</div>
|
||||
<div class="left">
|
||||
<figure class="avatar">
|
||||
<img src="@contact.avatar" alt="@contact.display_name's avatar">
|
||||
</figure>
|
||||
</div>
|
||||
<div class="right">
|
||||
<p class="display-name"><a href="@contact.url">@contact.display_name</a></p>
|
||||
<p class="username">
|
||||
@@@contact.username@if let Some(authority) = base.authority_str() {@@@authority}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+42
-13
@@ -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() {
|
||||
|
||||
+10
-10
@@ -3,14 +3,14 @@
|
||||
|
||||
@(info: &Info, base: &IriString)
|
||||
|
||||
<article class="info">
|
||||
@if let Some(authority) = base.authority_str() {
|
||||
<h4 class="padded"><a href="@base">@authority</a></h4>
|
||||
<section class="info">
|
||||
@if let Some(authority) = base.authority_str() {
|
||||
<h4 class="padded"><a href="@base">@authority</a></h4>
|
||||
}
|
||||
<p class="padded">
|
||||
Running @info.software, version @info.version.
|
||||
@if info.reg {
|
||||
Registration is open
|
||||
}
|
||||
<p class="padded">
|
||||
Running @info.software, version @info.version.
|
||||
@if info.reg {
|
||||
Registration is open
|
||||
}
|
||||
</p>
|
||||
</article>
|
||||
</p>
|
||||
</section>
|
||||
|
||||
+27
-27
@@ -3,35 +3,35 @@
|
||||
|
||||
@(instance: &Instance, software: Option<&str>, contact: Option<&Contact>, base: &IriString)
|
||||
|
||||
<article class="instance">
|
||||
<h4 class="padded"><a href="@base">@instance.title</a></h4>
|
||||
<p class="padded">
|
||||
<section class="instance">
|
||||
<h4 class="padded"><a href="@base">@instance.title</a></h4>
|
||||
<p class="padded">
|
||||
@if let Some(software) = software {
|
||||
Running @software, version @instance.version.
|
||||
Running @software, version @instance.version.
|
||||
}
|
||||
@if instance.reg {
|
||||
<br>Registration is open.
|
||||
@if instance.requires_approval {
|
||||
Accounts must be approved by an admin.
|
||||
}
|
||||
} else{
|
||||
Registration is closed
|
||||
<br>Registration is open.
|
||||
@if instance.requires_approval {
|
||||
Accounts must be approved by an admin.
|
||||
}
|
||||
</p>
|
||||
@if !instance.description.trim().is_empty() || contact.is_some() {
|
||||
<div class="instance-info">
|
||||
@if !instance.description.trim().is_empty() {
|
||||
<h5 class="instance-description">@instance.title's description:</h5>
|
||||
<div class="description">
|
||||
<div class="please-stay">
|
||||
@Html(instance.description.trim())
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if let Some(contact) = contact {
|
||||
<h5 class="instance-admin">@instance.title's admin:</h5>
|
||||
@:admin(contact, base)
|
||||
}
|
||||
} else{
|
||||
Registration is closed
|
||||
}
|
||||
</p>
|
||||
@if !instance.description.trim().is_empty() || contact.is_some() {
|
||||
<div class="instance-info">
|
||||
@if !instance.description.trim().is_empty() {
|
||||
<h5 class="instance-description">@instance.title's description:</h5>
|
||||
<div class="description">
|
||||
<div class="please-stay">
|
||||
@Html(instance.description.trim())
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</article>
|
||||
}
|
||||
@if let Some(contact) = contact {
|
||||
<h5 class="instance-admin">@instance.title's admin:</h5>
|
||||
@:admin(contact, base)
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</section>
|
||||
|
||||
Reference in New Issue
Block a user