From 9d89c9c42a0eae8b3edb5b024a627ec48a76d891 Mon Sep 17 00:00:00 2001
From: saravahdatipour <verpiderp@gmail.com>
Date: Mon, 13 Jan 2025 14:43:45 +0100
Subject: [PATCH] alphabetic order

---
 generate-index.py   | 21 +++++++++++++++------
 style.css           |  2 +-
 templates/base.html |  2 +-
 3 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/generate-index.py b/generate-index.py
index b13c586..ed6d5a3 100755
--- a/generate-index.py
+++ b/generate-index.py
@@ -105,11 +105,15 @@ def readIssuer(path):
     }
     issuer['identifier'] = '%s.%s' % (issuer['schememgr'], issuer['id'])
 
-    for fn in sorted(os.listdir(path + '/Issues')):
-        issuer['credentials'][fn] = readCredential(path + '/Issues/' + fn)
+    for filename in sorted(os.listdir(path + '/Issues')):
+        issuer['credentials'][filename] = readCredential(path + '/Issues/' + filename)
 
     return issuer
 
+def get_issuer_name(issuer_tuple):
+    filename, issuer = issuer_tuple   
+    return issuer['name']['en']  
+
 def readSchemeManager(path):
     schememgr = {}
 
@@ -139,11 +143,16 @@ def readSchemeManager(path):
     keyshareAttributeElements = xml.getElementsByTagName('KeyshareAttribute')
     if keyshareAttributeElements:
         schememgr['keyshareAttribute'] = getText(keyshareAttributeElements[0])
-
-    for fn in sorted(os.listdir(path)):
-        issuerPath = path + '/' + fn
+    issuer_list = []
+    for filename in sorted(os.listdir(path)):
+        issuerPath = path + '/' + filename
         if os.path.exists(issuerPath + '/description.xml'):
-            schememgr['issuers'][fn] = readIssuer(issuerPath)
+            issuer= readIssuer(issuerPath)
+            issuer_list.append((filename, issuer))
+    sorted_issuers=sorted(issuer_list, key=get_issuer_name)
+
+    for filename, issuer in sorted_issuers:
+        schememgr['issuers'][filename]= issuer
 
     return schememgr
 
diff --git a/style.css b/style.css
index 444c66b..990660c 100644
--- a/style.css
+++ b/style.css
@@ -111,7 +111,7 @@ h1,h2,h3 {
 }
 
 a {
-	color: #360c1d;
+	color: #3869d1;
 	text-decoration: none;
 }
 
diff --git a/templates/base.html b/templates/base.html
index bc1e4a7..c83bffd 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -93,7 +93,7 @@
                                                 <!-- Issuers Section -->
                                                 <div class="nav-text small text-muted fw-bold ps-3 mt-2">Issuers</div>
                                                 <ul class="nav flex-column">
-                                                    {% for issuerId, issuer in schememgr.issuers|dictsort %}
+                                                    {% for issuerId, issuer in schememgr.issuers.items() %}
                                                     <li class="nav-item">
                                                         <div class="d-flex align-items-center">
                                                             <!-- Issuer navigation link -->