Skip to content
Snippets Groups Projects
Commit 3faadfd0 authored by David Noah Donges's avatar David Noah Donges
Browse files

Merge branch '37-participant-home-screen-html-template-room' into 'master'

Resolve "participant home screen - html template (room)"

Closes #37

See merge request swtp-block-ws17/arsnova-angular-frontend!57
parents 224133a4 4bd1d51a
1 merge request!57Resolve "participant home screen - html template (room)"
Pipeline #13080 passed with stage
in 35 seconds
......@@ -8,6 +8,7 @@ import { CreateCommentComponent } from './create-comment/create-comment.componen
import { ParticipantHomeScreenComponent } from './participant-home-screen/participant-home-screen.component';
import { AuthenticationGuard } from './authentication.guard';
import { UserRole } from './user-roles.enum';
import { ParticipantRoomComponent } from './participant-room/participant-room.component';
const routes: Routes = [
{ path: '', redirectTo: '/home', pathMatch: 'full' },
......@@ -34,6 +35,12 @@ const routes: Routes = [
canActivate: [AuthenticationGuard],
data: { roles: [UserRole.PARTICIPANT] }
},
{
path: 'participant/room/:roomId',
component: ParticipantRoomComponent,
canActivate: [AuthenticationGuard],
data: { roles: [UserRole.PARTICIPANT] }
},
{ path: '**', component: PageNotFoundComponent }
];
......
......@@ -64,6 +64,7 @@ import { CreatorHomeScreenComponent } from './creator-home-screen/creator-home-s
import { CreateCommentComponent } from './create-comment/create-comment.component';
import { CommentService } from './comment.service';
import { ParticipantHomeScreenComponent } from './participant-home-screen/participant-home-screen.component';
import { ParticipantRoomComponent } from './participant-room/participant-room.component';
import { DataStoreService } from './data-store.service';
@NgModule({
......@@ -85,7 +86,8 @@ import { DataStoreService } from './data-store.service';
CreateCommentComponent,
ParticipantHomeScreenComponent,
CommentComponent,
ContentAnswersComponent
ContentAnswersComponent,
ParticipantRoomComponent
],
entryComponents: [
RegisterComponent,
......
<div fxLayout="column" fxLayoutAlign="start" fxLayoutGap="20px" fxFill>
<div fxLayout="row" fxLayoutAlign="center">
<mat-card>
<mat-card-header>
<mat-card-title><h3 class="subheading-2">{{ roomName }}</h3></mat-card-title>
<mat-card-subtitle>{{ roomId }}</mat-card-subtitle>
</mat-card-header>
<mat-divider></mat-divider>
<mat-card-content>
<p>
{{ roomDescription }}
</p>
</mat-card-content>
<mat-divider></mat-divider>
<mat-card-actions>
<button mat-icon-button color="primary" matTooltip="Ask something" routerLink="/room/{{roomId}}/create-comment">
<mat-icon>question_answer</mat-icon>
</button>
<button mat-icon-button color="primary" matTooltip="Give feedback">
<mat-icon>feedback</mat-icon>
</button>
<button mat-button color="primary" matTooltip="Join question round">
Questions
</button>
<button mat-button color="primary" matTooltip="See room comments">
Comments
</button>
<button mat-button color="primary" matTooltip="Start personal question round">
Learn
</button>
</mat-card-actions>
</mat-card>
</div>
</div>
mat-card {
max-width: 800px;
}
mat-card-content>:first-child {
margin-top: 16px;
}
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ParticipantRoomComponent } from './participant-room.component';
describe('ParticipantRoomComponent', () => {
let component: ParticipantRoomComponent;
let fixture: ComponentFixture<ParticipantRoomComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ParticipantRoomComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ParticipantRoomComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-participant-room',
templateUrl: './participant-room.component.html',
styleUrls: ['./participant-room.component.scss']
})
export class ParticipantRoomComponent implements OnInit {
roomId = '12 34 56 78';
roomName = 'Test Room';
roomDescription = 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore ' +
'magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea ' +
'takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod ' +
'tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea ' +
'rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.';
constructor() {
}
ngOnInit() {
}
}
<mat-list>
<mat-list-item *ngFor="let room of rooms">
<button mat-button routerLink="/room/{{room.id}}">
<button mat-button routerLink="room/{{room.id}}">
{{room.name}}
</button>
</mat-list-item>
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment