1
0
mirror of https://github.com/krateng/maloja.git synced 2023-08-10 21:12:55 +03:00

Design changes

This commit is contained in:
Krateng 2019-02-03 17:36:21 +01:00
parent ed990f59fc
commit b5008675cd
3 changed files with 25 additions and 27 deletions

View File

@ -64,25 +64,22 @@ def getTimeDesc(timestamp,short=False):
import datetime import datetime
tim = datetime.datetime.utcfromtimestamp(timestamp) tim = datetime.datetime.utcfromtimestamp(timestamp)
if short: if short:
now = datetime.datetime.utcnow() now = datetime.datetime.now(tz=datetime.timezone.utc)
datestring = "" difference = int(now.timestamp() - timestamp)
if tim.year < now.year:
return str(tim.year) if difference < 10: return "just now"
if tim.month < now.month: if difference < 60: return str(difference) + " seconds ago"
return tim.strftime("%B") difference = int(difference/60)
if tim.day+1 < now.day: if difference < 60: return str(difference) + " minutes ago"
return tim.strftime("%d. %B") difference = int(difference/60)
if tim.day+1 == now.day: if difference < 24: return str(difference) + " hours ago"
return "yesterday" difference = int(difference/24)
if tim.hour+1 < now.hour: if difference < 7: return tim.strftime("%A")
return str(now.hour - tim.hour) + " hours ago" if difference < 31: return str(difference) + " days ago"
if tim.minute+1 < now.minute: #if difference < 300 and tim.year == now.year: return tim.strftime("%B")
return str(now.minute - tim.minute) + " minutes ago" #if difference < 300: return tim.strftime("%B %Y")
if tim.second+10 < now.second:
return str(now.second - tim.second) + " seconds ago" return tim.strftime("%d. %B %Y")
return "just now"
return tim.strftime("%d. %b %Y")
else: else:
return tim.strftime("%d. %b %Y %I:%M %p") return tim.strftime("%d. %b %Y %I:%M %p")

View File

@ -133,6 +133,7 @@ table td.icon {
background-position:center; background-position:center;
padding-right:6px;*/ padding-right:6px;*/
padding:0px; padding:0px;
padding-right:5px;
} }
table td.icon div { table td.icon div {
@ -140,11 +141,12 @@ table td.icon div {
height:20px; height:20px;
background-size:cover; background-size:cover;
background-position:center; background-position:center;
margin-right:4px;
} }
table td.artists,td.artist,td.title { table td.artists,td.artist,td.title {
width:500px; /*width:500px;*/
min-width:100px;
padding-right:15px;
white-space:nowrap; white-space:nowrap;
overflow:hidden; overflow:hidden;
text-overflow:ellipsis; text-overflow:ellipsis;

View File

@ -8,11 +8,6 @@
</head> </head>
<body> <body>
<span class="stats">Scrobbles today</span> KEY_SCROBBLES_TODAY
<br/><span class="stats">Scrobbles this month</span> KEY_SCROBBLES_MONTH
<br/><span class="stats">Scrobbles overall</span> KEY_SCROBBLES_TOTAL
<h1><a href="/topartists">Top Artists</a></h1> <h1><a href="/topartists">Top Artists</a></h1>
<table class="tiles_top"> <table class="tiles_top">
<tr> <tr>
@ -116,7 +111,11 @@
<div class="sidelist"> <div class="sidelist">
<h1><a href="/scrobbles?max=100">Last Scrobbles</a></h1> <h1><a href="/scrobbles?max=100">Last Scrobbles</a></h1>
<span class="stats">Today</span> KEY_SCROBBLES_TODAY
<span class="stats">This month</span> KEY_SCROBBLES_MONTH
<span class="stats">This year</span> KEY_SCROBBLES_YEAR
<span class="stats">All Time</span> KEY_SCROBBLES_TOTAL
<br/><br/>
<table class='list'> <table class='list'>
<tr> <tr>
<td class='time'>KEY_SCROBBLE_TIME</td> <td class='time'>KEY_SCROBBLE_TIME</td>