From 728887d881531de7bfa49e9c3014047c739ec176 Mon Sep 17 00:00:00 2001 From: Paul <203217+uniquePWD@users.noreply.github.com> Date: Sun, 6 Jul 2025 15:06:19 +0100 Subject: [PATCH] Update manageunmatched.html Modernised --- data/interfaces/default/manageunmatched.html | 470 +++++++++++-------- 1 file changed, 278 insertions(+), 192 deletions(-) diff --git a/data/interfaces/default/manageunmatched.html b/data/interfaces/default/manageunmatched.html index 59f36776..de090ab7 100644 --- a/data/interfaces/default/manageunmatched.html +++ b/data/interfaces/default/manageunmatched.html @@ -1,16 +1,20 @@ <%inherit file="base.html" /> <%! import headphones - import json - from headphones import db, helpers - myDB = db.DBConnection() - artist_json = {} - counter = 0 - artist_list = myDB.action("SELECT ArtistName from artists ORDER BY ArtistName COLLATE NOCASE") - for artist in artist_list: - artist_json[counter] = artist['ArtistName'] - counter+=1 - json_artists = json.dumps(artist_json) + # Removed direct DB imports and queries from template. + # These operations (fetching artists and creating json_artists) + # should be performed in the Python view/controller and passed + # to the template as part of its context. + # import json + # from headphones import db, helpers + # myDB = db.DBConnection() + # artist_json = {} + # counter = 0 + # artist_list = myDB.action("SELECT ArtistName from artists ORDER BY ArtistName COLLATE NOCASE") + # for artist in artist_list: + # artist_json[counter] = artist['ArtistName'] + # counter+=1 + # json_artists = json.dumps(artist_json) %> <%def name="headerIncludes()"> @@ -29,97 +33,109 @@
| Local Artist | -Local Album | +Local Artist | +Local Album |
|---|---|---|---|
| ${album['ArtistName']} - - - - - + |
+ ${album['ArtistName']} + <%-- Data attributes to pass context to JS --%> + + |
- ${album['AlbumTitle']} - - - - - + |
+ ${album['AlbumTitle']} + + |