Skip to content

Commit

Permalink
merge greg into pre-release_fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dmytakis committed Jan 26, 2021
2 parents 0c68194 + 0638094 commit 0a28777
Show file tree
Hide file tree
Showing 89 changed files with 2,985 additions and 2,019 deletions.
131 changes: 131 additions & 0 deletions sds
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts
index d33ebdc..6053187 100644
--- a/src/app/app-routing.module.ts
+++ b/src/app/app-routing.module.ts
@@ -22,29 +22,17 @@ import { CommunityArchiveComponent } from './views/pages/community-archive/commu
import { ConfigGuard } from './core/helpers/config.guard';

const routes: Routes = [
- { path: '', redirectTo: 'home', pathMatch: 'full' },
{
path: '',
component: LayoutComponent,
children: [
+ //Main Pages
{
- path: 'home', component: HomeComponent,
+ path: '', component: HomeComponent,
data: {
- title: 'MENU.Home'
+ title: 'Αρχική' 
}
},
- // {
- // path: 'redeem', component: RedeemComponent,
- // data: {
- // title: 'MENU.offers'
- // }
- // },
- // {
- // path: 'support', component: SupportComponent,
- // data: {
- // title: 'MENU.support'
- // }
- // },
{
path: 'join', component: JoinComponent,
data: {
@@ -53,7 +41,7 @@ const routes: Routes = [
},
{
path: 'about', component: AboutComponent,
- data: {
+ data: { 
title: 'MENU.About'
}
},
@@ -63,8 +51,7 @@ const routes: Routes = [
title: 'MENU.Contact'
}
},
-
-
+ //Archive
{
path: 'partners',
component: CommunityArchiveComponent,
@@ -99,25 +86,11 @@ const routes: Routes = [
accessIndex: 2
}
},
-
-
- // {
- // path: 'partner',
- // component: CommunitySingleComponent
- // },
+ //Singles
{
path: 'partner/:partner_id',
component: CommunitySingleComponent
},
-
- // {
- // path: 'offer',
- // component: OfferSingleComponent,
- // canActivate: [ConfigGuard],
- // data: {
- // accessIndex: 1
- // }
- // },
{
path: 'offer/:partner_id',
component: OfferSingleComponent,
@@ -134,15 +107,6 @@ const routes: Routes = [
accessIndex: 1
}
},
-
- // {
- // path: 'event',
- // component: EventSingleComponent,
- // canActivate: [ConfigGuard],
- // data: {
- // accessIndex: 0
- // }
- // },
{
path: 'event/:partner_id/:post_event_id/:type',
component: EventSingleComponent,
@@ -151,16 +115,6 @@ const routes: Routes = [
accessIndex: 0
}
},
-
-
- // {
- // path: 'microcredit',
- // component: MicrocreditSingleComponent,
- // canActivate: [ConfigGuard],
- // data: {
- // accessIndex: 2
- // }
- // },
{
path: 'microcredit/:partner_id',
component: MicrocreditSingleComponent,
diff --git a/src/app/app.component.ts b/src/app/app.component.ts
index cfa56ff..02d5675 100644
--- a/src/app/app.component.ts
+++ b/src/app/app.component.ts
@@ -3,6 +3,7 @@ import { TranslateService } from '@ngx-translate/core';
import { Title } from '@angular/platform-browser';
import { filter, map, mergeMap } from 'rxjs/operators';
import { Router, NavigationEnd, ActivatedRoute } from '@angular/router';
+import { StaticDataService } from './core/services/static-data.service';

@Component({
selector: 'app-root',
@@ -12,40 +13,36 @@ import { Router, NavigationEnd, ActivatedRoute } from '@angular/router';
export class AppComponent {
title
58 changes: 6 additions & 52 deletions src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,29 +22,17 @@ import { CommunityArchiveComponent } from './views/pages/community-archive/commu
import { ConfigGuard } from './core/helpers/config.guard';

const routes: Routes = [
{ path: '', redirectTo: 'home', pathMatch: 'full' },
{
path: '',
component: LayoutComponent,
children: [
//Main Pages
{
path: 'home', component: HomeComponent,
path: '', component: HomeComponent,
data: {
title: 'MENU.Home'
title: 'Αρχική'
}
},
// {
// path: 'redeem', component: RedeemComponent,
// data: {
// title: 'MENU.offers'
// }
// },
// {
// path: 'support', component: SupportComponent,
// data: {
// title: 'MENU.support'
// }
// },
{
path: 'join', component: JoinComponent,
data: {
Expand All @@ -53,7 +41,7 @@ const routes: Routes = [
},
{
path: 'about', component: AboutComponent,
data: {
data: {
title: 'MENU.About'
}
},
Expand All @@ -63,8 +51,7 @@ const routes: Routes = [
title: 'MENU.Contact'
}
},


//Archive
{
path: 'partners',
component: CommunityArchiveComponent,
Expand Down Expand Up @@ -99,25 +86,11 @@ const routes: Routes = [
accessIndex: 2
}
},


// {
// path: 'partner',
// component: CommunitySingleComponent
// },
//Singles
{
path: 'partner/:partner_id',
component: CommunitySingleComponent
},

// {
// path: 'offer',
// component: OfferSingleComponent,
// canActivate: [ConfigGuard],
// data: {
// accessIndex: 1
// }
// },
{
path: 'offer/:partner_id',
component: OfferSingleComponent,
Expand All @@ -134,15 +107,6 @@ const routes: Routes = [
accessIndex: 1
}
},

// {
// path: 'event',
// component: EventSingleComponent,
// canActivate: [ConfigGuard],
// data: {
// accessIndex: 0
// }
// },
{
path: 'event/:partner_id/:post_event_id/:type',
component: EventSingleComponent,
Expand All @@ -151,16 +115,6 @@ const routes: Routes = [
accessIndex: 0
}
},


// {
// path: 'microcredit',
// component: MicrocreditSingleComponent,
// canActivate: [ConfigGuard],
// data: {
// accessIndex: 2
// }
// },
{
path: 'microcredit/:partner_id',
component: MicrocreditSingleComponent,
Expand Down
15 changes: 6 additions & 9 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { TranslateService } from '@ngx-translate/core';
import { Title } from '@angular/platform-browser';
import { filter, map, mergeMap } from 'rxjs/operators';
import { Router, NavigationEnd, ActivatedRoute } from '@angular/router';
import { StaticDataService } from './core/services/static-data.service';

@Component({
selector: 'app-root',
Expand All @@ -12,40 +13,36 @@ import { Router, NavigationEnd, ActivatedRoute } from '@angular/router';
export class AppComponent {
title = 'synergy-open-app';

constructor(private titleService: Title, private router: Router, private activatedRoute: ActivatedRoute, translate: TranslateService) {
constructor(private titleService: Title, private router: Router, private activatedRoute: ActivatedRoute, translate: TranslateService, private staticDataService:StaticDataService ) {
// this language will be used as a fallback when a translation isn't found in the current language
translate.setDefaultLang('en');
translate.setDefaultLang('el');
// the lang to use, if the lang isn't available, it will use the current loader to get them
translate.use('en');
translate.use('el');
this.router.events.pipe(
filter((event) => event instanceof NavigationEnd),
map(() => {
let route = this.activatedRoute;
while (route.firstChild) route = route.firstChild;
console.log('route');
return route;
}),
filter((route) => route.outlet === 'primary'),
mergeMap((route) => route.data),
map((data) => {
console.log(data);
if (data.title) {
return data.title;
}
else {
return this.router.url.split('/').reduce((acc, frag) => {
if (acc && frag) { acc += ' / '; }
console.log(acc, frag)
return acc + frag;
});
}
//
})
).subscribe(val => {
console.log(val);
translate.get(val).subscribe((translation: string) => {
console.log(translation);
this.titleService.setTitle(translation);
var siteTitle = this.staticDataService.getSiteTitle;
this.titleService.setTitle(translation+siteTitle);
});

});
Expand Down
Loading

0 comments on commit 0a28777

Please sign in to comment.