From 6510b59ecd846d1825baee8ad73ea141e4e664c3 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Wed, 8 Aug 2018 18:32:41 +0200 Subject: [PATCH] idk some stuff --- db.py | 37 ++++++++++++++++++++++++++++++ static/nryg.less | 4 ++-- templates/main.html | 47 ++++++++++++++++++++++----------------- templates/minis/dota.html | 2 +- templates/profile.html | 12 +++++----- 5 files changed, 74 insertions(+), 28 deletions(-) diff --git a/db.py b/db.py index 255e8ef3..15b226bc 100644 --- a/db.py +++ b/db.py @@ -871,6 +871,43 @@ class Event(Base): self.time = datetime.datetime.now() + value +class GameProgress(enum.Enum): + NOT_STARTED = 0 + IN_PROGRESS = 1 + BEATEN = 2 + COMPLETED = 3 + MASTERED = 4 + + +class GameOrigins(enum.Enum): + DIGITAL = 0 + PHYSICAL = 1 + SOLD = 2 + BORROWED = 3 + RENTED = 4 + MYSTERIOUS = 5 # yarr + + +class LibraryGame(Base): + __tablename__ = "librarygames" + + owner_id = Column(Integer, ForeignKey("royals_id"), nullable=False) + owner = relationship("Royal", lazy="joined") + name = Column(String) + platform = Column(String) + steam_game_id = Column(BigInteger) + progress = Column(Enum(GameProgress), default=GameProgress.NOT_STARTED) + progress_notes = Column(Text) + time_played = Column(Float) + rating = Column(Integer) + review = Column(Text) + origin = Column(Enum(GameOrigins)) + physical = Column(Boolean, default=False) + current_achievements = Column(Integer) + maximum_achievements = Column(Integer) + extra_notes = Column(Text) + + # If run as script, create all the tables in the db if __name__ == "__main__": print("Creating new tables...") diff --git a/static/nryg.less b/static/nryg.less index 8078184c..6c071a63 100644 --- a/static/nryg.less +++ b/static/nryg.less @@ -147,7 +147,7 @@ nav { margin-left: 4px; margin-right: 4px; - &.upper-box { + .upper-box { margin-top: 4px; border-radius: 4px 4px 0 0; background-color: rgba(red(@text-color), green(@text-color), blue(@text-color), 0.2); @@ -156,7 +156,7 @@ nav { font-weight: bold; } - &.lower-box { + .lower-box { margin-bottom: 4px; border-radius: 0 0 4px 4px; } diff --git a/templates/main.html b/templates/main.html index b4835195..34608311 100644 --- a/templates/main.html +++ b/templates/main.html @@ -10,31 +10,38 @@
-
+
+
Prossimi eventi -
-
- {% for event in next_events %} - {% include "/components/event.html" %} - {% endfor %} -
-
- Pagine Wiki -
-
-
+
+ {% for event in next_events %} + {% include "/components/event.html" %} {% endfor %} - +
-
- Citazione casuale dal diario +
+
+ Pagine Wiki +
+
+ +
-
- {% include "components/diarioentry.html" %} - Visualizza tutto +
+
+ Citazione casuale dal diario +
+
+ {% include "components/diarioentry.html" %} + Visualizza tutto +
+
diff --git a/templates/minis/dota.html b/templates/minis/dota.html index 9310e53a..5321ef13 100644 --- a/templates/minis/dota.html +++ b/templates/minis/dota.html @@ -1,7 +1,7 @@