From 7309325e33c9f5420d2f1bf31f54a9ddbf4a709b Mon Sep 17 00:00:00 2001 From: Alexandre Pulido Date: Mon, 23 Oct 2023 18:13:11 +0200 Subject: [PATCH] ui: fix filters in library view --- app/static/style.css | 9 +++ app/templates/index.html | 163 ++++++++------------------------------- app/titles.py | 10 ++- 3 files changed, 50 insertions(+), 132 deletions(-) diff --git a/app/static/style.css b/app/static/style.css index 5367727..6ed2c6e 100644 --- a/app/static/style.css +++ b/app/static/style.css @@ -20,6 +20,10 @@ top: unset; } +.game-tag { + font-size: 1em; +} + .card { border-radius: 8px !important; /* linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent 50%), */ @@ -50,4 +54,9 @@ p.game-description { .btn-outline-info { --bs-btn-hover-color: #fff; +} + +.text-bg-warning { + color: #fff !important; + background-color: RGBA(var(--bs-warning-rgb),var(--bs-bg-opacity,1)) !important; } \ No newline at end of file diff --git a/app/templates/index.html b/app/templates/index.html index d2de805..b8377e5 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -88,31 +88,6 @@ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); } - /* Popup styles */ - .popup { - display: none; - position: fixed; - top: 0; - left: 0; - width: 100%; - height: 100%; - background-color: rgba(0, 0, 0, 0.7); - justify-content: center; - align-items: center; - z-index: 9999; - } - - .popup-content { - background-color: white; - padding: 20px; - border-radius: 8px; - max-width: 80%; - max-height: 80%; - overflow: auto; - position: relative; - /* Add position relative for absolute positioning */ - } - /* Close button */ .close-button { position: absolute; @@ -121,23 +96,6 @@ cursor: pointer; } - /* Buttons container at the bottom */ - .popup-buttons { - display: flex; - justify-content: flex-end; - margin-top: 20px; - } - - .popup-button { - background-color: #3498db; - color: white; - padding: 8px 16px; - border: none; - border-radius: 4px; - cursor: pointer; - margin-left: 10px; - } - /* Filtering buttons */ /* .filter-buttons { margin-bottom: 20px; @@ -191,7 +149,7 @@
-
@@ -208,16 +166,14 @@
-
-
-
+
{% for game in games %} -
+
@@ -226,9 +182,11 @@
{{ game.name }}

{{ game.id }}

{% if game.has_latest_version %} - Up to date + {% else %} - Outdated + {% endif %}
@@ -240,36 +198,14 @@
{{ game.name }}
- - - diff --git a/app/titles.py b/app/titles.py index 7548dcf..81822e5 100644 --- a/app/titles.py +++ b/app/titles.py @@ -124,7 +124,13 @@ def get_game_info(title_id): } except Exception: print(f"Title ID not found in titledb: {title_id}") - return None + return { + 'name': 'Unrecognized', + 'bannerUrl': '//placehold.it/400x200', + 'iconUrl': '', + 'id': title_id + ' not found in titledb', + 'category': '', + } def convert_nin_version(version): return int(version)//65536 @@ -135,7 +141,7 @@ def get_game_latest_version(all_existing_versions): def get_all_existing_versions(titleid): titleid = titleid.lower() if titleid not in versions_db: - print(f'Title ID not in versions.json: {titleid.upper()}') + # print(f'Title ID not in versions.json: {titleid.upper()}') return None versions_from_db = versions_db[titleid].keys()