4a91a7d2e2
* fix repo in api client Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org> * web: re-organise files to match their interface Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org> * core: include version in script tags Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org> * cleanup maybe broken Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org> * revert rename Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org> * web: get rid of Client.ts Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org> * move more to common Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org> * more moving Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org> * format Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org> * unfuck files that vscode fucked, thanks Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org> * move more Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org> * finish moving (maybe) Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org> * ok more moving Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org> * fix more stuff that vs code destroyed Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org> * get rid "web" prefix for virtual package Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org> * fix locales Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org> * use custom base element Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org> * fix css file Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org> * don't run autoDetectLanguage when importing locale Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org> * fix circular dependencies Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org> * web: fix build Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org> Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
62 lines
1.9 KiB
TypeScript
62 lines
1.9 KiB
TypeScript
import { AKElement } from "@goauthentik/elements/Base";
|
|
|
|
import { t } from "@lingui/macro";
|
|
|
|
import { CSSResult, TemplateResult, css, html } from "lit";
|
|
import { customElement, property } from "lit/decorators.js";
|
|
import { ifDefined } from "lit/directives/if-defined.js";
|
|
|
|
import PFAvatar from "@patternfly/patternfly/components/Avatar/avatar.css";
|
|
|
|
@customElement("ak-form-static")
|
|
export class FormStatic extends AKElement {
|
|
@property()
|
|
userAvatar?: string;
|
|
|
|
@property()
|
|
user = "";
|
|
|
|
static get styles(): CSSResult[] {
|
|
return [
|
|
PFAvatar,
|
|
css`
|
|
/* Form with user */
|
|
.form-control-static {
|
|
margin-top: var(--pf-global--spacer--sm);
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
}
|
|
.form-control-static .avatar {
|
|
display: flex;
|
|
align-items: center;
|
|
}
|
|
.form-control-static img {
|
|
margin-right: var(--pf-global--spacer--xs);
|
|
}
|
|
.form-control-static a {
|
|
padding-top: var(--pf-global--spacer--xs);
|
|
padding-bottom: var(--pf-global--spacer--xs);
|
|
line-height: var(--pf-global--spacer--xl);
|
|
}
|
|
`,
|
|
];
|
|
}
|
|
|
|
render(): TemplateResult {
|
|
return html`
|
|
<div class="form-control-static">
|
|
<div class="avatar">
|
|
<img
|
|
class="pf-c-avatar"
|
|
src="${ifDefined(this.userAvatar)}"
|
|
alt="${t`User's avatar`}"
|
|
/>
|
|
${this.user}
|
|
</div>
|
|
<slot name="link"></slot>
|
|
</div>
|
|
`;
|
|
}
|
|
}
|