Add a (simple) logo

This commit is contained in:
Olaf
2026-08-24 22:01:35 +02:00
parent 95992cc466
commit 4ae184f24c
20 changed files with 136 additions and 18 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ from urllib.request import Request, urlopen
from backend.app.plugins.base import BasePlugin
DEFAULT_POST_PREFIX = 'From my #LinkLog: "'
DEFAULT_POST_PREFIX = 'From my #LinkLog: '
class DefaultFrontendPlugin(BasePlugin):
+6 -4
View File
@@ -234,6 +234,7 @@ def test_logout_revokes_token_and_admin_can_list_plugins():
def test_public_and_admin_pages_render_html():
root_page = client.get('/')
assert 'LinkLog' in root_page.text
assert 'src="/static/logo.svg"' in root_page.text
assert 'class="menu-toggle"' in root_page.text
assert 'id="auth-menu" class="auth-menu hidden"' in root_page.text
assert 'id="auth-home-link" href="/">Home</a>' in root_page.text
@@ -255,6 +256,7 @@ def test_public_and_admin_pages_render_html():
assert client.get('/login').status_code == 200
login_page = client.get('/login').text
assert 'Sign in' in login_page
assert 'src="/static/logo.svg"' in login_page
assert 'id="auth-session" class="auth-session hidden"' in login_page
assert 'logout.js?v=3' in login_page
assert client.get('/admin').status_code == 200
@@ -300,7 +302,7 @@ def test_link_submission_posts_to_enabled_mastodon_plugin():
assert client.put('/api/user/plugins/mastodon', headers=headers, json={
'instance': base_url,
'access_token': 'test-token',
'post_prefix': 'From my #LinkLog: "',
'post_prefix': 'From my #LinkLog: ',
}).status_code == 200
assert client.put('/api/admin/plugins/mastodon', headers=headers, json={'enabled': True}).status_code == 200
@@ -315,7 +317,7 @@ def test_link_submission_posts_to_enabled_mastodon_plugin():
assert received['path'] == '/api/v1/statuses'
assert received['authorization'] == 'Bearer test-token'
assert received['body'] == {
'status': 'A useful page\nWorth sharing\nFrom my #LinkLog: "https://example.com/useful #python #web',
'status': 'A useful page\nWorth sharing\nFrom my #LinkLog: https://example.com/useful #python #web',
}
finally:
server.shutdown()
@@ -328,12 +330,12 @@ def test_plugin_config_can_be_saved_for_mastodon():
assert client.put('/api/user/plugins/mastodon', headers=headers, json={
'instance': 'mastodon.social',
'access_token': 'demo-token',
'post_prefix': 'From my #LinkLog: "',
'post_prefix': 'From my #LinkLog: ',
}).status_code == 200
payload = client.get('/api/user/plugins/mastodon', headers=headers).json()
assert payload['instance'] == 'mastodon.social'
assert payload['post_prefix'] == 'From my #LinkLog: "'
assert payload['post_prefix'] == 'From my #LinkLog: '
admin_update = client.put('/api/admin/plugins/mastodon', headers=headers, json={
'enabled': True,
+1 -1
View File
@@ -34,7 +34,7 @@ def test_user_config_api_and_profile_page():
assert 'name="avatar" type="file"' in page_response.text
assert 'name="avatar_url"' not in page_response.text
assert 'value="mastodon.social"' in page_response.text
assert 'From my #LinkLog: &quot;' in page_response.text
assert 'value="From my #LinkLog: "' in page_response.text
assert 'id="auth-menu" class="auth-menu hidden"' in page_response.text
assert 'id="auth-home-link" href="/">Home</a>' in page_response.text
assert 'id="auth-profile-link" class="hidden"' in page_response.text