Reorganzing markdown files and UI fixes in card viewer
This commit is contained in:
+13
-6
@@ -17,7 +17,7 @@ if (!Directory.Exists(docsDir))
|
||||
return 1;
|
||||
}
|
||||
|
||||
var mdFiles = Directory.GetFiles(docsDir, "*.md");
|
||||
var mdFiles = Directory.GetFiles(docsDir, "*.md", SearchOption.AllDirectories);
|
||||
var cards = new List<CardData>();
|
||||
|
||||
foreach (var file in mdFiles)
|
||||
@@ -35,7 +35,7 @@ foreach (var file in mdFiles)
|
||||
|
||||
var name = Path.GetFileNameWithoutExtension(file);
|
||||
var category = yaml.GetValueOrDefault("category");
|
||||
if (category == null) continue;
|
||||
if (category == null || category == "Deck") continue;
|
||||
|
||||
var imageFile = StripWikiLink(yaml.GetValueOrDefault("imageLink"));
|
||||
if (imageFile != null && !imageFile.EndsWith(".png"))
|
||||
@@ -67,13 +67,20 @@ foreach (var file in mdFiles)
|
||||
// Copy PNGs to wwwroot/cards
|
||||
var cardsDir = Path.Combine(webWwwRoot, "cards");
|
||||
Directory.CreateDirectory(cardsDir);
|
||||
|
||||
var pngFiles = Directory.GetFiles(docsDir, "*.png", SearchOption.AllDirectories);
|
||||
var pngMap = pngFiles
|
||||
.GroupBy(Path.GetFileName)
|
||||
.ToDictionary(g => g.Key!, g => g.First(), StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
foreach (var card in cards)
|
||||
{
|
||||
if (card.ImageFile == null) continue;
|
||||
var src = Path.Combine(docsDir, card.ImageFile);
|
||||
var dst = Path.Combine(cardsDir, card.ImageFile);
|
||||
if (File.Exists(src))
|
||||
if (pngMap.TryGetValue(card.ImageFile, out var src))
|
||||
{
|
||||
var dst = Path.Combine(cardsDir, card.ImageFile);
|
||||
File.Copy(src, dst, true);
|
||||
}
|
||||
}
|
||||
|
||||
// Generate C# source file
|
||||
@@ -120,7 +127,7 @@ Console.WriteLine($"Generated {cards.Count} cards in {generatedFile}");
|
||||
|
||||
// ── Decks ──
|
||||
var decksDir = Path.Combine(docsDir, "Decks");
|
||||
var deckFiles = Directory.Exists(decksDir) ? Directory.GetFiles(decksDir, "*.md") : [];
|
||||
var deckFiles = Directory.Exists(decksDir) ? Directory.GetFiles(decksDir, "*.md", SearchOption.AllDirectories) : [];
|
||||
var decks = new List<DeckData>();
|
||||
|
||||
foreach (var file in deckFiles)
|
||||
|
||||
+4066
-4066
File diff suppressed because it is too large
Load Diff
@@ -112,7 +112,7 @@
|
||||
{
|
||||
<div class="card-grid @(showDetailedView ? "detailed-view" : "")">
|
||||
@{ var idx = 0; }
|
||||
@foreach (var card in filteredCards)
|
||||
@foreach (var card in filteredCards.Where(a=>a.Category is "Agent" or "Spell"))
|
||||
{
|
||||
<div class="card-cell @(selectedCard == card ? "selected" : "")"
|
||||
style="--i: @idx"
|
||||
@@ -125,7 +125,7 @@
|
||||
{
|
||||
<div class="card-cost-badge">@card.Cost</div>
|
||||
}
|
||||
@if (card.HasImmortalize)
|
||||
@if (card.IsImmortalized)
|
||||
{
|
||||
<div class="card-immortalize-badge" title="Immortalizes"><i class="bi bi-star-fill"></i>
|
||||
</div>
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
# Chrono CCG - Project Guide
|
||||
|
||||
This project is a hosted Blazor WebAssembly application with a PostgreSQL database for persisting agent notes.
|
||||
|
||||
## Prerequisites
|
||||
- **Docker Desktop**: Required for the recommended containerized setup.
|
||||
- **.NET 10 SDK**: Required if you want to build or run the project locally without Docker.
|
||||
|
||||
## 1. Running with Docker (Recommended)
|
||||
The easiest way to get everything running (App + PostgreSQL) is using Docker Compose.
|
||||
|
||||
1. **Open a terminal** in the project root (`Chrono/`).
|
||||
2. **Run the following command**:
|
||||
```bash
|
||||
docker-compose up --build
|
||||
```
|
||||
3. **Access the Application**:
|
||||
- Web Interface: http://localhost:8080
|
||||
- API Endpoint: http://localhost:8080/api/notes
|
||||
|
||||
The database will be automatically initialized and migrations will be applied on startup.
|
||||
|
||||
## 2. Running Locally (Development)
|
||||
If you need to run the app directly (e.g., for faster debugging):
|
||||
|
||||
1. **Start a PostgreSQL database**. You can use the one from docker-compose if you want:
|
||||
```bash
|
||||
docker-compose up db
|
||||
```
|
||||
2. **Verify Connection String**: `Server/appsettings.Development.json` is pre-configured to point to `localhost`.
|
||||
3. **Run the Server project**:
|
||||
```bash
|
||||
cd Server
|
||||
dotnet run --launch-profile https
|
||||
```
|
||||
4. The app will be served at the URL shown in the terminal (e.g., https://localhost:7266).
|
||||
|
||||
## 3. Running Tests
|
||||
To verify the core domain logic:
|
||||
```bash
|
||||
dotnet test
|
||||
```
|
||||
|
||||
## 4. Key Features
|
||||
- **Agent Notes**: In the "Cards" gallery, select an Agent to see the "Personal Note" field. Changes are auto-saved to the PostgreSQL database when you click away from the text area.
|
||||
- **Auto-Migrations**: The Server project automatically handles database schema updates on startup.
|
||||
- **Dockerized Architecture**: Complete orchestration of the web server and database.
|
||||
Reference in New Issue
Block a user