From 35cbe04e67ca59a657bc685f0764a7737115333d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9=20Gl=C3=BCpker?= <git@wgmd.de>
Date: Tue, 16 Feb 2021 17:50:50 +0100
Subject: Show age of accounts on premadefinder

---
 main.py                       |  1 +
 static/style.css              |  9 +++++++++
 templates/premades_html.jinja | 15 +++++++++++++++
 3 files changed, 25 insertions(+)

diff --git a/main.py b/main.py
index 1583184..ae15acf 100755
--- a/main.py
+++ b/main.py
@@ -167,6 +167,7 @@ def premades():
             steamids=steamids,
             profiles=premadedata,
             display_time=display_time,
+            current_time = time.time(),
             connections=connections
             )
 
diff --git a/static/style.css b/static/style.css
index 9544769..a4837ee 100644
--- a/static/style.css
+++ b/static/style.css
@@ -85,6 +85,15 @@ div.player {
   padding: 0;
   /* border: 1px solid black; */
 }
+div.miniplayer {
+  display: inline-block;
+  width: 200px;
+  min-height: 50px;
+  text-align: center;
+  margin: 2px 5px 2px 5px;
+  padding: 0;
+  /* border: 1px solid black; */
+}
 /* Intern box of playerbox */
 div.interna {
   display: inline-block;
diff --git a/templates/premades_html.jinja b/templates/premades_html.jinja
index 3bf6b55..c9ad464 100644
--- a/templates/premades_html.jinja
+++ b/templates/premades_html.jinja
@@ -129,5 +129,20 @@
     </div>
   {% endif %}
 
+  <hr />
+
+  {% for steamid in steamids %}
+    {# {{ profiles[steamid] }} #}
+    <div class="miniplayer">
+      <a href="{{ profiles[steamid]['profileurl'] }}">
+        <img src="{{ profiles[steamid]['avatarmedium'] }}"><br />
+        {{ profiles[steamid]['personaname']|e }}
+        {% if 'timecreated' in profiles[steamid] %}
+          <br />{{ display_time(current_time - profiles[steamid]['timecreated']) }}
+        {% endif %}
+      </a>
+    </div>
+  {% endfor %}
+
   </body>
 </html>
-- 
cgit v1.2.3