forked from rDrama/rDrama
1
0
Fork 0

Add exact timestamps to mod log.

Modlog only had ModAction.age_string visible. However, we sometimes
need to know the exact time an action was taken.
Adds `created_string` to ModAction, and exposes that to log.html.
master
Snakes 2022-05-16 11:33:26 -04:00
parent 42e0b77ca7
commit b6339ca95f
2 changed files with 7 additions and 1 deletions

View File

@ -60,6 +60,10 @@ class ModAction(Base):
years = int(months / 12)
return f"{years}yr ago"
@property
@lazy
def created_string(self):
return time.strftime('%d %b %Y %H:%M:%S UTC', time.gmtime(self.created_utc))
@property
def note(self):

View File

@ -106,7 +106,9 @@
<span>{{ma.string | safe}}</span>
</div>
<div class="text-gray-500">{{ma.age_string}} <a href="{{ma.permalink}}"><i class="far fa-link ml-1 text-muted"></i></a>
<div class="text-gray-500">
<span class="log--item-age" title="{{ ma.created_string }}">{{ma.age_string}}</span>
<a href="{{ma.permalink}}"><i class="far fa-link ml-1 text-muted"></i></a>
<a role="button" class="copy-link" role="button" data-clipboard-text="{{ma.permalink}}"><i class="far fa-copy ml-1 text-muted"></i></a>
</div>