=> 6a205f003f941fcfc701fef9e50fb0fc82a9a046
[1mdiff --git a/feeds.py b/feeds.py[m [1mindex c2ce07a..a53fc32 100644[m [1m--- a/feeds.py[m [1m+++ b/feeds.py[m [36m@@ -252,7 +252,7 @@[m [mdef make_post_page(session, post):[m if is_comment_page:[m # Switch to the parent post, but display it in preview mode.[m focused_cmt = post[m [31m- last_age = focused_cmt.age()[m [32m+[m[32m #last_age = focused_cmt.age()[m post_id = post.parent[m post = db.get_post(id=post_id)[m page += f'# Comment by {focused_cmt.poster_avatar} {focused_cmt.poster_name}\n\n'[m [36m@@ -267,7 +267,7 @@[m [mdef make_post_page(session, post):[m page += f'=> /help/deleted-post 🔒 Comment on a deleted post (ID:{post_id})\n\n'[m page += session.render_post(focused_cmt)[m page += f'\n=> /u/{focused_cmt.poster_name} {focused_cmt.poster_avatar} {focused_cmt.poster_name}\n'[m [31m- page += f'{last_age}\n'[m [32m+[m[32m page += f'{focused_cmt.age()}\n'[m [m # Comment actions.[m if user:[m [36m@@ -347,8 +347,8 @@[m [mdef make_post_page(session, post):[m elif not session.c_user:[m page += f'=> /{session.context.title()} Posted in: {session.context.title()}\n'[m page += poster_link[m [31m- last_age = post.age() if not session.is_archive else post.ymd_hm()[m [31m- page += f'{last_age}'[m [32m+[m[32m post_age = post.age() if not session.is_archive else post.ymd_hm()[m [32m+[m[32m page += f'{post_age}'[m if session.is_likes_enabled():[m liked = [][m if post.num_likes:[m [36m@@ -474,6 +474,7 @@[m [mdef make_post_page(session, post):[m [m # TODO: This may need paging when there is a long thread.[m rendered_comments = [][m [32m+[m[32m ts_now = time.time()[m for cmt in comments:[m [m # Commits are shown as links to the Git viewer.[m [36m@@ -487,10 +488,13 @@[m [mdef make_post_page(session, post):[m rendered_comments.append(cmt.incoming_entry())[m continue[m [m [32m+[m[32m comment_age = cmt.age() if not session.is_archive and ts_now - cmt.ts_created < 24 * 3600 else \[m [32m+[m[32m cmt.ymd_hm(tz=session.tz, time_prefix='at ')[m [32m+[m if not session.is_archive:[m [31m- src = f'=> /u/{cmt.poster_name}/{cmt.id} {cmt.poster_avatar} {cmt.poster_name}\n'[m [32m+[m[32m src = f'=> /u/{cmt.poster_name}/{cmt.id} {cmt.poster_avatar} {cmt.poster_name} · {comment_age}:\n'[m else:[m [31m- src = f'=> /u/{cmt.poster_name} {cmt.poster_avatar} {cmt.poster_name}\n'[m [32m+[m[32m src = f'=> /u/{cmt.poster_name} {cmt.poster_avatar} {cmt.poster_name} · {comment_age}:\n'[m comment_body = session.render_post(cmt)[m src += comment_body[m [m [36m@@ -505,22 +509,22 @@[m [mdef make_post_page(session, post):[m src += xref.outgoing_entry()[m [m # Hide the `age` if it's the same as the previous entry (in reading order).[m [31m- comment_age = cmt.age() if not session.is_archive else cmt.ymd_hm()[m [31m- if comment_age != last_age:[m [31m- last_age = comment_age[m [31m- else:[m [31m- comment_age = ''[m [31m-[m [31m- if session.user and (cmt.user == session.user.id or session.is_user_mod) and \[m [31m- not session.is_context_locked:[m [31m- # Actions on your own comments.[m [31m- age_suffix = f" · {comment_age}" if len(comment_age) else comment_age[m [31m- if session.is_editable(cmt) and post:[m [31m- src += f'=> /edit/{cmt.id} ✏️ Edit{age_suffix}\n'[m [31m- elif session.is_deletable(cmt):[m [31m- src += f'=> /edit/{cmt.id}/delete/{session.get_token()} ❌ Delete{age_suffix}\n'[m [31m- elif len(comment_age):[m [31m- src += comment_age + '\n'[m [32m+[m[32m # comment_age = cmt.age() if not session.is_archive else cmt.ymd_hm()[m [32m+[m[32m # if comment_age != last_age:[m [32m+[m[32m # last_age = comment_age[m [32m+[m[32m # else:[m [32m+[m[32m # comment_age = ''[m [32m+[m [32m+[m[32m # if session.user and (cmt.user == session.user.id or session.is_user_mod) and \[m [32m+[m[32m # not session.is_context_locked:[m [32m+[m[32m # # Actions on your own comments.[m [32m+[m[32m # age_suffix = f" · {comment_age}" if len(comment_age) else comment_age[m [32m+[m[32m # if session.is_editable(cmt) and post:[m [32m+[m[32m # src += f'=> /edit/{cmt.id} ✏️ Edit{age_suffix}\n'[m [32m+[m[32m # elif session.is_deletable(cmt):[m [32m+[m[32m # src += f'=> /edit/{cmt.id}/delete/{session.get_token()} ❌ Delete{age_suffix}\n'[m [32m+[m[32m # elif len(comment_age):[m [32m+[m[32m # src += comment_age + '\n'[m [m rendered_comments.append(src)[m [m [1mdiff --git a/model.py b/model.py[m [1mindex 6291eb1..96c6d04 100644[m [1m--- a/model.py[m [1m+++ b/model.py[m [36m@@ -371,11 +371,11 @@[m [mclass Post:[m dt = dt.astimezone(tz)[m return dt.strftime('%Y-%m-%d')[m [m [31m- def ymd_hm(self, tz=None):[m [32m+[m[32m def ymd_hm(self, tz=None, time_prefix=''):[m dt = datetime.datetime.fromtimestamp(self.ts_created, UTC)[m if tz:[m dt = dt.astimezone(tz)[m [31m- return dt.strftime('%Y-%m-%d %H:%M')[m [32m+[m[32m return dt.strftime(f'%Y-%m-%d {time_prefix}%H:%M')[m [m def ymd_hm_tz(self, tz=None):[m dt = datetime.datetime.fromtimestamp(self.ts_created, UTC)[m
text/gemini; charset=utf-8
This content has been proxied by September (3851b).