add info banner, slightly adjust about page

This commit is contained in:
Miss Pasture 2021-06-03 22:18:31 -04:00
parent 7fbd12102b
commit 14f187a970
6 changed files with 28 additions and 13 deletions

View File

@ -48,6 +48,7 @@ If both whitelisting and blacklisting are set, only the whitelisting will be act
* `Instance:PublishReplies` (default: false) to enable or disable replies publishing.
* `Instance:UnlistedTwitterAccounts` (default: null) to enable unlisted publication for selected twitter accounts, separated by `;` (please limit this to brands and other public profiles).
* `Instance:TwitterDomain` (default: twitter.com) redirect to a different domain (i.e. a Nitter instance) instead of Twitter
* `Instance:InfoBanner` (default: '') text to show in a banner on the front page
# Docker Compose full example
@ -80,6 +81,7 @@ services:
+ - Instance:PublishReplies=true
+ - Instance:UnlistedTwitterAccounts=cocacola;twitter
+ - Instance:TwitterDomain=twiiit.com
+ - Instance:InfoBanner=This is my BirdsiteLIVE instance. There are many like it, but this one is mine.
networks:
[...]

View File

@ -12,5 +12,7 @@
public string UnlistedTwitterAccounts { get; set; }
public string TwitterDomain { get; set; }
public string InfoBanner { get; set; }
}
}

View File

@ -6,21 +6,24 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using BirdsiteLive.Models;
using BirdsiteLive.Common.Settings;
namespace BirdsiteLive.Controllers
{
public class HomeController : Controller
{
private readonly ILogger<HomeController> _logger;
private readonly InstanceSettings _instanceSettings;
public HomeController(ILogger<HomeController> logger)
public HomeController(ILogger<HomeController> logger, InstanceSettings instanceSettings)
{
_logger = logger;
_instanceSettings = instanceSettings;
}
public IActionResult Index()
{
return View();
return View(_instanceSettings);
}
public IActionResult Privacy()

View File

@ -1,4 +1,4 @@
@model BirdsiteLive.Services.CachedStatistics
@model BirdsiteLive.Services.CachedStatistics
@{
ViewData["Title"] = "About";
}
@ -13,7 +13,7 @@
<br /><br />
BirdsiteLIVE does not make any public posts; every post is scoped appropriately using the "followers-only" or "unlisted" ActivityPub audiences. See "Why do accounts I follow on this node post followers-only?", below.
BirdsiteLIVE does not make any public posts; every post is scoped appropriately using the "followers-only" or "unlisted" ActivityPub audiences.
</p>
<h4 id="followers-only">Why do accounts I follow on this node post followers-only?</h4>

View File

@ -1,7 +1,6 @@
@using BirdsiteLive.Controllers;
@{
ViewData["Title"] = "Home Page";
}
@using BirdsiteLive.Common.Settings;
@model InstanceSettings
@{ ViewData["Title"] = "Home Page"; }
<div class="text-center">
<h1 class="display-4">Welcome</h1>
@ -10,7 +9,7 @@
This instance is a Twitter to ActivityPub bridge.<br />
<a asp-controller="About" asp-action="Index">Learn more</a> or find a Twitter account below:
</p>
<form method="POST">
<div class="form-group">
<input type="text" class="form-control col-8 col-sm-8 col-md-6 col-lg-4 mx-auto" id="handle" name="handle" autocomplete="off" placeholder="Twitter Handle">
@ -18,9 +17,17 @@
<button type="submit" class="btn btn-primary">Show</button>
</form>
<br /><br />
@if (Model.InfoBanner.Length > 0)
{
<div class="alert alert-danger">
@Html.Raw(Model.InfoBanner)
</div>
}
@*@if (HtmlHelperExtensions.IsDebug())
{
<a class="nav-link text-dark" asp-area="" asp-controller="Debuging" asp-action="Index">Debug</a>
}*@
{
<a class="nav-link text-dark" asp-area="" asp-controller="Debuging" asp-action="Index">Debug</a>
}*@
</div>

View File

@ -22,7 +22,8 @@
"PublishReplies": false,
"MaxUsersCapacity": 1500,
"UnlistedTwitterAccounts": null,
"TwitterDomain": "twitter.com"
"TwitterDomain": "twitter.com",
"InfoBanner": ""
},
"Db": {
"Type": "postgres",