From 8ce768c69d58e8302049b1739f9031997b48a361 Mon Sep 17 00:00:00 2001 From: albertoh Date: Fri, 12 Apr 2024 11:17:23 +0200 Subject: [PATCH] #140 --- .../components/navbar/navbar.component.html | 6 ++-- .../components/navbar/navbar.component.ts | 31 ++---------------- .../admin-interface.component.html | 12 +++++-- .../admin-interface.component.ts | 26 ++++++++------- .../src/main/client/src/assets/i18n/cs.json | 5 ++- .../src/main/client/src/assets/i18n/en.json | 10 ++++-- searchapp/src/main/webapp/favicon.ico | Bin 0 -> 948 bytes 7 files changed, 38 insertions(+), 52 deletions(-) create mode 100644 searchapp/src/main/webapp/favicon.ico diff --git a/searchapp/src/main/client/src/app/journal/components/navbar/navbar.component.html b/searchapp/src/main/client/src/app/journal/components/navbar/navbar.component.html index 2ccd0a67..8c4a7089 100644 --- a/searchapp/src/main/client/src/app/journal/components/navbar/navbar.component.html +++ b/searchapp/src/main/client/src/app/journal/components/navbar/navbar.component.html @@ -4,9 +4,9 @@ {{ 'menu.actual_' | translate }} - - {{ m[state.currentLang] }}expand_more - + + {{ m[state.currentLang] }} expand_more + {{ m[state.currentLang] }} {{ m1[state.currentLang ]}} diff --git a/searchapp/src/main/client/src/app/journal/components/navbar/navbar.component.ts b/searchapp/src/main/client/src/app/journal/components/navbar/navbar.component.ts index 16726504..9ed22c05 100644 --- a/searchapp/src/main/client/src/app/journal/components/navbar/navbar.component.ts +++ b/searchapp/src/main/client/src/app/journal/components/navbar/navbar.component.ts @@ -28,7 +28,7 @@ export class NavbarComponent implements OnInit, OnDestroy { subscriptions: Subscription[] = []; - currentLang: string = 'cs'; + // currentLang: string = 'cs'; menu: any[] = []; public isCollapsed: boolean = false; @@ -45,38 +45,11 @@ export class NavbarComponent implements OnInit, OnDestroy { ngOnInit() { this.subscriptions.push(this.appservice.langSubject.subscribe(val => { - this.currentLang = val; + // this.currentLang = val; })); - // this.subscriptions.push(this.state.titleChangedSubject.subscribe(val => { - // if (this.state.actualNumber) { - // this.titleService.setTitle( this.state.actualNumber['root_title']!); - // this.meta.removeTag('name=description'); - // this.meta.removeTag('name=author'); - // this.meta.removeTag('name=keywords'); - - // this.meta.addTags( [ - // { name: 'description', content: this.state.currentMagazine.desc! }, - // { name: 'author', content: this.state.currentMagazine.vydavatel! }, - // { name: 'keywords', content: this.state.currentMagazine.keywords.join(',') } - // ]); - // } - // })); - this.menu = this.config.layout.menu; - - // this.state.fullScreenSubject.subscribe(val=> { - // if(!val){ - // setTimeout(()=>{ - // this.menu = this.config['menu']; - // }, 100); - // - // } else { - // this.menu = {}; - // } - // }); } - ngOnDestroy() { this.subscriptions.forEach((s: Subscription) => { s.unsubscribe(); diff --git a/searchapp/src/main/client/src/app/journal/pages/admin-interface/admin-interface.component.html b/searchapp/src/main/client/src/app/journal/pages/admin-interface/admin-interface.component.html index 0a686f2d..5a27f32e 100644 --- a/searchapp/src/main/client/src/app/journal/pages/admin-interface/admin-interface.component.html +++ b/searchapp/src/main/client/src/app/journal/pages/admin-interface/admin-interface.component.html @@ -58,13 +58,19 @@ {{ 'menu.url' | translate }} - + + + +
+ + {{ 'menu.name' | translate }} {{ 'magazines.lang.' + lang | translate }} +
diff --git a/searchapp/src/main/client/src/app/journal/pages/admin-interface/admin-interface.component.ts b/searchapp/src/main/client/src/app/journal/pages/admin-interface/admin-interface.component.ts index 5070487c..d34ff9da 100644 --- a/searchapp/src/main/client/src/app/journal/pages/admin-interface/admin-interface.component.ts +++ b/searchapp/src/main/client/src/app/journal/pages/admin-interface/admin-interface.component.ts @@ -25,10 +25,9 @@ declare var tinymce: any; interface MenuItem { id: string, route: string, - cs: string, - en: string, visible: boolean, - children: MenuItem[] + children: MenuItem[], + [lang: string]: any } @@ -277,14 +276,17 @@ export class AdminInterfaceComponent { } addChild(m: MenuItem) { - m.children.push({ + const item: MenuItem = { id: m.route + '_' + m.children.length, route: m.route + '_' + m.children.length + '_new', - cs: m.cs, - en: m.en, visible: true, children: [] - }) + }; + this.state.currentMagazine.languages.forEach(lang => { + item[lang] = m[lang]; + }); + item['children'] = []; + m.children.push(item) } findNewMenuId() { @@ -298,15 +300,17 @@ export class AdminInterfaceComponent { addMenu() { let id = this.findNewMenuId(); - this.menu.push({ + const item: any = { id: id, route: id + '_new', - cs: 'Nazev CS', - en: 'Name EN', visible: true, added: true, children: [] - }) + } + this.state.currentMagazine.languages.forEach(lang => { + item[lang] = lang; + }); + this.menu.push(item) } removeMenu(idx: number) { diff --git a/searchapp/src/main/client/src/assets/i18n/cs.json b/searchapp/src/main/client/src/assets/i18n/cs.json index 04149a98..741ded9f 100644 --- a/searchapp/src/main/client/src/assets/i18n/cs.json +++ b/searchapp/src/main/client/src/assets/i18n/cs.json @@ -102,8 +102,7 @@ }, "prihlaseni_": "Přihlášení", "url": "Cesta v URL", - "cs": "Český název v menu", - "en": "Anglický název v menu" + "name": "Název v menu" }, "ARCHIV STARŠÍCH ROČNÍKŮ": "ARCHIV STARŠÍCH ROČNÍKŮ", "PROHLÍŽET CELÉ ČÍSLO": "PROHLÍŽET", @@ -307,7 +306,7 @@ "lang": { "cs": "česky", "en": "anglicky", - "de": "nemecky" + "de": "německy" } }, "button": { diff --git a/searchapp/src/main/client/src/assets/i18n/en.json b/searchapp/src/main/client/src/assets/i18n/en.json index 2f9ff3a1..edd62c93 100644 --- a/searchapp/src/main/client/src/assets/i18n/en.json +++ b/searchapp/src/main/client/src/assets/i18n/en.json @@ -102,8 +102,7 @@ }, "prihlaseni_": "Login", "url": "Path in URL", - "cs": "Czech label in menu", - "en": "English label in menu" + "name": "Label in menu" }, "ARCHIV STARŠÍCH ROČNÍKŮ": "ARCHIVE", "PROHLÍŽET CELÉ ČÍSLO": "VIEW", @@ -302,7 +301,12 @@ "jazyky": "Languages", "pridat_jazyk": "Add language", "smazat_jazyk": "Remove language", - "stranky": "Pages" + "stranky": "Pages", + "lang": { + "cs": "czech", + "en": "english", + "de": "german" + } }, "button": { "Yes": "Yes", diff --git a/searchapp/src/main/webapp/favicon.ico b/searchapp/src/main/webapp/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..997406ad22c29aae95893fb3d666c30258a09537 GIT binary patch literal 948 zcmV;l155mgP)CBYU7IjCFmI-B}4sMJt3^s9NVg!P0 z6hDQy(L`XWMkB@zOLgN$4KYz;j0zZxq9KKdpZE#5@k0crP^5f9KO};h)ZDQ%ybhht z%t9#h|nu0K(bJ ztIkhEr!*UyrZWQ1k2+YkGqDi8Z<|mIN&$kzpKl{cNP=OQzXHz>vn+c)F)zO|Bou>E z2|-d_=qY#Y+yOu1a}XI?cU}%04)zz%anD(XZC{#~WreV!a$7k2Ug`?&CUEc0EtrkZ zL49MB)h!_K{H(*l_93D5tO0;BUnvYlo+;yss%n^&qjt6fZOa+}+FDO(~2>G z2dx@=JZ?DHP^;b7*Y1as5^uphBsh*s*z&MBd?e@I>-9kU>63PjP&^#5YTOb&x^6Cf z?674rmSHB5Fk!{Gv7rv!?qX#ei_L(XtwVqLX3L}$MI|kJ*w(rhx~tc&L&xP#?cQow zX_|gx$wMr3pRZIIr_;;O|8fAjd;1`nOeu5K(pCu7>^3E&D2OBBq?sYa(%S?GwG&_0-s%_v$L@R!5H_fc)lOb9ZoOO#p`Nn`KU z3LTTBtjwo`7(HA6 z7gmO$yTR!5L>Bsg!X8616{JUngg_@&85%>W=mChTR;x4`P=?PJ~oPuy5 zU-L`C@_!34D21{fD~Y8NVnR3t;aqZI3fIhmgmx}$oc-dKDC6Ap$Gy>a!`A*x2L1v0 WcZ@i?LyX}70000