Skip to content

Commit

Permalink
Adjust style for settings pages
Browse files Browse the repository at this point in the history
  • Loading branch information
matte-ek committed Jul 29, 2023
1 parent 99eb4b0 commit 26c0041
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
</MudText>
</TitleContent>
<DialogContent>
<MudText>You can use either a beatmap set id or a beatmap id.</MudText>
<MudTextField @bind-Value="MapBan.BeatmapId" Label="Map Id" Required="false"/>
<MudTextField @bind-Value="MapBan.BeatmapSetId" Label="Map Set Id" Required="false"/>
</DialogContent>
Expand Down
10 changes: 1 addition & 9 deletions BanchoMultiplayerBot.Host.Web/Pages/Index.razor
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
}

<MudGrid Justify="Justify.FlexStart" Class="mt-2">
<MudItem xs="12" sm="3">
<MudItem xs="12" sm="6">
<MudCard>
<MudCardContent>
<MudText Typo="Typo.body2">Bancho Connection</MudText>
Expand All @@ -46,14 +46,6 @@
</MudCardContent>
</MudCard>
</MudItem>
<MudItem xs="12" sm="3">
<MudCard>
<MudCardContent>
<MudText Typo="Typo.body2">Games Played</MudText>
<MudText Typo="Typo.h4">@_gamesPlayed</MudText>
</MudCardContent>
</MudCard>
</MudItem>
</MudGrid>

<MudPaper Class="pa-4 mt-4">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,32 @@
<MudText Typo="Typo.h4" GutterBottom="true">Administrators</MudText>

<MudForm @ref="_form">
<MudPaper Class="pa-8 ma-2">
<MudTable Class="pa-0 ma-2" Items="@_administrators" T="User" Hover="true" Breakpoint="Breakpoint.Sm">
<ColGroup>
<col style="width: 70%;" />
<col style="width: 120px;" />
</ColGroup>
<HeaderContent>
<MudTh>Name</MudTh>
<MudTh>Options</MudTh>
</HeaderContent>
<RowTemplate>
<MudTd DataLabel="Name">@context.Name</MudTd>
<MudTd DataLabel="Options"><MudIconButton Icon="@Icons.Material.Filled.Delete" Title="Remove" OnClick="(() => OnRemoveEntryPressed(context))" /></MudTd>
</RowTemplate>
</MudTable>
<MudPaper Class="pa-0 ma-2" Elevation="0">
<MudButton Variant="Variant.Outlined" Color="Color.Primary" OnClick="@OnAddAdministratorPressed">Add New</MudButton>
</MudPaper>
<MudTable Class="pa-0 ma-2" Items="@_administrators" T="User" Hover="true" Breakpoint="Breakpoint.Sm">
<ColGroup>
<col style="width: 70%;"/>
<col style="width: 120px;"/>
</ColGroup>
<HeaderContent>
<MudTh>Name</MudTh>
<MudTh>Options</MudTh>
</HeaderContent>
<RowTemplate>
<MudTd DataLabel="Name">@context.Name</MudTd>
<MudTd DataLabel="Options">
<MudIconButton Icon="@Icons.Material.Filled.Delete" Title="Remove" OnClick="(() => OnRemoveEntryPressed(context))"/>
</MudTd>
</RowTemplate>
</MudTable>
<MudPaper Class="pa-4 ma-2">
<MudButton Variant="Variant.Text" Color="Color.Primary" OnClick="@OnAddAdministratorPressed">Add New</MudButton>
</MudPaper>
</MudForm>

@code {
private MudForm? _form;
private DialogOptions _maxWidthOptions = new DialogOptions() { MaxWidth = MaxWidth.Medium, FullWidth = true };

private List<User> _administrators = new();
private List<User> _administrators = new();

private async Task OnRemoveEntryPressed(User entry)
{
Expand Down Expand Up @@ -89,7 +89,7 @@
.AsNoTracking()
.ToListAsync();
}

protected override async void OnInitialized()
{
await LoadAdministrators();
Expand All @@ -98,4 +98,5 @@
public void Dispose()
{
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,9 @@

<PageTitle>Settings</PageTitle>

<MudText Typo="Typo.h3" GutterBottom="true">Announcements</MudText>

<MudText Typo="Typo.h4" GutterBottom="true">Announcements</MudText>
<MudForm @ref="_form">
<MudPaper Class="pa-8 ma-2">
<MudText Typo="Typo.h6" GutterBottom="true">Scheduled Announcements</MudText>
<MudTable Class="pa-0 ma-2" Items="@Bot.AnnouncementManager.Announcements" Hover="true" Breakpoint="Breakpoint.Sm">
<MudTable Class="pa-0 ma-2" Items="@Bot.AnnouncementManager.Announcements" Hover="true" Breakpoint="Breakpoint.Sm">
<ColGroup>
<col style="width: 50%;" />
<col style="width: 40px;" />
Expand All @@ -31,14 +28,12 @@
<MudTd DataLabel="Options"><MudIconButton Icon="@Icons.Material.Filled.Settings" Title="Configure" OnClick="(() => OnConfigureAnnouncementPressed(context))" /><MudIconButton Icon="@Icons.Material.Filled.Delete" Title="Remove" OnClick="(() => OnRemoveAnnouncementPressed(context))" /></MudTd>
</RowTemplate>
</MudTable>
<MudPaper Class="pa-0 ma-2" Elevation="0">
<MudButton Variant="Variant.Outlined" Color="Color.Primary" OnClick="@OnAddAnnouncementPressed">Add New</MudButton>
<MudPaper Class="pa-4 ma-2">
<MudButton Variant="Variant.Text" Color="Color.Primary" OnClick="@OnAddAnnouncementPressed">Add New</MudButton>
</MudPaper>
</MudPaper>
</MudForm>

<MudPaper Class="pa-8 ma-2">
<MudText Typo="Typo.h6" GutterBottom="true">Manual Announcement</MudText>
<MudPaper Class="pa-8 ma-2 mt-8">
<MudText Typo="Typo.h5" GutterBottom="true">Manual Announcement</MudText>
<MudTextField @bind-Value="_announcementMessage" T="string" Label="Message" Variant="Variant.Filled" Style="width: 50%"/>
<MudButton Variant="Variant.Outlined" Color="Color.Primary" Class="mt-2" OnClick="@OnAnnouncementSendPressed">Send</MudButton>
</MudPaper>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
</MudTd>
</RowTemplate>
</MudTable>
<MudPaper Class="pa-2 ma-2">
<MudButton Variant="Variant.Outlined" Color="Color.Primary" OnClick="@AddBan">Add New</MudButton>
<MudPaper Class="pa-4 ma-2">
<MudButton Variant="Variant.Text" Color="Color.Primary" OnClick="@AddBan">Add New</MudButton>
</MudPaper>
</MudForm>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<MudTh>Options</MudTh>
</HeaderContent>
<RowTemplate>
<MudTd DataLabel="Name">@context.User.Name</MudTd>
<MudTd DataLabel="Name"><MudLink Color="Color.Default" Href=@($"https://osu.ppy.sh/users/{context.User.Name}")>@context.User.Name</MudLink></MudTd>
<MudTd DataLabel="Is Host Ban">@(context.HostBan ? "Yes" : "No")</MudTd>
<MudTd DataLabel="Expire">@(context.Expire?.ToLongDateString() ?? "N/A")</MudTd>
<MudTd DataLabel="Reason">@(context.Reason ?? "N/A")</MudTd>
Expand All @@ -38,8 +38,8 @@
</MudTd>
</RowTemplate>
</MudTable>
<MudPaper Class="pa-2 ma-2">
<MudButton Variant="Variant.Outlined" Color="Color.Primary" OnClick="@AddBan">Add New</MudButton>
<MudPaper Class="pa-4 ma-2">
<MudButton Variant="Variant.Text" Color="Color.Primary" OnClick="@AddBan">Add New</MudButton>
</MudPaper>
</MudForm>

Expand Down

0 comments on commit 26c0041

Please sign in to comment.