mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-10 23:31:13 -05:00
combined Penalty and EFPenalty
moved some classes around
This commit is contained in:
@ -7,6 +7,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using static SharedLibraryCore.Database.Models.EFPenalty;
|
||||
|
||||
namespace WebfrontCore.Controllers
|
||||
{
|
||||
@ -66,7 +67,7 @@ namespace WebfrontCore.Controllers
|
||||
|
||||
var currentPenalty = activePenalties.FirstOrDefault();
|
||||
|
||||
if (currentPenalty != null && currentPenalty.Type == SharedLibraryCore.Objects.Penalty.PenaltyType.TempBan)
|
||||
if (currentPenalty != null && currentPenalty.Type == PenaltyType.TempBan)
|
||||
{
|
||||
clientDto.Meta.Add(new ProfileMeta()
|
||||
{
|
||||
|
@ -10,7 +10,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using WebfrontCore.ViewComponents;
|
||||
using static SharedLibraryCore.Objects.Penalty;
|
||||
using static SharedLibraryCore.Database.Models.EFPenalty;
|
||||
|
||||
namespace WebfrontCore.Controllers
|
||||
{
|
||||
|
@ -1,5 +1,5 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using SharedLibraryCore.Objects;
|
||||
using SharedLibraryCore.Database.Models;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
@ -9,7 +9,7 @@ namespace WebfrontCore.ViewComponents
|
||||
{
|
||||
private const int PENALTY_COUNT = 15;
|
||||
|
||||
public async Task<IViewComponentResult> InvokeAsync(int offset, Penalty.PenaltyType showOnly)
|
||||
public async Task<IViewComponentResult> InvokeAsync(int offset, EFPenalty.PenaltyType showOnly)
|
||||
{
|
||||
var penalties = await Program.Manager.GetPenaltyService().GetRecentPenalties(PENALTY_COUNT, offset, showOnly);
|
||||
penalties = User.Identity.IsAuthenticated ? penalties : penalties.Where(p => !p.Sensitive).ToList();
|
||||
|
@ -1,13 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using static SharedLibraryCore.Database.Models.EFPenalty;
|
||||
|
||||
namespace WebfrontCore.ViewModels
|
||||
{
|
||||
public class PenaltyFilterInfo
|
||||
{
|
||||
public int Offset { get; set; }
|
||||
public SharedLibraryCore.Objects.Penalty.PenaltyType ShowOnly { get; set; }
|
||||
public PenaltyType ShowOnly { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
@model SharedLibraryCore.Objects.Penalty.PenaltyType
|
||||
@model SharedLibraryCore.Database.Models.EFPenalty.PenaltyType
|
||||
@{
|
||||
var loc = SharedLibraryCore.Utilities.CurrentLocalization.LocalizationIndex;
|
||||
}
|
||||
@ -6,11 +6,11 @@
|
||||
<div class="row">
|
||||
<select class="form-control bg-dark text-muted" id="penalty_filter_selection">
|
||||
@{
|
||||
foreach (var penaltyType in Enum.GetValues(typeof(SharedLibraryCore.Objects.Penalty.PenaltyType)))
|
||||
foreach (var penaltyType in Enum.GetValues(typeof(SharedLibraryCore.Database.Models.EFPenalty.PenaltyType)))
|
||||
{
|
||||
if ((SharedLibraryCore.Objects.Penalty.PenaltyType)penaltyType == SharedLibraryCore.Objects.Penalty.PenaltyType.Any)
|
||||
if ((SharedLibraryCore.Database.Models.EFPenalty.PenaltyType)penaltyType == SharedLibraryCore.Database.Models.EFPenalty.PenaltyType.Any)
|
||||
{
|
||||
if (Model == SharedLibraryCore.Objects.Penalty.PenaltyType.Any)
|
||||
if (Model == SharedLibraryCore.Database.Models.EFPenalty.PenaltyType.Any)
|
||||
{
|
||||
<option value="@Convert.ToInt32(penaltyType)" selected="selected" )>@loc["WEBFRONT_PENALTY_TEMPLATE_SHOW"] @penaltyType.ToString()</option>
|
||||
}
|
||||
@ -21,7 +21,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((SharedLibraryCore.Objects.Penalty.PenaltyType)penaltyType == Model)
|
||||
if ((SharedLibraryCore.Database.Models.EFPenalty.PenaltyType)penaltyType == Model)
|
||||
{
|
||||
<option value="@Convert.ToInt32(penaltyType)" selected="selected">@loc["WEBFRONT_PENALTY_TEMPLATE_SHOWONLY"] @penaltyType.ToString()s</option>
|
||||
}
|
||||
|
@ -73,7 +73,7 @@
|
||||
<PackageReference Include="Microsoft.AspNetCore.Hosting" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.2.2" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.2.5" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="2.2.4" />
|
||||
|
Reference in New Issue
Block a user