From cdc567ae5dc7075c5179700e4ab4b7c7de109f59 Mon Sep 17 00:00:00 2001

From: =?UTF-8?q?Jaakko=20Kera=CC=88nen?= jaakko.keranen@iki.fi

Date: Sun, 29 Oct 2023 06:54:18 +0200

Subject: [PATCH 1/1] Improved structure and formatting of a comment page

Added level 1 heading, reordered actions a bit.


feeds.py | 22 +++++++++++++++-------

1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/feeds.py b/feeds.py

index 9cf6e82..1b823ce 100644

--- a/feeds.py

+++ b/feeds.py

@@ -254,10 +254,11 @@ def make_post_page(session, post):

     last_age = focused_cmt.age()

     post_id = post.parent

     post = db.get_post(id=post_id)

     if post:

         page += f'=> {post.page_url()} Re: "{post.title if post.title else shorten_text(strip_links(clean_title(post.summary)), 60)}"\n'

         sub_name = ("u/" if post.sub_owner else "s/") + post.sub_name

     else:

         if not session.user or session.user.id != focused_cmt.user:

             # Can't view others' comments on deleted posts, just your own.

@@ -273,19 +274,22 @@ def make_post_page(session, post):

         if post:

             if session.is_editable(focused_cmt):

                 actions.append(f'=> /edit/{focused_cmt.id} ✏️ Edit comment\n')

                     session.user.role != User.LIMITED:

             if session.is_thanks_enabled() and focused_cmt.user != user.id:

                 actions.append(f'=> /thanks/{focused_cmt.id} 🙏 Give thanks\n')

         if actions:

             page += '\n## Actions\n' + ''.join(actions)

         page += '\n' + session.dashboard_link()

     if post:

     else:

         op_section = ''

@@ -450,8 +454,11 @@ def make_post_page(session, post):

         comments = list(filter(lambda p: p.id != focused_cmt.id and p.user == focused_cmt.user,

                                comments))

 n = len(comments)

 if n > 0 or commits or incoming_xrefs:

     if n > 1:

         dir_icon = ' ↑' if display_order_desc else ' ↓'

     else:

@@ -523,7 +530,8 @@ def make_post_page(session, post):

         page += '\n' + rendered

 # Show the Comment action at the appropriate place wrt reading direction.

     and session.user.role != User.LIMITED

     and post

     and not session.is_context_locked

--

2.25.1

Proxy Information
Original URL
gemini://git.skyjake.fi/bubble/main/patch/cdc567ae5dc7075c5179700e4ab4b7c7de109f59.patch
Status Code
Success (20)
Meta
text/plain
Capsule Response Time
72.938881 milliseconds
Gemini-to-HTML Time
1.384642 milliseconds

This content has been proxied by September (ba2dc).