tooltips app TDD spike + kit bag refactor to .tt
- New apps.tooltips: TooltipContent model, {% tooltip data %} inclusion
tag, _tooltip.html partial with .tt/.tt-title/.tt-description etc.
class contract; 34 tests green
- Kit bag panel (_kit_bag_panel.html): .token-tooltip → .tt + child
class renames (tt-title, tt-description, tt-shoptalk, tt-expiry)
- game-kit.js attachTooltip: .token-tooltip → .tt selector
- SCSS: .tt added alongside .token-tooltip for display:none default +
hover rules in _wallet-tokens.scss and _game-kit.scss
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
38
src/apps/tooltips/models.py
Normal file
38
src/apps/tooltips/models.py
Normal file
@@ -0,0 +1,38 @@
|
||||
from django.db import models
|
||||
|
||||
|
||||
class TooltipContent(models.Model):
|
||||
"""
|
||||
Static tooltip content for game objects — planets, signs, houses, cards, etc.
|
||||
|
||||
Required: slug (unique lookup key), title (display name).
|
||||
All other fields are optional; omitted fields render nothing in the template.
|
||||
|
||||
extras (JSONField) stores structured data that varies by tooltip type:
|
||||
dignities — dict {role: body/sign string, …}
|
||||
aspects — list [{symbol, type, body, orb}, …]
|
||||
keywords_up / keywords_rev — list of strings (card upright/reversed keywords)
|
||||
cautions — list [{title, type_label, shoptalk, effect}, …]
|
||||
nav — dict {prv: slug, nxt: slug} for PRV/NXT navigation
|
||||
"""
|
||||
|
||||
slug = models.SlugField(unique=True)
|
||||
title = models.CharField(max_length=200)
|
||||
|
||||
# Optional display fields
|
||||
type_label = models.CharField(max_length=100, blank=True)
|
||||
symbol = models.CharField(max_length=10, blank=True)
|
||||
degree_str = models.CharField(max_length=40, blank=True)
|
||||
description = models.TextField(blank=True)
|
||||
shoptalk = models.TextField(blank=True)
|
||||
expiry = models.CharField(max_length=200, blank=True)
|
||||
effect = models.TextField(blank=True)
|
||||
|
||||
# Structured data for tabular / list / nav sections
|
||||
extras = models.JSONField(default=dict)
|
||||
|
||||
class Meta:
|
||||
ordering = ['slug']
|
||||
|
||||
def __str__(self):
|
||||
return self.title
|
||||
Reference in New Issue
Block a user