Skip to content

Commit

Permalink
divination becomes cartomancy
Browse files Browse the repository at this point in the history
  • Loading branch information
ryaanahmed committed Sep 8, 2023
1 parent e009c3b commit 2e6c138
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 20 deletions.
13 changes: 4 additions & 9 deletions backend/app/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,8 @@
"""

from django.contrib import admin
from .models import Card, Deck
from .models import Card, Deck, Tarot


models_to_register = [
Card,
Deck,
]

for model in models_to_register:
admin.site.register(model)
admin.site.register(Card)
admin.site.register(Deck)
admin.site.register(Tarot)
11 changes: 5 additions & 6 deletions backend/app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class Card(models.Model):


def __str__(self):
return f'{self.deck.name} - {self.card}{self.suit}'
return f'{self.deck.name} - {self.rank}{self.suit}'

class Meta:
ordering = ['sort_order']
Expand All @@ -68,11 +68,7 @@ class Deck(models.Model):
# period is either B, D, or A (before, during, after revolution)

def __str__(self):
# this just prints a helpful string in python console.
# Can be whatever you need (like printing the name if it exists)
if self.name:
return f"{self.id}: {self.name}"
return f"{self.id}"
return f"{self.name} ({self.start_date})"

class Tarot(models.Model):
lang = models.CharField(max_length=2)
Expand All @@ -87,3 +83,6 @@ class Tarot(models.Model):
triple = models.CharField(max_length=20, blank=True)
double = models.CharField(max_length=20, blank=True)
image = models.FilePathField(path="assets/img/divination/", null=True)

def __str__(self):
return f"{self.card}"
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ const EndingScreen = ({ goToNext }) => {
};


const DivinationGame = () => {
const Cartomancy = () => {
const [screen, setScreen] = useState(0);
const [question, setQuestion] = React.useState(null);
const [cards, setCards] = React.useState(null);
Expand Down Expand Up @@ -375,4 +375,4 @@ const DivinationGame = () => {

};

export default DivinationGame;
export default Cartomancy;
2 changes: 1 addition & 1 deletion frontend/components/pages/Games.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const Games = () => {
{
img: "/static/img/games/cartomancy.jpg",
title: t('games.cartomancy'),
link: "/divination",
link: "/cartomancy",
},
];

Expand Down
4 changes: 2 additions & 2 deletions frontend/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import Explore from "./components/pages/Explore";
import Games from "./components/pages/Games";
import SolitaireSelect from "./components/pages/Solitaire";
import SolitaireGame from "./components/solitaire/SolitaireGame";
import DivinationGame from "./components/DivinationGame";
import Cartomancy from "./components/Cartomancy";
import Bibliography from "./components/pages/Bibliography";

ReactDOM.render(
Expand All @@ -42,7 +42,7 @@ ReactDOM.render(
<Route exact path="/solitaire/play/paris" element={<SolitaireGame deck="paris"/>} />
<Route exact path="/solitaire/play/dugourc" element={<SolitaireGame deck="dugourc"/>} />
<Route exact path="/solitaire/play/david" element={<SolitaireGame deck="david"/>} />
<Route exact path="/divination" element={<DivinationGame />} />
<Route exact path="/cartomancy" element={<Cartomancy />} />
<Route exact path="/material-aspects" element={<Material />} />
<Route exact path="/material-aspects/fronts" element={<Fronts />} />
<Route exact path="/material-aspects/backs" element={<Backs />} />
Expand Down

0 comments on commit 2e6c138

Please sign in to comment.