web: add placeholder config, fix sizing of sidebar brand

This commit is contained in:
Jens Langhammer 2020-12-01 13:16:13 +01:00
parent 7bb26b5903
commit 71fbb23a2f
4 changed files with 278 additions and 9 deletions

View File

@ -4,8 +4,8 @@ from django.conf.urls.static import static
from django.contrib import admin
from django.urls import include, path
from django.views.generic import RedirectView
from structlog import get_logger
from django.views.i18n import JavaScriptCatalog
from structlog import get_logger
from passbook.core.views import error
from passbook.lib.utils.reflection import get_apps
@ -57,7 +57,7 @@ for _passbook_app in get_apps():
urlpatterns += [
path("administration/django/", admin.site.urls),
path("metrics/", MetricsView.as_view(), name="metrics"),
path("-/jsi18n/", JavaScriptCatalog.as_view(), name='javascript-catalog'),
path("-/jsi18n/", JavaScriptCatalog.as_view(), name="javascript-catalog"),
]
if settings.DEBUG:

View File

@ -102,6 +102,11 @@ paths:
description: A page number within the paginated result set.
required: false
type: integer
- name: page_size
in: query
description: Number of results to return per page.
required: false
type: integer
responses:
'200':
description: ''
@ -167,6 +172,11 @@ paths:
description: A page number within the paginated result set.
required: false
type: integer
- name: page_size
in: query
description: Number of results to return per page.
required: false
type: integer
responses:
'200':
description: ''
@ -310,6 +320,11 @@ paths:
description: A page number within the paginated result set.
required: false
type: integer
- name: page_size
in: query
description: Number of results to return per page.
required: false
type: integer
responses:
'200':
description: ''
@ -432,6 +447,11 @@ paths:
description: A page number within the paginated result set.
required: false
type: integer
- name: page_size
in: query
description: Number of results to return per page.
required: false
type: integer
responses:
'200':
description: ''
@ -573,6 +593,11 @@ paths:
description: A page number within the paginated result set.
required: false
type: integer
- name: page_size
in: query
description: Number of results to return per page.
required: false
type: integer
responses:
'200':
description: ''
@ -635,6 +660,11 @@ paths:
description: A page number within the paginated result set.
required: false
type: integer
- name: page_size
in: query
description: Number of results to return per page.
required: false
type: integer
responses:
'200':
description: User Serializer
@ -722,6 +752,11 @@ paths:
description: A page number within the paginated result set.
required: false
type: integer
- name: page_size
in: query
description: Number of results to return per page.
required: false
type: integer
responses:
'200':
description: ''
@ -884,6 +919,11 @@ paths:
description: A page number within the paginated result set.
required: false
type: integer
- name: page_size
in: query
description: Number of results to return per page.
required: false
type: integer
responses:
'200':
description: ''
@ -1006,6 +1046,11 @@ paths:
description: A page number within the paginated result set.
required: false
type: integer
- name: page_size
in: query
description: Number of results to return per page.
required: false
type: integer
responses:
'200':
description: ''
@ -1128,6 +1173,11 @@ paths:
description: A page number within the paginated result set.
required: false
type: integer
- name: page_size
in: query
description: Number of results to return per page.
required: false
type: integer
responses:
'200':
description: ''
@ -1250,6 +1300,11 @@ paths:
description: A page number within the paginated result set.
required: false
type: integer
- name: page_size
in: query
description: Number of results to return per page.
required: false
type: integer
responses:
'200':
description: ''
@ -1371,6 +1426,11 @@ paths:
description: A page number within the paginated result set.
required: false
type: integer
- name: page_size
in: query
description: Number of results to return per page.
required: false
type: integer
responses:
'200':
description: ''
@ -1493,6 +1553,11 @@ paths:
description: A page number within the paginated result set.
required: false
type: integer
- name: page_size
in: query
description: Number of results to return per page.
required: false
type: integer
responses:
'200':
description: ''
@ -1615,6 +1680,11 @@ paths:
description: A page number within the paginated result set.
required: false
type: integer
- name: page_size
in: query
description: Number of results to return per page.
required: false
type: integer
responses:
'200':
description: ''
@ -1705,6 +1775,11 @@ paths:
description: A page number within the paginated result set.
required: false
type: integer
- name: page_size
in: query
description: Number of results to return per page.
required: false
type: integer
responses:
'200':
description: ''
@ -1827,6 +1902,11 @@ paths:
description: A page number within the paginated result set.
required: false
type: integer
- name: page_size
in: query
description: Number of results to return per page.
required: false
type: integer
responses:
'200':
description: ''
@ -1949,6 +2029,11 @@ paths:
description: A page number within the paginated result set.
required: false
type: integer
- name: page_size
in: query
description: Number of results to return per page.
required: false
type: integer
responses:
'200':
description: ''
@ -2071,6 +2156,11 @@ paths:
description: A page number within the paginated result set.
required: false
type: integer
- name: page_size
in: query
description: Number of results to return per page.
required: false
type: integer
responses:
'200':
description: ''
@ -2193,6 +2283,11 @@ paths:
description: A page number within the paginated result set.
required: false
type: integer
- name: page_size
in: query
description: Number of results to return per page.
required: false
type: integer
responses:
'200':
description: ''
@ -2315,6 +2410,11 @@ paths:
description: A page number within the paginated result set.
required: false
type: integer
- name: page_size
in: query
description: Number of results to return per page.
required: false
type: integer
responses:
'200':
description: ''
@ -2437,6 +2537,11 @@ paths:
description: A page number within the paginated result set.
required: false
type: integer
- name: page_size
in: query
description: Number of results to return per page.
required: false
type: integer
responses:
'200':
description: ''
@ -2559,6 +2664,11 @@ paths:
description: A page number within the paginated result set.
required: false
type: integer
- name: page_size
in: query
description: Number of results to return per page.
required: false
type: integer
responses:
'200':
description: ''
@ -2681,6 +2791,11 @@ paths:
description: A page number within the paginated result set.
required: false
type: integer
- name: page_size
in: query
description: Number of results to return per page.
required: false
type: integer
responses:
'200':
description: ''
@ -2746,6 +2861,11 @@ paths:
description: A page number within the paginated result set.
required: false
type: integer
- name: page_size
in: query
description: Number of results to return per page.
required: false
type: integer
responses:
'200':
description: ''
@ -2868,6 +2988,11 @@ paths:
description: A page number within the paginated result set.
required: false
type: integer
- name: page_size
in: query
description: Number of results to return per page.
required: false
type: integer
responses:
'200':
description: ''
@ -2990,6 +3115,11 @@ paths:
description: A page number within the paginated result set.
required: false
type: integer
- name: page_size
in: query
description: Number of results to return per page.
required: false
type: integer
responses:
'200':
description: ''
@ -3112,6 +3242,11 @@ paths:
description: A page number within the paginated result set.
required: false
type: integer
- name: page_size
in: query
description: Number of results to return per page.
required: false
type: integer
responses:
'200':
description: ''
@ -3176,6 +3311,11 @@ paths:
description: A page number within the paginated result set.
required: false
type: integer
- name: page_size
in: query
description: Number of results to return per page.
required: false
type: integer
responses:
'200':
description: ''
@ -3297,6 +3437,11 @@ paths:
description: A page number within the paginated result set.
required: false
type: integer
- name: page_size
in: query
description: Number of results to return per page.
required: false
type: integer
responses:
'200':
description: ''
@ -3418,6 +3563,11 @@ paths:
description: A page number within the paginated result set.
required: false
type: integer
- name: page_size
in: query
description: Number of results to return per page.
required: false
type: integer
responses:
'200':
description: ''
@ -3571,6 +3721,11 @@ paths:
description: A page number within the paginated result set.
required: false
type: integer
- name: page_size
in: query
description: Number of results to return per page.
required: false
type: integer
responses:
'200':
description: ''
@ -3636,6 +3791,11 @@ paths:
description: A page number within the paginated result set.
required: false
type: integer
- name: page_size
in: query
description: Number of results to return per page.
required: false
type: integer
responses:
'200':
description: ''
@ -3758,6 +3918,11 @@ paths:
description: A page number within the paginated result set.
required: false
type: integer
- name: page_size
in: query
description: Number of results to return per page.
required: false
type: integer
responses:
'200':
description: ''
@ -3880,6 +4045,11 @@ paths:
description: A page number within the paginated result set.
required: false
type: integer
- name: page_size
in: query
description: Number of results to return per page.
required: false
type: integer
responses:
'200':
description: ''
@ -4002,6 +4172,11 @@ paths:
description: A page number within the paginated result set.
required: false
type: integer
- name: page_size
in: query
description: Number of results to return per page.
required: false
type: integer
responses:
'200':
description: ''
@ -4067,6 +4242,11 @@ paths:
description: A page number within the paginated result set.
required: false
type: integer
- name: page_size
in: query
description: Number of results to return per page.
required: false
type: integer
responses:
'200':
description: ''
@ -4189,6 +4369,11 @@ paths:
description: A page number within the paginated result set.
required: false
type: integer
- name: page_size
in: query
description: Number of results to return per page.
required: false
type: integer
responses:
'200':
description: ''
@ -4311,6 +4496,11 @@ paths:
description: A page number within the paginated result set.
required: false
type: integer
- name: page_size
in: query
description: Number of results to return per page.
required: false
type: integer
responses:
'200':
description: ''
@ -4433,6 +4623,11 @@ paths:
description: A page number within the paginated result set.
required: false
type: integer
- name: page_size
in: query
description: Number of results to return per page.
required: false
type: integer
responses:
'200':
description: ''
@ -4555,6 +4750,11 @@ paths:
description: A page number within the paginated result set.
required: false
type: integer
- name: page_size
in: query
description: Number of results to return per page.
required: false
type: integer
responses:
'200':
description: ''
@ -4677,6 +4877,11 @@ paths:
description: A page number within the paginated result set.
required: false
type: integer
- name: page_size
in: query
description: Number of results to return per page.
required: false
type: integer
responses:
'200':
description: ''
@ -4739,6 +4944,11 @@ paths:
description: A page number within the paginated result set.
required: false
type: integer
- name: page_size
in: query
description: Number of results to return per page.
required: false
type: integer
responses:
'200':
description: ''
@ -4921,6 +5131,11 @@ paths:
description: A page number within the paginated result set.
required: false
type: integer
- name: page_size
in: query
description: Number of results to return per page.
required: false
type: integer
responses:
'200':
description: ''
@ -5043,6 +5258,11 @@ paths:
description: A page number within the paginated result set.
required: false
type: integer
- name: page_size
in: query
description: Number of results to return per page.
required: false
type: integer
responses:
'200':
description: ''
@ -5165,6 +5385,11 @@ paths:
description: A page number within the paginated result set.
required: false
type: integer
- name: page_size
in: query
description: Number of results to return per page.
required: false
type: integer
responses:
'200':
description: ''
@ -5287,6 +5512,11 @@ paths:
description: A page number within the paginated result set.
required: false
type: integer
- name: page_size
in: query
description: Number of results to return per page.
required: false
type: integer
responses:
'200':
description: ''
@ -5409,6 +5639,11 @@ paths:
description: A page number within the paginated result set.
required: false
type: integer
- name: page_size
in: query
description: Number of results to return per page.
required: false
type: integer
responses:
'200':
description: ''
@ -5531,6 +5766,11 @@ paths:
description: A page number within the paginated result set.
required: false
type: integer
- name: page_size
in: query
description: Number of results to return per page.
required: false
type: integer
responses:
'200':
description: ''
@ -5653,6 +5893,11 @@ paths:
description: A page number within the paginated result set.
required: false
type: integer
- name: page_size
in: query
description: Number of results to return per page.
required: false
type: integer
responses:
'200':
description: ''
@ -5775,6 +6020,11 @@ paths:
description: A page number within the paginated result set.
required: false
type: integer
- name: page_size
in: query
description: Number of results to return per page.
required: false
type: integer
responses:
'200':
description: ''
@ -5897,6 +6147,11 @@ paths:
description: A page number within the paginated result set.
required: false
type: integer
- name: page_size
in: query
description: Number of results to return per page.
required: false
type: integer
responses:
'200':
description: ''
@ -6019,6 +6274,11 @@ paths:
description: A page number within the paginated result set.
required: false
type: integer
- name: page_size
in: query
description: Number of results to return per page.
required: false
type: integer
responses:
'200':
description: ''

View File

@ -143,6 +143,10 @@ export class Sidebar extends LitElement {
PageStyle,
NavStyle,
css`
.pf-c-nav__list .sidebar-brand {
max-height: 82px;
margin-bottom: 0.5rem;
}
.pf-c-nav__link {
--pf-c-nav__link--PaddingTop: 0.5rem;
--pf-c-nav__link--PaddingRight: 0.5rem;
@ -207,7 +211,7 @@ export class Sidebar extends LitElement {
return html`<div class="pf-c-page__sidebar-body">
<nav class="pf-c-nav" aria-label="Global">
<ul class="pf-c-nav__list">
<li class="pf-c-nav__item">
<li class="pf-c-nav__item sidebar-brand">
<pb-sidebar-brand></pb-sidebar-brand>
</li>
${SIDEBAR_ITEMS.map((i) => this.renderItem(i))}

View File

@ -5,10 +5,15 @@ import PageStyle from "@patternfly/patternfly/components/Page/page.css";
import GlobalsStyle from "@patternfly/patternfly/base/patternfly-globals.css";
import { Config } from "../../api/config";
export const DefaultConfig: Config = {
branding_logo: " /static/dist/assets/images/logo.svg",
branding_title: "passbook",
};
@customElement("pb-sidebar-brand")
export class SidebarBrand extends LitElement {
@property()
config?: Config;
config: Config = DefaultConfig;
static get styles() {
return [
@ -44,12 +49,12 @@ export class SidebarBrand extends LitElement {
if (!this.config) {
return html``;
}
return html` <a href="" class="pf-c-page__header-brand-link">
return html` <a href="#/" class="pf-c-page__header-brand-link">
<div class="pf-c-brand pb-brand">
<img src="${this.config?.branding_logo}" alt="passbook icon" loading="lazy" />
${this.config?.branding_title
? html`<span>${this.config.branding_title}</span>`
: ""}
<img src="${this.config.branding_logo}" alt="passbook icon" loading="lazy" />
${this.config.branding_title
? html`<span>${this.config.branding_title}</span>`
: ""}
</div>
</a>`;
}