Revert slug hotfix and change comment links to use relative urls

This commit is contained in:
Slendy 2023-10-30 15:53:51 -05:00
commit 48a4202ba1
No known key found for this signature in database
GPG key ID: 7288D68361B91428
3 changed files with 5 additions and 8 deletions

View file

@ -18,7 +18,7 @@ using Microsoft.EntityFrameworkCore;
namespace LBPUnion.ProjectLighthouse.Servers.Website.Controllers;
[ApiController]
[Route("slot/{id:int}/{slug?}")]
[Route("slot/{id:int}")]
public class SlotPageController : ControllerBase
{
private readonly DatabaseContext database;

View file

@ -12,7 +12,7 @@ using Microsoft.EntityFrameworkCore;
namespace LBPUnion.ProjectLighthouse.Servers.Website.Controllers;
[ApiController]
[Route("user/{id:int}/{slug?}")]
[Route("user/{id:int}")]
public class UserPageController : ControllerBase
{
private readonly DatabaseContext database;

View file

@ -31,7 +31,7 @@
@if (Model.CommentsEnabled && Model.User != null)
{
<div class="ui divider"></div>
<form class="ui reply form" action="@Url.RouteUrl(ViewContext.RouteData.Values)/postComment" method="post">
<form class="ui reply form" action="postComment" method="post">
<div class="field">
<textarea style="min-height: 70px; height: 70px; max-height:120px" maxlength="100" name="msg"></textarea>
</div>
@ -53,9 +53,6 @@
string decodedMessage = HttpUtility.HtmlDecode(comment.GetCommentMessage(Database));
string? url = Url.RouteUrl(ViewContext.RouteData.Values);
if (url == null) continue;
int rating = comment.ThumbsUp - comment.ThumbsDown;
<div style="display: flex" id="@comment.CommentId">
@ -67,11 +64,11 @@
}
}
<div class="voting" style="@(style)">
<a href="@url/rateComment?commentId=@(comment.CommentId)&rating=@(yourThumb == 1 ? 0 : 1)">
<a href="rateComment?commentId=@(comment.CommentId)&rating=@(yourThumb == 1 ? 0 : 1)">
<i class="fitted @(yourThumb == 1 ? "green" : "grey") arrow up link icon" style="display: block"></i>
</a>
<span style="text-align: center; margin: auto; @(rating < 0 ? "margin-left: -5px" : "")">@(rating)</span>
<a href="@url/rateComment?commentId=@(comment.CommentId)&rating=@(yourThumb == -1 ? 0 : -1)">
<a href="rateComment?commentId=@(comment.CommentId)&rating=@(yourThumb == -1 ? 0 : -1)">
<i class="fitted @(yourThumb == -1 ? "red" : "grey") arrow down link icon" style="display: block"></i>
</a>
</div>