Merge branch 'max_dev' of Software_Engineering_I/greenvironment-frontend into master

master
Max_ES 5 years ago committed by Gitea
commit 8d70b10efb

@ -123,14 +123,12 @@
<mat-card-title>{{event.name}}</mat-card-title> <mat-card-title>{{event.name}}</mat-card-title>
<mat-card-subtitle>{{event.date}}</mat-card-subtitle> <mat-card-subtitle>{{event.date}}</mat-card-subtitle>
<div class="button-box"> <div class="button-box">
<button mat-icon-button class="request-button" <button *ngIf="!event.joined" mat-icon-button class="request-button"
matTooltip="join event" matTooltipShowDelay="500" matTooltip="join event" matTooltipShowDelay="500"
(click)="joinEvent(event)" (click)="joinEvent(event)">
[disabled]="event.joined"> <mat-icon>event_available</mat-icon>
<mat-icon *ngIf="event.joined" color="primary">event_available</mat-icon>
<mat-icon *ngIf="!event.joined">event_available</mat-icon>
</button> </button>
<button mat-icon-button class="request-button" <button *ngIf="event.joined" mat-icon-button class="request-button"
matTooltip="leave event" matTooltipShowDelay="500" matTooltip="leave event" matTooltipShowDelay="500"
(click)="leaveEvent(event)" (click)="leaveEvent(event)"
[disabled]="!event.joined"> [disabled]="!event.joined">

@ -154,6 +154,7 @@ export class GroupComponent implements OnInit {
this.requestService.joinGroup(group.id) this.requestService.joinGroup(group.id)
.subscribe(() => { .subscribe(() => {
this.datasharingService.addGroupToUser(group); this.datasharingService.addGroupToUser(group);
this.groupProfile.joined = true;
}); });
} }
@ -190,6 +191,8 @@ export class GroupComponent implements OnInit {
leaveGroup() { leaveGroup() {
this.groupService.leaveGroup(this.groupProfile.id).subscribe(response => { this.groupService.leaveGroup(this.groupProfile.id).subscribe(response => {
this.groupProfile.joined = false; this.groupProfile.joined = false;
// tslint:disable-next-line:max-line-length
this.groupProfile.allowedToJoinGroup = this.requestService.isAllowedToJoinGroup(this.groupProfile.id, this.self);
}); });
} }

@ -9,7 +9,6 @@
box-sizing: border-box box-sizing: border-box
width: 100% width: 100%
margin-top: 0.5em margin-top: 0.5em
cursor: pointer
outline: none outline: none
user-select: none user-select: none
#button-box #button-box
@ -19,12 +18,14 @@
::ng-deep .mat-card-header-text ::ng-deep .mat-card-header-text
margin: 0 24px margin: 0 24px
cursor: pointer
.mat-card-subtitle .mat-card-subtitle
margin: 0 margin: 0
$mat-card-header-size: 52px !default $mat-card-header-size: 52px !default
.profile-picture .profile-picture
cursor: pointer
height: $mat-card-header-size height: $mat-card-header-size
width: $mat-card-header-size width: $mat-card-header-size
border-radius: 50% border-radius: 50%

@ -11,7 +11,6 @@
margin-top: 0.5em margin-top: 0.5em
outline: none outline: none
user-select: none user-select: none
cursor: pointer
#button-box #button-box
text-align: right text-align: right
margin-left: auto margin-left: auto
@ -19,13 +18,16 @@
width: 1000% width: 1000%
margin: auto 0 auto 24px margin: auto 0 auto 24px
.mat-card-subtitle .mat-card-subtitle
cursor: pointer
margin: 0 margin: 0
word-break: break-all word-break: break-all
.mat-card-title .mat-card-title
cursor: pointer
margin: 0 margin: 0
word-break: break-all word-break: break-all
$mat-card-header-size: 52px !default $mat-card-header-size: 52px !default
.group-picture .group-picture
cursor: pointer
height: $mat-card-header-size height: $mat-card-header-size
width: $mat-card-header-size width: $mat-card-header-size
border-radius: 50% border-radius: 50%

Loading…
Cancel
Save