mirror of
https://github.com/TheRealOwenRees/chess-endgame-trainer.git
synced 2026-11-18 11:42:07 +00:00
Rename Tag to Theme across code and schema
Rename the endgame-label concept from Tag to Theme to match the glossary: the context becomes Chesstrainer.Themes, the schema Chesstrainer.Themes.Theme, and the Endgame association is :themes. The category enum (endgame/opening/tactic) is preserved. Rewrite the original migrations in place so themes / endgames_themes (with theme_id) are created directly, instead of adding a transition migration. Closes #12
This commit is contained in:
@@ -4,7 +4,7 @@ defmodule ChesstrainerWeb.EndgameLive.Show do
|
||||
alias Chesstrainer.Endgames
|
||||
alias Chesstrainer.Game
|
||||
alias Chesstrainer.Repo
|
||||
alias Chesstrainer.Tags
|
||||
alias Chesstrainer.Themes
|
||||
|
||||
import ChesstrainerWeb.Board.BoardComponent
|
||||
|
||||
@@ -52,7 +52,7 @@ defmodule ChesstrainerWeb.EndgameLive.Show do
|
||||
<:item title="Message">{@endgame.message}</:item>
|
||||
<:item title="Notes">{@endgame.notes}</:item>
|
||||
<:item title="Result">{@endgame.result}</:item>
|
||||
<:item title="Themes">{Enum.join(Tags.names(@endgame.tags), ", ")}</:item>
|
||||
<:item title="Themes">{Enum.join(Themes.names(@endgame.themes), ", ")}</:item>
|
||||
<:item title="Attempted">{@endgame.times_attempted}</:item>
|
||||
<:item title="Solved">{@endgame.times_solved}</:item>
|
||||
</.list>
|
||||
@@ -65,6 +65,6 @@ defmodule ChesstrainerWeb.EndgameLive.Show do
|
||||
{:ok,
|
||||
socket
|
||||
|> assign(:page_title, "Show Endgame")
|
||||
|> assign(:endgame, Endgames.get_endgame!(id) |> Repo.preload(:tags))}
|
||||
|> assign(:endgame, Endgames.get_endgame!(id) |> Repo.preload(:themes))}
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user