Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
biaogebusy committed Nov 23, 2024
2 parents ed46bbc + 6613fe1 commit ded576e
Show file tree
Hide file tree
Showing 60 changed files with 802 additions and 733 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<div class="header-banner relative">
<app-dynamic-component
[inputs]="{ content: content }" />
<app-dynamic-component [inputs]="{ content: content }" />
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@
<app-github-star class="github mx-4" />
@for (item of content.banner.right; track item) {
@if (item?.svg) {
<a
class="inv-icon style-v1"
href="{{ item.href }}"
target="_blank">
<a class="inv-icon style-v1" href="{{ item.href }}" target="_blank">
<span class="soc-name">{{ item.label }}</span>
<span class="soc-icon-bg"></span>
@if (item.svg) {
Expand Down
13 changes: 7 additions & 6 deletions src/app/core/branding/header/header.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
@if (branding$ | async; as branding) {
@if (!(contentState.pageConfig$ | async)?.headerMode?.transparent) {
<header>
<div
class="static"
[class.header-inverse]="branding?.header?.params?.inverse">
<div class="static" [class.header-inverse]="branding?.header?.params?.inverse">
@if (showBanner) {
<app-header-banner [content]="branding?.header?.banner" />
}
Expand All @@ -18,15 +16,17 @@
<app-menu
class="sticky"
[class.sticking]="sticky"
[class.header-inverse]="branding?.header?.params?.inverse" />
[class.header-inverse]="branding?.header?.params?.inverse"
/>
</header>
} @else {
<header
#header
id="transparent-mode"
class="transparent-mode"
[class.header-inverse]="branding.header.params.inverse"
[ngClass]="(contentState.pageConfig$ | async)?.headerMode?.style">
[ngClass]="(contentState.pageConfig$ | async)?.headerMode?.style"
>
<div class="static">
@if (branding.header.top) {
<app-header-top [content]="branding.header.top" />
Expand All @@ -41,7 +41,8 @@
id="transparent-mode"
class="transparent-mode"
[class.header-inverse]="branding.header.params.inverse"
[ngClass]="(contentState.pageConfig$ | async)?.headerMode?.style">
[ngClass]="(contentState.pageConfig$ | async)?.headerMode?.style"
>
<div class="static">
@if (branding.header.top) {
<app-header-top [content]="branding.header.top" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
@if (multiLang && currentLang) {
<div class="lang-switch">
<button
aria-label="switch language"
mat-icon-button
[mat-menu-trigger-for]="menu">
<app-icon [content]="{ svg: 'translate', inline: true }" />
<button aria-label="switch language" mat-button [mat-menu-trigger-for]="menu">
{{ currentLang.label }}
</button>
<mat-menu #menu="matMenu">
@for (lang of langs; track lang) {
<button
(click)="onSwitchLanguage(lang)"
aria-label="switch lang item"
mat-menu-item>
<button (click)="onSwitchLanguage(lang)" aria-label="switch lang item" mat-menu-item>
@if (currentLang.langCode !== lang.langCode) {
<mat-icon>radio_button_unchecked</mat-icon>
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<app-link
class="top {{ content.href ? 'is-link' : 'not-link' }}"
[content]="content" />
<app-link class="top {{ content.href ? 'is-link' : 'not-link' }}" [content]="content" />
@if (content.child && content.child.length > 0) {
<div class="hover-menu" [class.active]="active">
<div *ngTemplateOutlet="child; context: { content: content }"></div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@
@if (params.menuHoverOpen) {
<app-hover-menu [content]="content" />
} @else {
<app-link
class="top"
[content]="content"
[matMenuTriggerFor]="menu.childMenu" />
<app-link class="top" [content]="content" [matMenuTriggerFor]="menu.childMenu" />
<app-sub-menu #menu [content]="content" />
}
<!-- click open -->
Expand Down
54 changes: 24 additions & 30 deletions src/app/core/branding/header/menu/menu.component.html
Original file line number Diff line number Diff line change
@@ -1,45 +1,40 @@
@if (branding$ | async; as branding) {
@let header = branding.header;
@if (show) {
<header class="header">
<div class="container">
<div
class="header-container flex flex-row {{
branding.header.logo
? 'justify-between items-center'
: 'justify-end items-center'
}}">
@if (branding.header.logo) {
<div class="header-left one-line">
<app-logo [content]="branding.header.logo" />
class="header-container flex flex-row gap-5 {{
header.logo ? 'justify-between items-center' : 'justify-end items-center'
}}"
>
@if (header.logo) {
<div class="header-left one-line flex-[0_0_auto]">
<app-logo [content]="header.logo" />
</div>
}
<div
class="header-right flex flex-row justify-center items-center gap-3 md:gap-5">
@if (branding.header.mainMenu) {
class="header-right flex flex-row justify-center items-center gap-2 md:gap-3 xl:gap-5"
>
@if (header.mainMenu) {
<div class="menu-inner">
<div class="main-menu flex flex-row">
@for (
menu of branding.header.mainMenu;
track trackByFn($index, menu)
) {
@for (menu of header.mainMenu; track trackByFn($index, menu)) {
<div class="item">
@if (branding.header.params) {
<app-item-menu
[params]="branding.header.params"
[content]="menu" />
@if (header.params) {
<app-item-menu [params]="header.params" [content]="menu" />
}
</div>
}
</div>
</div>
}
@if (branding.header.search.enable) {
<app-search-box
[content]="branding.header.search" />
@if (header.search.enable) {
<app-search-box [content]="header.search" />
}
@if (branding.header.actions) {
@if (header.actions) {
<div class="actions">
@for (action of branding.header.actions; track action) {
@for (action of header.actions; track action) {
<button color="primary" mat-raised-button>
<app-link [content]="action" />
</button>
Expand All @@ -49,12 +44,11 @@
@if (coreConfig.notify?.enable) {
<app-notify class="has-icon" />
}
@if (branding.header.params.themeSwitch) {
@if (header.params.themeSwitch) {
<app-switch-theme class="has-icon" />
}
@if (branding.header.params.userInfo) {
<app-user-menu
[content]="branding.header.userMenu" />
@if (header.params.userInfo) {
<app-user-menu [content]="header.userMenu" />
}
<app-lang-switch />
</div>
Expand All @@ -75,16 +69,16 @@
</button>
@if (!isDrawer) {
<span class="spacer"></span>
<span class="app-name">{{ branding.header.logo?.label }}</span>
<span class="app-name">{{ header.logo?.label }}</span>
<span class="spacer"></span>
<app-switch-theme />
<app-user-menu class="m-left-xs" />
}
</mat-toolbar>
}
<div [hidden]="!(!show && isDrawer)">
@if (branding.header.mainMenu) {
<app-accordion [content]="branding.header.mainMenu" />
@if (header.mainMenu) {
<app-accordion [content]="header.mainMenu" />
}
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<div class="search-box">
<form
(ngSubmit)="search(form.value)"
[formGroup]="form"
matTooltip="{{ content.tooltip }}">
<form (ngSubmit)="search(form.value)" [formGroup]="form" matTooltip="{{ content.tooltip }}">
<div class="js-form-type-search">
<a href="{{ content.link }}" target="_blank" title="Search">
<mat-icon>search</mat-icon>
Expand All @@ -16,11 +13,13 @@
value="{{ content.value }}"
class="form-search"
[matAutocomplete]="auto"
placeholder="{{ content.placeholder }}" />
placeholder="{{ content.placeholder }}"
/>
<mat-autocomplete
class="search-box-list"
#auto="matAutocomplete"
(optionSelected)="onSelected($event)">
(optionSelected)="onSelected($event)"
>
@for (option of options; track trackByFn($index, option)) {
<mat-option [value]="option.href">
<app-link [content]="option" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
<div class="user">
@if (!(user$ | async)) {
<button
aria-label="user login"
color="primary"
(click)="onLogin()"
mat-mini-fab>
<button aria-label="user login" color="primary" (click)="onLogin()" mat-mini-fab>
<mat-icon>person</mat-icon>
</button>
}
@if (user$ | async; as user) {
@if (!user.picture) {
<button
aria-label="user name"
mat-mini-fab
color="primary"
[matMenuTriggerFor]="menu">
<button aria-label="user name" mat-mini-fab color="primary" [matMenuTriggerFor]="menu">
<h3 class="name">
{{ utilities.getIndexTitle(user.display_name || 'N') }}
</h3>
Expand All @@ -24,14 +16,16 @@ <h3 class="name">
class="user-picture"
[matMenuTriggerFor]="menu"
[src]="user.picture"
alt="{{ user.display_name }}" />
alt="{{ user.display_name }}"
/>
}
<ng-template #picture>
<img
class="user-picture"
[matMenuTriggerFor]="menu"
[src]="user.picture"
alt="{{ user.display_name }}" />
alt="{{ user.display_name }}"
/>
</ng-template>
<mat-menu #menu="matMenu" class="user-dropdown">
<a mat-menu-item [routerLink]="userService.userPage">
Expand Down
6 changes: 6 additions & 0 deletions src/app/core/interface/manage/ITaxonomy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export interface ITaxonomy {
title: string;
params: {
api: string;
};
}
Loading

0 comments on commit ded576e

Please sign in to comment.