Skip to content

Commit fcd5ea1

Browse files
committed
speaker resource page
1 parent 4ffeb4d commit fcd5ea1

File tree

9 files changed

+105
-8
lines changed

9 files changed

+105
-8
lines changed

projects/commudle-admin/src/app/app-routing.module.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ const routes: Routes = [
8080
path: 'pricing',
8181
loadChildren: () => import('./feature-modules/pricing/pricing.module').then(m => m.PricingModule)
8282
},
83+
{
84+
path: 'speaker-resources',
85+
loadChildren: () => import('./feature-modules/speaker-resources/speaker-resources.module').then(m => m.SpeakerResourcesModule)
86+
},
8387
{
8488
path: 'policies',
8589
loadChildren: () => import('./feature-modules/policies/policies.module').then(m => m.PoliciesModule)
@@ -119,7 +123,6 @@ const routes: Routes = [
119123
},
120124
{path: 'logout', component: LogoutComponent},
121125
{path: 'error', component: LibErrorHandlerComponent},
122-
{ path: 'speaker-resources', loadChildren: () => import('./feature-modules/speaker-resources/speaker-resources.module').then(m => m.SpeakerResourcesModule) },
123126
{path: '**', redirectTo: '/error'},
124127
];
125128

Original file line numberDiff line numberDiff line change
@@ -1,6 +1,31 @@
11
<!-- this will have all the details of the speaker resource + user's mini details card + comments component -->
22
<!-- user's mini details card would be a component imported from feature-modules/users -->
33
<!-- comments component will be a new component, will be a copy of comments from labs -->
4-
<div>
4+
<div class="speaker-resources wrapper">
5+
<nb-card class="left-wrapper">
6+
<div class="left-column">
7+
<div class="speaker-image">
8+
<img src="https://static.remove.bg/remove-bg-web/2a274ebbb5879d870a69caae33d94388a88e0e35/assets/start-0e837dcc57769db2306d8d659f53555feb500b3c5d456879b9c843d1872e7baa.jpg" alt="">
9+
</div>
10+
<div class="speaker">
11+
<h5>Harshita</h5>
12+
</div>
13+
<div class="designation">
14+
<p>Student</p>
15+
</div>
516

17+
18+
</div>
19+
</nb-card>
20+
<nb-card class="right-wrapper">
21+
<div class="right-column">
22+
<div class="content-title">
23+
<h1>Analog and Digital</h1>
24+
</div>
25+
<div class="content-description">
26+
<p>Random Text be like..</p>
27+
</div>
28+
29+
</div>
30+
</nb-card>
631
</div>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
.wrapper{
2+
display: flex;
3+
flex-direction: row;
4+
}
5+
.left-wrapper{
6+
width: 200px;
7+
height: 200px;
8+
9+
}
10+
.right-wrapper{
11+
height: 500px;
12+
width: 978px;
13+
14+
}
15+
.left-column{
16+
display: flex;
17+
justify-content: center;
18+
flex-direction: column;
19+
20+
.speaker{
21+
width: 100%;
22+
display: flex;
23+
justify-content: center;
24+
align-items: center;
25+
26+
h5{
27+
margin: 0;
28+
}
29+
30+
}
31+
.designation {
32+
p{
33+
margin: 0;
34+
text-align: center;
35+
}
36+
}
37+
38+
img{
39+
width: 100%;
40+
}
41+
}

projects/commudle-admin/src/app/feature-modules/speaker-resources/components/speaker-resource/speaker-resource.component.ts

+25-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1+
import { ISpeakerResource } from 'projects/shared-models/speaker_resource.model';
2+
13
import { Component, OnInit } from '@angular/core';
4+
import { SpeakerResourcesService } from 'projects/commudle-admin/src/app/services/speaker-resources.service';
5+
import { ActivatedRoute } from '@angular/router';
26

37
@Component({
48
selector: 'app-speaker-resource',
@@ -8,9 +12,29 @@ import { Component, OnInit } from '@angular/core';
812
export class SpeakerResourceComponent implements OnInit {
913

1014

11-
constructor() { }
15+
speaker :ISpeakerResource;
16+
17+
18+
constructor(
19+
private activatedRoute: ActivatedRoute,
20+
private speakerResourcesService: SpeakerResourcesService,
21+
22+
) { }
1223

1324
ngOnInit(): void {
25+
this.activatedRoute.parent.data.subscribe(data => {
26+
this.getSpeaker();
27+
}
28+
)
1429
}
30+
getSpeaker(){
31+
console.log(this.speaker.id);
32+
this.speakerResourcesService.getDetails(this.speaker.id).subscribe(
33+
data => {
34+
console.log(data);
35+
this.speaker = data;
1536

37+
}
38+
);
39+
}
1640
}

projects/commudle-admin/src/app/feature-modules/speaker-resources/speaker-resources-routing.module.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ import { NgModule } from '@angular/core';
22
import { Routes, RouterModule } from '@angular/router';
33
import { SpeakerResourceComponent } from './components/speaker-resource/speaker-resource.component';
44

5-
65
const routes: Routes = [
7-
{ path: '', component: SpeakerResourceComponent }
6+
{ path: ':speaker_resource_id', component: SpeakerResourceComponent }
87
];
98

109
@NgModule({
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
import { NbCardModule,NbLayoutModule } from '@nebular/theme';
12
import { NgModule } from '@angular/core';
23
import { CommonModule } from '@angular/common';
34

45
import { SpeakerResourcesRoutingModule } from './speaker-resources-routing.module';
56
import { SpeakerResourceComponent } from './components/speaker-resource/speaker-resource.component';
7+
import {NbThemeModule , NbInputModule, NbButtonModule,NbTabsetModule,NbActionsModule,NbButtonGroupModule,NbIconModule, NbFormFieldModule,} from "@nebular/theme";
68

79

810
@NgModule({
@@ -11,7 +13,9 @@ import { SpeakerResourceComponent } from './components/speaker-resource/speaker-
1113
],
1214
imports: [
1315
CommonModule,
14-
SpeakerResourcesRoutingModule
16+
SpeakerResourcesRoutingModule,
17+
NbCardModule,
18+
NbLayoutModule
1519
]
1620
})
1721
export class SpeakerResourcesModule { }

projects/commudle-admin/src/app/feature-modules/users/components/public-profile/user-content/user-contributions/user-past-event-card/user-past-event-card.component.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<nb-card [routerLink]="['/communities', pastEvent.event.kommunity_slug, 'events', pastEvent.event.slug]"
1+
<nb-card [routerLink]="['/speaker-resources', pastEvent.id]"
22
class="user-past-event-card clickable">
33
<nb-card-body>
44
<nb-actions>

projects/commudle-admin/src/app/feature-modules/users/components/public-profile/user-content/user-contributions/user-past-event-card/user-past-event-card.component.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import {Component, Input, OnInit} from '@angular/core';
22
import {ISpeakerResource} from 'projects/shared-models/speaker_resource.model';
33

4+
45
@Component({
56
selector: 'app-user-past-event-card',
67
templateUrl: './user-past-event-card.component.html',

projects/commudle-admin/src/app/services/speaker-resources.service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export class SpeakerResourcesService {
2222
getDetails(speakerResourceId): Observable<ISpeakerResource> {
2323
const params = new HttpParams().set('speaker_resource_id', speakerResourceId);
2424
return this.http.get<ISpeakerResource>(
25-
this.apiRoutesService.getRoute(API_ROUTES.SPEAKER_RESOURCES.SHOW_BY_TOKEN), {params}
25+
this.apiRoutesService.getRoute(API_ROUTES.SPEAKER_RESOURCES.SHOW), {params}
2626
);
2727
}
2828

0 commit comments

Comments
 (0)