2021-02-10 04:05:06 +00:00
|
|
|
@use crate::{db::{Contact, Instance}, templates::admin};
|
2022-01-17 22:54:45 +00:00
|
|
|
@use activitystreams::iri_string::types::IriString;
|
2020-03-26 03:26:45 +00:00
|
|
|
|
2022-01-17 22:54:45 +00:00
|
|
|
@(instance: &Instance, software: Option<&str>, contact: Option<&Contact>, base: &IriString)
|
2020-03-26 03:26:45 +00:00
|
|
|
|
2022-11-21 20:23:37 +00:00
|
|
|
<section class="instance">
|
|
|
|
<h4 class="padded"><a href="@base">@instance.title</a></h4>
|
|
|
|
<p class="padded">
|
2020-03-26 03:26:45 +00:00
|
|
|
@if let Some(software) = software {
|
2022-11-21 20:23:37 +00:00
|
|
|
Running @software, version @instance.version.
|
2020-03-26 03:26:45 +00:00
|
|
|
}
|
|
|
|
@if instance.reg {
|
2022-11-21 20:23:37 +00:00
|
|
|
<br>Registration is open.
|
|
|
|
@if instance.requires_approval {
|
|
|
|
Accounts must be approved by an admin.
|
|
|
|
}
|
2020-03-26 03:26:45 +00:00
|
|
|
} else{
|
2022-11-21 20:23:37 +00:00
|
|
|
Registration is closed
|
2020-03-26 03:26:45 +00:00
|
|
|
}
|
2022-11-21 20:23:37 +00:00
|
|
|
</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>
|
2020-03-26 03:26:45 +00:00
|
|
|
</div>
|
2022-11-21 20:23:37 +00:00
|
|
|
}
|
|
|
|
@if let Some(contact) = contact {
|
|
|
|
<h5 class="instance-admin">@instance.title's admin:</h5>
|
|
|
|
@:admin(contact, base)
|
|
|
|
}
|
|
|
|
</div>
|
|
|
|
}
|
|
|
|
</section>
|