=> f06b6603318911c0284f48aea75894e9674acf33
[1mdiff --git a/50_bubble.py b/50_bubble.py[m [1mindex ba15474..ccd09c1 100644[m [1m--- a/50_bubble.py[m [1m+++ b/50_bubble.py[m [36m@@ -108,6 +108,7 @@[m [mBubble is open source:[m self.c_user = None # User associated with the context subspace, if any[m self.token = None[m self.notif_count = None[m [32m+[m[32m self.is_short_preview = False[m [m def set_user(self, user):[m self.user = user[m [36m@@ -115,6 +116,7 @@[m [mBubble is open source:[m if user.flags & User.ASCII_ICONS_FLAG:[m self.CHECKS = [ '[_]', '[x]' ][m # TODO: Add more of these.[m [32m+[m[32m self.is_short_preview = (user.flags & User.SHORT_PREVIEW_FLAG) != 0[m [m def is_likes_enabled(self):[m enabled = self.bubble.likes_enabled[m [36m@@ -217,9 +219,12 @@[m [mBubble is open source:[m author = '๐ ' + sub if sub else (post.poster_avatar + ' ' + post.poster_name)[m author_link = sub if sub else '/u/' + post.poster_name[m [m [32m+[m[32m SHORT_PREVIEW_LEN = 160[m [32m+[m if is_issue_tracker:[m src = f'=> {post.page_url()} ๐ [#{post.issueid if post.issueid else 0}] {post.title}{tag}\n'[m [31m- src += shorten_text(post.summary, 200) + '\n'[m [32m+[m[32m src += shorten_text(post.summary,[m [32m+[m[32m 200 if not self.is_short_preview else SHORT_PREVIEW_LEN) + '\n'[m parts = [][m parts.append(post.poster_name)[m if cmt: parts.append(cmt)[m [36m@@ -228,7 +233,8 @@[m [mBubble is open source:[m src += f'{post.poster_avatar} {" ยท ".join(parts)}{bell}\n'[m else:[m src = f'=> {author_link} {author}\n'[m [31m- src += post.summary[m [32m+[m[32m src += post.summary if not self.is_short_preview \[m [32m+[m[32m else shorten_text(post.summary, SHORT_PREVIEW_LEN) + '\n'[m parts = [][m if sub: parts.append(post.poster_name)[m if cmt: parts.append(cmt)[m [1mdiff --git a/model.py b/model.py[m [1mindex fad643e..5332999 100644[m [1m--- a/model.py[m [1m+++ b/model.py[m [36m@@ -188,6 +188,7 @@[m [mclass User:[m HIDE_LIKES_FLAG = 0x0004[m HIDE_REACTIONS_FLAG = 0x0008[m HIDE_THANKS_FLAG = 0x0010[m [32m+[m[32m SHORT_PREVIEW_FLAG = 0x0020[m [m def __init__(self, id, name, info, url, avatar, role, flags, notif, email, email_inter, \[m email_range, password, ts_password, ts_created, ts_active, sort_post, sort_cmt):[m [1mdiff --git a/settings.py b/settings.py[m [1mindex 53ce525..70d197b 100644[m [1m--- a/settings.py[m [1m+++ b/settings.py[m [36m@@ -234,7 +234,11 @@[m [mdef make_settings_page(session):[m [m elif req.path == session.path + 'settings/ascii':[m db.update_user(session.user, flags=(session.user.flags ^ User.ASCII_ICONS_FLAG))[m [31m- return 30, '/settings'[m [32m+[m[32m return 30, './display'[m [32m+[m [32m+[m[32m elif req.path == session.path + 'settings/short-preview':[m [32m+[m[32m db.update_user(session.user, flags=(session.user.flags ^ User.SHORT_PREVIEW_FLAG))[m [32m+[m[32m return 30, './display'[m [m elif req.path == session.path + 'settings/notif':[m notif = session.user.notif[m [36m@@ -489,20 +493,31 @@[m [mdef make_settings_page(session):[m page += '\n'[m return page[m [m [32m+[m[32m elif req.path == session.path + 'settings/display':[m [32m+[m[32m page += f'# {session.user.name}: Settings\n'[m [32m+[m[32m page += '=> /settings โ๏ธ Go back\n\n'[m [32m+[m [32m+[m[32m ICON_MODE = [ 'Unicode/Emoji' , 'ASCII' ][m [32m+[m [32m+[m[32m page += '## Display\n\n'[m [32m+[m[32m page += f'=> /settings/short-preview {session.CHECKS[nonzero(session.user.flags & User.SHORT_PREVIEW_FLAG)]} Short post previews\n'[m [32m+[m[32m page += f'=> /settings/ascii Display icons as: {ICON_MODE[nonzero(session.user.flags & User.ASCII_ICONS_FLAG)]}\n'[m [32m+[m[32m return page[m [32m+[m elif req.path == session.path + 'settings':[m page = f'# {session.user.name}: Settings\n'[m [31m- page += f'\n=> /u/{session.user.name} {session.user.avatar} Back to u/{session.user.name}\n\n'[m [32m+[m[32m page += f'\n=> /dashboard Back to Dashboard\n'[m [32m+[m[32m page += f'=> / Back to front page\n\n'[m [m SORT_POST = { 'r': '๐ Most recent', 'h': '๐ฅ Hotness' }[m SORT_COMMENT = { 'o': 'โฌ Oldest first', 'n': 'โฌ Newest first' }[m HOME_FEED = [ 'All Posts', 'Followed' ][m [31m- ICON_MODE = [ 'Unicode/Emoji' , 'ASCII' ][m user_space = db.get_subspace(owner=session.user.id)[m [m page += f'=> /settings/homefeed Home feed: {HOME_FEED[nonzero(session.user.flags & User.HOME_FOLLOWED_FEED_FLAG)]}\n'[m page += f'=> /settings/sort-feed Sort posts: {SORT_POST[session.user.sort_post]}\n'[m page += f'=> /settings/sort-cmt Sort comments: {SORT_COMMENT[session.user.sort_cmt]}\n'[m [31m- page += f'=> /settings/ascii Display icons as: {ICON_MODE[nonzero(session.user.flags & User.ASCII_ICONS_FLAG)]}\n'[m [32m+[m [m page += f'\n=> /settings/omit-all {session.CHECKS[nonzero(user_space.flags & Subspace.OMIT_FROM_ALL_FLAG)]} ' + \[m f'Omit u/{session.user.name} from All Posts\n'[m [36m@@ -511,6 +526,7 @@[m [mdef make_settings_page(session):[m page += 'Individual posts can be included or excluded from the Gemini feed using the composer.\n'[m [m page += '\n=> /settings/profile โ๏ธ Profile\n'[m [32m+[m[32m page += '=> /settings/display โ๏ธ Display\n'[m page += '=> /settings/notif โ๏ธ Notifications\n'[m page += '=> /settings/feedback โ๏ธ Feedback\n'[m page += '=> /settings/follow โ๏ธ Followed and muted\n'[m [36m@@ -527,9 +543,6 @@[m [mdef make_settings_page(session):[m page += f'\n=> /settings/delete-account/{session.get_token()} โ ๏ธ Delete user {session.user.name}\n'[m page += 'All of your posts and comments will be deleted.\n'[m [m [31m- page += '\n=> /s/ ๐ Subspaces\n'[m [31m- page += f'=> / {session.bubble.site_icon} Back to front page\n'[m [31m-[m page += f'\n๐ฌ Bubble v{session.bubble.version} by @jk@skyjake.fi\n'[m return page[m [m
text/gemini; charset=utf-8
This content has been proxied by September (ba2dc).