mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 19:36:56 -08:00
API: provide route back from x-api theme
This commit is contained in:
parent
111d726de7
commit
852d784c7f
2 changed files with 17 additions and 2 deletions
|
@ -40,6 +40,7 @@
|
||||||
<link id="icon_32" rel="icon" type="image/png" sizes="32x32" href="">
|
<link id="icon_32" rel="icon" type="image/png" sizes="32x32" href="">
|
||||||
<link id="icon_16" rel="icon" type="image/png" sizes="16x16" href="">
|
<link id="icon_16" rel="icon" type="image/png" sizes="16x16" href="">
|
||||||
<link id="icon_shortcut" rel="shortcut icon" type="image/png" href="">
|
<link id="icon_shortcut" rel="shortcut icon" type="image/png" href="">
|
||||||
|
<link id="favicon" rel='icon' type="image/x-icon" href="">
|
||||||
|
|
||||||
{{ bootstrap.load_css() }}
|
{{ bootstrap.load_css() }}
|
||||||
<link href="{{ '/static/themes/' + theme() + '/css/navbars.css' }}" rel="stylesheet">
|
<link href="{{ '/static/themes/' + theme() + '/css/navbars.css' }}" rel="stylesheet">
|
||||||
|
|
|
@ -26,10 +26,23 @@ if (jwt != null) {
|
||||||
'</ul>' +
|
'</ul>' +
|
||||||
'</li>' +
|
'</li>' +
|
||||||
|
|
||||||
'<li class="nav-item"><a class="nav-link" href="/api/alpha/auth/logout">Logout</a></li>';
|
'<li class="nav-item"><a class="nav-link" href="/user/settings">User settings</a></li>' +
|
||||||
|
|
||||||
|
'<li class="nav-item"><a class="nav-link" href="/donate">Donate</a></li>' +
|
||||||
|
|
||||||
|
'<li class="nav-item"><a class="nav-link" href="/api/alpha/auth/logout">Logout (via API)</a></li>';
|
||||||
} else {
|
} else {
|
||||||
var request = {method: "GET"};
|
var request = {method: "GET"};
|
||||||
ul.innerHTML = '<li class="nav-item"><a class="nav-link" href="/api/alpha/auth/login">Log in</a></li>' +
|
ul.innerHTML = '<li class="nav-item"><a class="nav-link" href="/api/alpha/auth/login">Log in (via API)</a></li>' +
|
||||||
|
'<li class="nav-item dropdown">' +
|
||||||
|
'<a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">' +
|
||||||
|
'Communities' +
|
||||||
|
'</a>' +
|
||||||
|
'<ul class="dropdown-menu">' +
|
||||||
|
'<li><a class="dropdown-item" href="/api/alpha/communities">All communities</a></li>' +
|
||||||
|
'</ul>' +
|
||||||
|
'</li>' +
|
||||||
|
'<li class="nav-item"><a class="nav-link" href="/user/settings">User settings</a></li>' +
|
||||||
'<li class="nav-item"><a class="nav-link" href="/donate">Donate</a></li>';
|
'<li class="nav-item"><a class="nav-link" href="/donate">Donate</a></li>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,6 +55,7 @@ fetch(api, request)
|
||||||
document.querySelector('#icon_32').href = data.site.icon_32;
|
document.querySelector('#icon_32').href = data.site.icon_32;
|
||||||
document.querySelector('#icon_16').href = data.site.icon_16;
|
document.querySelector('#icon_16').href = data.site.icon_16;
|
||||||
document.querySelector('#icon_shortcut').href = data.site.icon_32;
|
document.querySelector('#icon_shortcut').href = data.site.icon_32;
|
||||||
|
document.querySelector('#favicon').href = baseUrl + '/static/images/favicon.ico';
|
||||||
|
|
||||||
// navbar
|
// navbar
|
||||||
document.querySelector('#navbar_title').innerHTML = '<img src="' + data.site.icon + '" alt="Logo" width="36" height="36" />' + ' ' + data.site.name;
|
document.querySelector('#navbar_title').innerHTML = '<img src="' + data.site.icon + '" alt="Logo" width="36" height="36" />' + ' ' + data.site.name;
|
||||||
|
|
Loading…
Add table
Reference in a new issue