From 97ab91f57e7836a17c34957683b88882e441aa5c Mon Sep 17 00:00:00 2001 From: Colin Halseth Date: Fri, 14 May 2021 12:12:58 -0700 Subject: [PATCH] Better looking log system with print-to-pdf features --- .../Pages/ManageLogs.razor | 133 ++++++++++-------- .../Shared/AssetAddList.razor | 3 + TrekSharp.AdventureTools/wwwroot/css/app.css | 10 ++ TrekSharp.AdventureTools/wwwroot/index.html | 33 ++++- .../wwwroot/service-worker.published.js | 7 + .../wwwroot/site.webmanifest | 1 - TrekSharp/src/Rulebooks/OperationsDivision.cs | 2 - TrekSharp/src/Rulebooks/ScienceDivision.cs | 2 - 8 files changed, 126 insertions(+), 65 deletions(-) diff --git a/TrekSharp.AdventureTools/Pages/ManageLogs.razor b/TrekSharp.AdventureTools/Pages/ManageLogs.razor index f048245..2531041 100644 --- a/TrekSharp.AdventureTools/Pages/ManageLogs.razor +++ b/TrekSharp.AdventureTools/Pages/ManageLogs.razor @@ -2,6 +2,9 @@ @page "/manage/logs" @using System.Globalization + + +
@if (compose) {
@@ -9,73 +12,87 @@
{ compose = false; StateHasChanged(); })> } else { - @if (viewedEntry == null) { -
+
+
- - -
-
- + +
+ @{ + string stardate = null; + foreach (var entry in Data.Logs.Enumerate()) { + var capture = entry; + if((!flaggedOnly || capture.Flagged) && (string.IsNullOrEmpty(filter) || CultureInfo.InvariantCulture.CompareInfo.IndexOf(capture.Content, filter, CompareOptions.IgnoreCase) >=0 )) { + var printed_stardate = capture.Stardate.ToString("0.0#"); + if (printed_stardate != stardate) { + stardate = printed_stardate; +
+ @stardate +
+ } +
+ +
+ + +
+
+ } + } + }
- @if (Data.Logs.Count > 0) { -
- } -
    - @foreach (var entry in Data.Logs.Enumerate()) { - if((!flaggedOnly || entry.Flagged) && (string.IsNullOrEmpty(filter) || CultureInfo.InvariantCulture.CompareInfo.IndexOf(entry.Content, filter, CompareOptions.IgnoreCase) >=0 )) { - var capture = entry; -
  • -
    - -
    -
    viewedEntry = capture)> - @capture.Stardate -

    - @capture.ExcerptString() -

    +
    +
    + +
    + @if (viewedEntry != null) { +
    +

    Stardate @viewedEntry.Stardate.ToString("0.0#")

    +
    + @viewedEntry.Content
    -
  • +
} - } - +
+
+ } + + +
+ @{ + string stardate = null; + int count = 0; + foreach (var entry in Data.Logs.Enumerate()) { + var capture = entry;var printed_stardate = capture.Stardate.ToString("0.0#"); + if (printed_stardate != stardate) { + count = 1; + stardate = printed_stardate; +

Personal Log Stardate @stardate

} else { -
-
- -
-
-
- STARDATE @viewedEntry.Stardate -
-
- - -
-
-
-
- @viewedEntry.Content -
+ count++; } +
+ @if (count > 1) { +

supplemental

+ } +
+ @capture.Content +
+
} - +} +
diff --git a/TrekSharp.AdventureTools/Shared/AssetAddList.razor b/TrekSharp.AdventureTools/Shared/AssetAddList.razor index a975fb7..8b41c7b 100644 --- a/TrekSharp.AdventureTools/Shared/AssetAddList.razor +++ b/TrekSharp.AdventureTools/Shared/AssetAddList.razor @@ -31,6 +31,9 @@

OR

+
+ Upload a JSON file describing the item to add. +
diff --git a/TrekSharp.AdventureTools/wwwroot/css/app.css b/TrekSharp.AdventureTools/wwwroot/css/app.css index 8803330..21bb637 100644 --- a/TrekSharp.AdventureTools/wwwroot/css/app.css +++ b/TrekSharp.AdventureTools/wwwroot/css/app.css @@ -7,6 +7,16 @@ padding: 8px 4px !important; } +.notification { + position: fixed; + bottom: 12px; + right: 12px; + background-color: #404040; + border-radius: 6px; + padding: 24px; + z-index: 10; +} + @media (max-width:601px){ .navbar { width: 100%; diff --git a/TrekSharp.AdventureTools/wwwroot/index.html b/TrekSharp.AdventureTools/wwwroot/index.html index b102efd..34aaaba 100644 --- a/TrekSharp.AdventureTools/wwwroot/index.html +++ b/TrekSharp.AdventureTools/wwwroot/index.html @@ -24,17 +24,46 @@ +
+ A new version is available REFRESH × +
Loading... Please Wait
If this takes longer than a few seconds than an error might have occurred
- +