Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

123/bk/add UI feedback for completed messages #137

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions AudioWebApp6/Client/AudioWebApp.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
</PropertyGroup>

<ItemGroup>
<Content Remove="wwwroot\scripts\audioEventListener.js" />
<Content Remove="wwwroot\scripts\liveRadioTimeCheck.js" />
</ItemGroup>

<ItemGroup>
<_ContentIncludedByDefault Remove="wwwroot\scripts\audioEventListener.js" />
<_ContentIncludedByDefault Remove="wwwroot\scripts\liveRadioTimeCheck.js" />
</ItemGroup>

Expand Down Expand Up @@ -150,6 +152,9 @@
</ItemGroup>

<ItemGroup>
<None Include="wwwroot\scripts\audioEventListener.js">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="wwwroot\scripts\audioFavorite.js">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
Expand Down
4 changes: 3 additions & 1 deletion AudioWebApp6/Client/Models/Favorite.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
public class Favorite
{
public string Name { get; set; }
public string Series { get; set; }
public string Source { get; set; }
public DateTime DateTimeStamp { get; set; }

public Favorite(string name, string source, DateTime timeStamp)
public Favorite(string name, string series, string source, DateTime timeStamp)
{
Name = name;
Series = series;
Source = source;
DateTimeStamp = timeStamp;
}
Expand Down
5 changes: 4 additions & 1 deletion AudioWebApp6/Client/Pages/Book.razor
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
@inject NavigationManager NavigationManager
@inject SharedDataService sharedDataService
@inject ApiService apiService
@inject CompletedService completedService

<PageTitle>Books</PageTitle>
<div>
Expand Down Expand Up @@ -31,7 +32,7 @@
<NestedList>
@foreach (var msg in topic.Messages)
{
<MudListItem Text="@msg.Name" @onclick="(e) => OpenAudio(msg.Name, msg.Link, topic.Server, topic.Messages)" />
<MudListItem class="@((completedService.IsCompleted(msg.Name) ? "completedMessage" : ""))" Text="@msg.Name" @onclick="(e) => OpenAudio(msg.Name, msg.Link, topic.Server, topic.Messages)" />
}
</NestedList>
</MudListItem>
Expand All @@ -47,6 +48,7 @@
protected override async Task OnInitializedAsync()
{
await apiService.LoadData();
await completedService.GetCompletedMessages("Book");
dataReady = "dataLoaded";
}
public void OpenAudio(string audioName, string audioLink, string serverName, List<Message> queue)
Expand All @@ -55,6 +57,7 @@

sharedDataService.AudioTitle = audioName;
sharedDataService.AudioLink = Path.Combine(serverPath, audioLink);
sharedDataService.AudioSeries = "Book";
sharedDataService.GenerateQueue(queue, audioName, serverPath);
sharedDataService.TogglePlayer();
}
Expand Down
7 changes: 7 additions & 0 deletions AudioWebApp6/Client/Pages/Book.razor.css
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,10 @@
padding-top:4px;
padding-left:10px;
}
::deep div.mud-list-item.mud-list-item-gutters.mud-list-item-clickable.mud-ripple.completedMessage div.mud-list-item-text p.mud-typography.mud-typography-body1 {
font-weight: bold;
}

::deep div.mud-list-item.mud-list-item-gutters.mud-list-item-clickable.mud-ripple.completedMessage {
background-color: #ccd9f3;
}
5 changes: 3 additions & 2 deletions AudioWebApp6/Client/Pages/Books.razor
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
</div>

@code {

string? dataReady;

protected override async Task OnInitializedAsync()
Expand All @@ -53,7 +53,8 @@
{
sharedDataService.AudioTitle = audioName;
sharedDataService.AudioLink = audioLink;

sharedDataService.AudioSeries = "AudioBooks";

sharedDataService.TogglePlayer();
}
}
6 changes: 5 additions & 1 deletion AudioWebApp6/Client/Pages/Debates.razor
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
@inject SharedDataService sharedDataService
@inject ApiService apiService
@inject DebateGrouperUtility debateGrouper
@inject CompletedService completedService

<PageTitle>Debates</PageTitle>
<div>
Expand Down Expand Up @@ -33,7 +34,8 @@
<NestedList>
@foreach (var msg in topic.Messages)
{
<MudListItem style="padding-right:20px;" Text="@msg.Name" @onclick="(e) => OpenAudio(msg.Name, msg.Link, topic.Server, topic.Messages)" />
<MudListItem style="padding-right:20px;" class="@((completedService.IsCompleted(msg.Name) ? "completedMessage" : ""))"
Text="@msg.Name" @onclick="(e) => OpenAudio(msg.Name, msg.Link, topic.Server, topic.Messages)" />
}
</NestedList>
</MudListItem>
Expand All @@ -50,6 +52,7 @@
{
await apiService.LoadData();
debateGrouper.CreateCategories(apiService.Debates);
await completedService.GetCompletedMessages("Debates");
dataReady = "dataLoaded";
}
public void OpenAudio(string audioName, string audioLink, string serverName, List<Message> queue)
Expand All @@ -58,6 +61,7 @@

sharedDataService.AudioTitle = audioName;
sharedDataService.AudioLink = Path.Combine(serverPath, audioLink);
sharedDataService.AudioSeries = "Debates";
sharedDataService.GenerateQueue(queue, audioName, serverPath);
sharedDataService.TogglePlayer();
}
Expand Down
7 changes: 7 additions & 0 deletions AudioWebApp6/Client/Pages/Debates.razor.css
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,10 @@
padding-top: 4px;
padding-left: 10px;
}
::deep div.mud-list-item.mud-list-item-gutters.mud-list-item-clickable.mud-ripple.completedMessage div.mud-list-item-text p.mud-typography.mud-typography-body1 {
font-weight: bold;
}

::deep div.mud-list-item.mud-list-item-gutters.mud-list-item-clickable.mud-ripple.completedMessage {
background-color: #ccd9f3;
}
5 changes: 3 additions & 2 deletions AudioWebApp6/Client/Pages/Favorite.razor
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<MudButton @onclick="(e) => RemoveFavorite(fav.Name)">
<MudIcon Icon="@favRemoveIcon" Title="Remove Favorite"></MudIcon>
</MudButton>
<MudCardContent style="height:auto; width:100%; margin-bottom:10px; cursor:pointer;" @onclick="(e) => OpenAudio(fav.Name, fav.Source)">
<MudCardContent style="height:auto; width:100%; margin-bottom:10px; cursor:pointer;" @onclick="(e) => OpenAudio(fav.Name, fav.Source, fav.Series)">
<MudText style="font-size:16px;">@fav.Name</MudText>
<MudText style="font-size:10px;">@GetCategory(@fav.Source)</MudText>
</MudCardContent>
Expand All @@ -40,10 +40,11 @@
await favoritesService.GetAllFavorites();
dataReady = "dataLoaded";
}
public void OpenAudio(string audioName,string audioLink)
public void OpenAudio(string audioName,string audioLink, string audioSeries)
{
sharedDataService.AudioTitle = audioName;
sharedDataService.AudioLink = audioLink;
sharedDataService.AudioSeries = audioSeries;
sharedDataService.TogglePlayer();
}
public async Task RemoveFavorite(string key)
Expand Down
5 changes: 4 additions & 1 deletion AudioWebApp6/Client/Pages/LifeOfChrist.razor
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
@inject SharedDataService sharedDataService
@inject ApiService apiService
@inject CollectionFilter collectionFilter
@inject CompletedService completedService
<PageTitle>Life of Christ</PageTitle>
<div>
<MudCardContent>
Expand All @@ -32,7 +33,7 @@
<NestedList>
@foreach (var msg in topic.Messages)
{
<MudListItem Text="@msg.Name" @onclick="(e) => OpenAudio(msg.Name, msg.Link, topic.Server, topic.Messages)" />
<MudListItem class="@((completedService.IsCompleted(msg.Name) ? "completedMessage" : ""))" Text="@msg.Name" @onclick="(e) => OpenAudio(msg.Name, msg.Link, topic.Server, topic.Messages)" />
}
</NestedList>
</MudListItem>
Expand All @@ -49,6 +50,7 @@
{
await apiService.LoadData();
collectionFilter.Reorder(apiService.Christ);
await completedService.GetCompletedMessages("LifeOfChrist");
dataReady = "dataLoaded";
}

Expand All @@ -58,6 +60,7 @@

sharedDataService.AudioTitle = audioName;
sharedDataService.AudioLink = Path.Combine(serverPath, audioLink);
sharedDataService.AudioSeries = "LifeOfChrist";
sharedDataService.GenerateQueue(queue, audioName, serverPath);
sharedDataService.TogglePlayer();
}
Expand Down
7 changes: 7 additions & 0 deletions AudioWebApp6/Client/Pages/LifeOfChrist.razor.css
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,11 @@
padding-top: 4px;
padding-left: 10px;
}
::deep div.mud-list-item.mud-list-item-gutters.mud-list-item-clickable.mud-ripple.completedMessage div.mud-list-item-text p.mud-typography.mud-typography-body1 {
font-weight: bold;
}

::deep div.mud-list-item.mud-list-item-gutters.mud-list-item-clickable.mud-ripple.completedMessage {
background-color: #ccd9f3;
}

6 changes: 5 additions & 1 deletion AudioWebApp6/Client/Pages/Teachings.razor
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
@inject NavigationManager NavigationManager
@inject SharedDataService sharedDataService
@inject ApiService apiService
@inject CompletedService completedService
<PageTitle>Teachings</PageTitle>
<div>
<MudCardContent>
Expand All @@ -30,7 +31,8 @@
<NestedList>
@foreach (var msg in topic.Messages)
{
<MudListItem Text="@msg.Name" @onclick="(e) => OpenAudio(msg.Name, msg.Link, topic.Server, topic.Messages)" />
<MudListItem class="@((completedService.IsCompleted(msg.Name) ? "completedMessage" : ""))"
Text="@msg.Name" @onclick="(e) => OpenAudio(msg.Name, msg.Link, topic.Server, topic.Messages)" />
}
</NestedList>
</MudListItem>
Expand All @@ -46,6 +48,7 @@
protected override async Task OnInitializedAsync()
{
await apiService.LoadData();
await completedService.GetCompletedMessages("Teachings");
dataReady = "dataLoaded";
}
public void OpenAudio(string audioName, string audioLink, string serverName, List<Message> queue)
Expand All @@ -54,6 +57,7 @@

sharedDataService.AudioTitle = audioName;
sharedDataService.AudioLink = Path.Combine(serverPath, audioLink);
sharedDataService.AudioSeries = "Teachings";
sharedDataService.GenerateQueue(queue, audioName, serverPath);
sharedDataService.TogglePlayer();
}
Expand Down
7 changes: 7 additions & 0 deletions AudioWebApp6/Client/Pages/Teachings.razor.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,10 @@
padding-left: 10px;

}
::deep div.mud-list-item.mud-list-item-gutters.mud-list-item-clickable.mud-ripple.completedMessage div.mud-list-item-text p.mud-typography.mud-typography-body1 {
font-weight: bold;
}

::deep div.mud-list-item.mud-list-item-gutters.mud-list-item-clickable.mud-ripple.completedMessage {
background-color: #ccd9f3;
}
11 changes: 9 additions & 2 deletions AudioWebApp6/Client/Pages/Topical.razor
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
@page "/topical"
@using AudioWebApp.Client.Services
@using AudioWebApp.Client.Models
@using System.Collections.ObjectModel
@inject NavigationManager NavigationManager
@inject SharedDataService sharedDataService
@inject ApiService apiService
@inject CompletedService completedService

<PageTitle>Topical</PageTitle>
<div>
Expand Down Expand Up @@ -31,7 +33,7 @@
<NestedList>
@foreach (var msg in topic.Messages)
{
<MudListItem Text="@msg.Name" @onclick="(e) => OpenAudio(msg.Name, msg.Link, topic.Server, topic.Messages)" />
<MudListItem class="@((completedService.IsCompleted(msg.Name) ? "completedMessage" : ""))" Text="@msg.Name" @onclick="(e) => OpenAudio(msg.Name, msg.Link, topic.Server, topic.Messages)" />
}
</NestedList>
</MudListItem>
Expand All @@ -44,11 +46,14 @@
@code
{
string? dataReady;

protected override async Task OnInitializedAsync()
{
await apiService.LoadData();
await completedService.GetCompletedMessages("Topical");

dataReady = "dataLoaded";

}

public void OpenAudio(string audioName, string audioLink, string serverName, List<Message> queue)
Expand All @@ -57,8 +62,10 @@

sharedDataService.AudioTitle = audioName;
sharedDataService.AudioLink = Path.Combine(serverPath, audioLink);
sharedDataService.AudioSeries = "Topical";
sharedDataService.GenerateQueue(queue, audioName, serverPath);
sharedDataService.TogglePlayer();
}


}
7 changes: 7 additions & 0 deletions AudioWebApp6/Client/Pages/Topical.razor.css
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,11 @@
font-size: 14px;
padding-top: 4px;
padding-left: 10px;
}
::deep div.mud-list-item.mud-list-item-gutters.mud-list-item-clickable.mud-ripple.completedMessage div.mud-list-item-text p.mud-typography.mud-typography-body1 {
font-weight: bold;
}

::deep div.mud-list-item.mud-list-item-gutters.mud-list-item-clickable.mud-ripple.completedMessage {
background-color: #ccd9f3;
}
11 changes: 9 additions & 2 deletions AudioWebApp6/Client/Pages/VerseByVerse.razor
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
@using AudioWebApp.Client.Models
@inject SharedDataService sharedDataService
@inject ApiService apiService
@inject CompletedService completedService

<PageTitle>Verse by Verse</PageTitle>
<div>
Expand Down Expand Up @@ -30,7 +31,10 @@
<NestedList>
@foreach (var msg in book.Messages)
{
<MudListItem Text="@msg.Name" @onclick="(e) => OpenAudio(msg.Name, msg.Link, book.Server, book.Messages)" />

<MudListItem class="@((completedService.IsCompleted(msg.Name) ? "completedMessage" : ""))"
Text="@msg.Name" @onclick="(e) => OpenAudio(msg.Name, msg.Link, book.Server, book.Messages)" />

}
</NestedList>
</MudListItem>
Expand All @@ -43,10 +47,12 @@
@code
{
string? dataReady;

protected override async Task OnInitializedAsync()
{
await apiService.LoadData();
await completedService.GetCompletedMessages("VerseByVerse");

dataReady = "dataLoaded";
}

Expand All @@ -56,6 +62,7 @@

sharedDataService.AudioTitle = audioName;
sharedDataService.AudioLink = Path.Combine(serverPath, audioLink);
sharedDataService.AudioSeries = "VerseByVerse";
sharedDataService.GenerateQueue(queue, audioName, serverPath);
sharedDataService.TogglePlayer();
}
Expand Down
6 changes: 6 additions & 0 deletions AudioWebApp6/Client/Pages/VerseByVerse.razor.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,9 @@
padding-top: 4px;
padding-left: 10px;
}
::deep div.mud-list-item.mud-list-item-gutters.mud-list-item-clickable.mud-ripple.completedMessage div.mud-list-item-text p.mud-typography.mud-typography-body1{
font-weight: bold;
}
::deep div.mud-list-item.mud-list-item-gutters.mud-list-item-clickable.mud-ripple.completedMessage {
background-color: #ccd9f3;
}
1 change: 1 addition & 0 deletions AudioWebApp6/Client/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
builder.Services.AddSingleton<CollectionFilter>();
builder.Services.AddScoped<AudioBookService>();
builder.Services.AddSingleton<DebateGrouperUtility>();
builder.Services.AddScoped<CompletedService>();
builder.Services.AddMudBlazorDialog();

await builder.Build().RunAsync();
Loading