[develop]: Add subscriptions page

This commit is contained in:
Konstantinos Triantafyllou 2024-10-07 15:27:28 +03:00
parent d6ebeb9223
commit e540ab59c8
5 changed files with 113 additions and 1 deletions

View File

@ -9,6 +9,10 @@ const routes: Routes = [
path: 'about', path: 'about',
loadChildren: () => import('./about/about.module').then(m => m.AboutModule) loadChildren: () => import('./about/about.module').then(m => m.AboutModule)
}, },
{
path: 'subscriptions',
loadChildren: () => import('./subscriptions/subscriptions.module').then(m => m.SubscriptionsModule)
},
{ {
path: 'support', path: 'support',
loadChildren: () => import('./support/support.module').then(m => m.SupportModule), loadChildren: () => import('./support/support.module').then(m => m.SupportModule),

View File

@ -213,6 +213,9 @@ export class AppComponent {
new MenuItem("", "Blog", "https://blogs.openaire.eu/", "", false, [], [], {}), new MenuItem("", "Blog", "https://blogs.openaire.eu/", "", false, [], [], {}),
new MenuItem("", "Contact us", "https://beta.openaire.eu/contact-us", "", false, [], [], {}) new MenuItem("", "Contact us", "https://beta.openaire.eu/contact-us", "", false, [], [], {})
]; ];
this.menuItems.push(
new MenuItem("subscriptions", "Subscriptions", "", "/subscriptions", false, [], null, {}, null, null)
);
this.menuItems.push( this.menuItems.push(
new MenuItem("contact-us", "Contact us", "", "/contact-us", false, [], null, {}, null, null, "uk-hidden@m") new MenuItem("contact-us", "Contact us", "", "/contact-us", false, [], null, {}, null, null, "uk-hidden@m")
); );

@ -1 +1 @@
Subproject commit 1593ea6ed9e62931800b62f4d4d4787228043d51 Subproject commit bef6dda2c21e5ef4f40352c34ebd2b62d0ad84a6

View File

@ -0,0 +1,82 @@
import {Component} from "@angular/core";
import {Router} from '@angular/router';
import {Meta, Title} from '@angular/platform-browser';
import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service';
import {SEOService} from "../openaireLibrary/sharedComponents/SEO/SEO.service";
import {Subscriber} from "rxjs";
import {Breadcrumb} from "../openaireLibrary/utils/breadcrumbs/breadcrumbs.component";
import {EnvProperties} from "../openaireLibrary/utils/properties/env-properties";
import {properties} from "../../environments/environment";
import {BaseComponent} from "../openaireLibrary/sharedComponents/base/base.component";
import {HelperService} from "../openaireLibrary/utils/helper/helper.service";
@Component({
selector: 'subscriptions',
template: `
<div>
<div class="uk-position-relative">
<div class="uk-background-muted">
<div class="uk-container uk-container-large uk-section uk-section-small">
<div class="uk-padding-small uk-padding-remove-horizontal">
<breadcrumbs [breadcrumbs]="breadcrumbs"></breadcrumbs>
</div>
<div class="uk-flex uk-flex-column uk-flex-center uk-margin-bottom"
uk-scrollspy="target: [uk-scrollspy-class]; cls: uk-animation-fade; delay: 250">
<h1 class="uk-margin-medium-top" uk-scrollspy-class>Subscriptions<span
class="uk-text-primary">.</span></h1>
<div uk-scrollspy-class>
As demand for our services grows, along with the features included in each of them,
traditional sources of funding may not be sufficient. By introducing subscription fees, we
can ensure their long-term sustainability; by achieving financial stability we can
continue to invest in better resources, technology, and talent, thereby increasing our
capacity to deliver impactful programs and services to all interested parties.
Subscriptions support immediate operational needs, while at the same time enabling us to
scale our efforts and make a greater, more sustainable difference in the communities we
serve.
</div>
</div>
</div>
</div>
</div>
<helper *ngIf="divContents" [texts]="divContents.plans"></helper>
</div>
`
})
export class SubscriptionsComponent extends BaseComponent {
public divContents = null;
public title: string = "OpenAIRE - Monitor | Subscriptions";
public description: string = "OpenAIRE - Monitor | Subscriptions";
public breadcrumbs: Breadcrumb[] = [{name: 'home', route: '/'}, {name: 'Subscriptions'}];
public properties: EnvProperties = properties;
subscriptions = [];
constructor(
protected _router: Router,
protected _meta: Meta,
protected _title: Title,
protected seoService: SEOService,
protected _piwikService: PiwikService,
private helper: HelperService) {
super();
}
ngOnInit() {
this.setMetadata();
this.getDivContents();
}
ngOnDestroy() {
this.subscriptions.forEach(subscription => {
if (subscription instanceof Subscriber) {
subscription.unsubscribe();
}
});
}
private getDivContents() {
this.subscriptions.push(this.helper.getDivHelpContents(this.properties, 'monitor', this._router.url).subscribe(contents => {
this.divContents = contents;
}));
}
}

View File

@ -0,0 +1,23 @@
import {CommonModule} from "@angular/common";
import {NgModule} from "@angular/core";
import {RouterModule} from "@angular/router";
import {PreviousRouteRecorder} from "../openaireLibrary/utils/piwik/previousRouteRecorder.guard";
import {SubscriptionsComponent} from "./subscriptions.component";
import {BreadcrumbsModule} from "../openaireLibrary/utils/breadcrumbs/breadcrumbs.module";
import {PiwikService} from "../openaireLibrary/utils/piwik/piwik.service";
import {SliderTabsModule} from "../openaireLibrary/sharedComponents/tabs/slider-tabs.module";
import {HelperModule} from "../openaireLibrary/utils/helper/helper.module";
import {IconsModule} from "../openaireLibrary/utils/icons/icons.module";
@NgModule({
declarations: [SubscriptionsComponent],
imports: [CommonModule, RouterModule.forChild([
{
path: '',
component: SubscriptionsComponent
}
]), BreadcrumbsModule, SliderTabsModule, HelperModule, IconsModule],
exports: [SubscriptionsComponent],
providers: [PreviousRouteRecorder, PiwikService]
})
export class SubscriptionsModule {}