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 00000000..997406ad Binary files /dev/null and b/searchapp/src/main/webapp/favicon.ico differ