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

View File

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

View File

@ -8,11 +8,6 @@
</head>
<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>
<table class="tiles_top">
<tr>
@ -116,7 +111,11 @@
<div class="sidelist">
<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'>
<tr>
<td class='time'>KEY_SCROBBLE_TIME</td>