feat(website): make How To Play page fully CMS-editable from admin
- HowToPlay.cshtml: CMS content now replaces the entire body (nav + sections) instead of just the sections — hardcoded nav no longer bleeds through when custom HTML is saved - HowToPlayEditor.razor: add "Load static content as starting point" button so admins can bootstrap from the existing static copy rather than writing HTML from scratch - HowToPlayEditor.razor.cs: static fallback HTML extracted to code-behind partial to avoid Razor parser issues with raw string literals containing double-quoted HTML attributes Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
@@ -54,9 +54,18 @@
|
||||
rows="30"
|
||||
placeholder="Enter full page HTML…"
|
||||
@bind="_bodyHtml"></textarea>
|
||||
<div class="form-text">
|
||||
Full HTML for the <code>/how-to-play</code> page body.
|
||||
Leave empty to fall back to the built-in static content.
|
||||
<div class="d-flex justify-content-between align-items-center mt-2">
|
||||
<span class="form-text mb-0">
|
||||
Full HTML for the <code>/how-to-play</code> page body (nav + sections).
|
||||
Leave empty to fall back to built-in static content.
|
||||
</span>
|
||||
@if (string.IsNullOrWhiteSpace(_bodyHtml))
|
||||
{
|
||||
<button type="button" class="btn btn-outline-secondary btn-sm ms-3 flex-shrink-0"
|
||||
@onclick="LoadStaticContent">
|
||||
Load static content as starting point
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
@@ -87,6 +96,8 @@
|
||||
|
||||
private WebsiteContent? _entry;
|
||||
|
||||
// StaticFallbackHtml is defined in HowToPlayEditor.razor.cs (partial class).
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
_entry = await Catalog.WebsiteContents
|
||||
@@ -94,6 +105,11 @@
|
||||
_bodyHtml = _entry?.BodyHtml ?? string.Empty;
|
||||
}
|
||||
|
||||
private void LoadStaticContent()
|
||||
{
|
||||
_bodyHtml = StaticFallbackHtml;
|
||||
}
|
||||
|
||||
private async Task SaveAsync()
|
||||
{
|
||||
_saving = true;
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
namespace SOR.Admin.Components.Pages.Website;
|
||||
|
||||
public partial class HowToPlayEditor
|
||||
{
|
||||
// Kept here (not in the .razor file) because Razor's parser mis-handles
|
||||
// raw string literals that contain double-quoted HTML attributes.
|
||||
private const string StaticFallbackHtml =
|
||||
"""
|
||||
<nav class="howto-nav" aria-label="Rules sections">
|
||||
<a href="#what-is-aeternalis">What is Aeternalis?</a>
|
||||
<a href="#channelers">Channelers</a>
|
||||
<a href="#how-to-win">How to Win</a>
|
||||
<a href="#card-types">Card Types</a>
|
||||
<a href="#resources">Resources</a>
|
||||
<a href="#turn-structure">Turn Structure</a>
|
||||
<a href="#combat">Combat</a>
|
||||
<a href="#terramorpha">Terramorpha</a>
|
||||
<a href="#sacrifice">Sacrifice</a>
|
||||
<a href="#glossary">Glossary</a>
|
||||
</nav>
|
||||
|
||||
<section id="what-is-aeternalis" class="howto-section">
|
||||
<h2>What is Aeternalis?</h2>
|
||||
<p>Aeternalis is a tactical strategy card game played in a constructed mindscape. Two Channelers face off, each commanding Archspirits, Spirits, Terramorpha, and other cards drawn from their deck. The battlefield is a grid of affinity tiles that both players shape during play.</p>
|
||||
</section>
|
||||
|
||||
<section id="channelers" class="howto-section">
|
||||
<h2>What is a Channeler?</h2>
|
||||
<p>You are the Channeler — the player. You reach into the Origin Stone to summon Archspirits, cast Instincts, lay Terramorpha, and shape the battlefield. Your Channeler does not have its own card: you <em>are</em> the will behind every action.</p>
|
||||
</section>
|
||||
|
||||
<section id="how-to-win" class="howto-section">
|
||||
<h2>How to Win</h2>
|
||||
<p>Reduce your opponent's Channeler to zero life points. Life is lost when your opponent's units deal unblocked damage to you directly. Build your board, control the terrain, and press the assault.</p>
|
||||
</section>
|
||||
|
||||
<section id="card-types" class="howto-section">
|
||||
<h2>Card Types</h2>
|
||||
<dl class="card-type-list">
|
||||
<dt>ArchSpirit</dt>
|
||||
<dd>Powerful multi-tier units that evolve through Ascension. The core of most strategies.</dd>
|
||||
<dt>Spirit</dt>
|
||||
<dd>Smaller units that can be sacrificed to fuel growth and resource mechanics.</dd>
|
||||
<dt>Terramorpha</dt>
|
||||
<dd>Land-shaping cards that change the affinity of tiles on the battlefield.</dd>
|
||||
<dt>Instinct</dt>
|
||||
<dd>Instant-speed effects that can be played during your opponent's turn.</dd>
|
||||
<dt>Repentance</dt>
|
||||
<dd>Slow powerful effects that require preparation and setup.</dd>
|
||||
<dt>Ruin</dt>
|
||||
<dd>Persistent enchantments that modify the rules of the game while in play.</dd>
|
||||
</dl>
|
||||
</section>
|
||||
|
||||
<section id="resources" class="howto-section">
|
||||
<h2>Resources and Costs</h2>
|
||||
<p>Cards cost <strong>SP</strong> (Spirit Points) and <strong>ST</strong> (Soul Tokens) to play. SP regenerates each turn. ST is earned through sacrifice and specific card effects. Managing both resources is the central economic challenge of Aeternalis.</p>
|
||||
</section>
|
||||
|
||||
<section id="turn-structure" class="howto-section">
|
||||
<h2>Turn Structure</h2>
|
||||
<ol class="turn-steps">
|
||||
<li><strong>Draw</strong> — Draw one card from your deck.</li>
|
||||
<li><strong>Upkeep</strong> — Trigger start-of-turn effects. SP regenerates.</li>
|
||||
<li><strong>Main Phase</strong> — Play cards, move units, use abilities.</li>
|
||||
<li><strong>Combat Phase</strong> — Declare attackers. Opponent declares blockers.</li>
|
||||
<li><strong>End Phase</strong> — Discard down to hand limit. End-of-turn effects trigger.</li>
|
||||
</ol>
|
||||
</section>
|
||||
|
||||
<section id="combat" class="howto-section">
|
||||
<h2>Combat and Targeting</h2>
|
||||
<p>Units attack in the direction they face. Melee units must be adjacent to their target. Ranged units attack within their range, requiring line-of-sight unless otherwise stated. Flight units can only be blocked by other Flight units.</p>
|
||||
</section>
|
||||
|
||||
<section id="terramorpha" class="howto-section">
|
||||
<h2>Terramorpha and Land Shaping</h2>
|
||||
<p>Terramorpha cards reshape the affinity tiles on the battlefield. Units require matching affinity tiles to be channeled. Control the terrain to control what your opponent can summon. Mono Terramorpha changes one tile; Di changes two adjacent tiles; Tri changes three.</p>
|
||||
</section>
|
||||
|
||||
<section id="sacrifice" class="howto-section">
|
||||
<h2>Sacrifice and Spirit Growth</h2>
|
||||
<p>Spirits can be sacrificed to generate Soul Tokens and power high-cost abilities. Strategic sacrifice is a core resource loop — spending small units to fuel larger threats.</p>
|
||||
</section>
|
||||
|
||||
<section id="glossary" class="howto-section">
|
||||
<h2>Glossary</h2>
|
||||
<dl class="glossary">
|
||||
<dt>Channeler</dt><dd>The player. The will behind every card played.</dd>
|
||||
<dt>Origin Stone</dt><dd>The cosmic vessel that stores memories of all that has been and may yet be.</dd>
|
||||
<dt>Archspirit</dt><dd>A mighty being of ages past, temporarily revived through channeling.</dd>
|
||||
<dt>Terramorpha</dt><dd>The art of shaping mindscape terrain through will and memory.</dd>
|
||||
<dt>Mindscape</dt><dd>The constructed psychic battlefield where all matches take place.</dd>
|
||||
<dt>Spirit</dt><dd>A lesser being summoned through channeling. Can be sacrificed for resources.</dd>
|
||||
<dt>Ruin</dt><dd>A persistent card type that modifies game rules while in play.</dd>
|
||||
<dt>Instinct</dt><dd>An instant-speed card playable at any time, including your opponent's turn.</dd>
|
||||
<dt>Repentance</dt><dd>A slow, powerful card that takes time to resolve after being played.</dd>
|
||||
<dt>Fifth Star</dt><dd>The impossible new star that appeared after the first encounter with the unknown entity. A symbol of hope.</dd>
|
||||
</dl>
|
||||
</section>
|
||||
|
||||
<div class="howto-cta">
|
||||
<a href="/auth/register" class="btn btn-primary">Create Account and Play</a>
|
||||
<a href="/cards" class="btn btn-ghost">Browse Cards</a>
|
||||
</div>
|
||||
""";
|
||||
}
|
||||
@@ -14,6 +14,15 @@
|
||||
|
||||
<div class="container howto-page">
|
||||
|
||||
@if (Model.CustomBodyHtml is not null)
|
||||
{
|
||||
<div class="howto-content">
|
||||
@Html.Raw(Model.CustomBodyHtml)
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
<nav class="howto-nav" aria-label="Rules sections">
|
||||
<a href="#what-is-aeternalis">What is Aeternalis?</a>
|
||||
<a href="#channelers">Channelers</a>
|
||||
@@ -29,13 +38,6 @@
|
||||
|
||||
<div class="howto-content">
|
||||
|
||||
@if (Model.CustomBodyHtml is not null)
|
||||
{
|
||||
@Html.Raw(Model.CustomBodyHtml)
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
<section id="what-is-aeternalis" class="howto-section">
|
||||
<h2>What is Aeternalis?</h2>
|
||||
<p>
|
||||
@@ -173,6 +175,6 @@
|
||||
<a href="/cards" class="btn btn-ghost">Browse Cards</a>
|
||||
</div>
|
||||
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user