feat(dsi): add channels, search and server branding
Add Channels and Search links and load home-menu text from server settings.
This commit is contained in:
1 parent
cb689e6ef9
commit
298d602395
1 file changed
+7
-3
@@ -7,10 +7,14 @@ from reximemo import current_account, dsi_url, flipnote_buttons, make_menu, plac
|
||||
class PyResource(resource.Resource):
|
||||
isLeaf = True
|
||||
def render_GET(self, request):
|
||||
from server_config import load_config
|
||||
config = load_config()
|
||||
rows = Database.list_flipnotes(limit=8)
|
||||
account = current_account(request)
|
||||
buttons = [
|
||||
{"label": "Browse Flipnotes", "url": dsi_url(request, "allflipnotes.uls"), "icon_ntft": placeholder_icon("browse"), "embed_name": "browse.ntft"},
|
||||
{"label": "Channels", "url": dsi_url(request, "channels.uls"), "icon": 101},
|
||||
{"label": "Search", "url": dsi_url(request, "search.uls"), "icon": 112},
|
||||
{"label": "Account", "url": dsi_url(request, "sa/account.htm"), "icon_ntft": placeholder_icon("account"), "embed_name": "account.ntft"},
|
||||
]
|
||||
room = Database.room_for_account(account["id"]) if account else Database.room_for_ip(__import__('hatena').client_ip(request))
|
||||
@@ -20,9 +24,9 @@ class PyResource(resource.Resource):
|
||||
request.setHeader(b"content-type", b"text/plain")
|
||||
return make_menu(
|
||||
layout=(2, 1),
|
||||
title="RexiMemo OSE",
|
||||
subtitle_top="Open Source Edition",
|
||||
subtitle_bottom="Proxy build",
|
||||
title=config.get("site_name") or "RexiMemo OSE",
|
||||
subtitle_top=config.get("tagline") or "Open Source Edition",
|
||||
subtitle_bottom=config.get("welcome_message") or "Proxy build",
|
||||
left="Recent",
|
||||
right=str(Database.count_flipnotes()),
|
||||
buttons=buttons,
|
||||
|
||||
Reference in new issue
Block a user
