Skip to content

Commit fa17da8

Browse files
committed
events bugs fixed
1 parent 1865067 commit fa17da8

File tree

7 files changed

+3295
-3170
lines changed

7 files changed

+3295
-3170
lines changed

package-lock.json

Lines changed: 3203 additions & 3155 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/app/interfaces.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export interface IEvent {
3636
description: string;
3737
longdescription: string;
3838
email_verified: boolean,
39+
email_rejected: boolean,
3940
image_url: string;
4041
website_url: string;
4142
start_time: Date;

src/app/page/add-event/add-event.component.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,14 @@
110110

111111
<div>
112112
<mat-form-field class="full-width-details">
113-
<textarea matInput placeholder="Description" [(ngModel)]="event.description" rows=8>
113+
<textarea matInput placeholder="Email Subject" [(ngModel)]="event.description" rows=8>
114114
</textarea>
115115
</mat-form-field>
116116
</div>
117117

118118
<div>
119119
<mat-form-field class="full-width-details">
120-
<textarea matInput placeholder="Email Content" [(ngModel)]="event.longdescription" rows=8></textarea>
120+
<textarea matInput placeholder="Email Content / InstiApp Description" [(ngModel)]="event.longdescription" rows=8></textarea>
121121
</mat-form-field>
122122
</div>
123123

@@ -223,12 +223,13 @@
223223
</div>
224224

225225
<div right class="md-preview">
226-
<div class="rl-header head">Description Preview</div>
226+
<div class="rl-header head">Email Preview</div>
227227
<div class="subh">
228228
Styling with <a href="https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet"
229229
target="_blank">Markdown</a> is supported
230230
</div>
231231
<markdown class="markdown" [data]="event.description"></markdown>
232+
<markdown class="markdown" [data]="event.longdescription"></markdown>
232233
</div>
233234

234235
</app-desktop-split>

src/app/page/add-event/add-event.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ export class AddEventComponent implements OnInit {
341341
}
342342
this.dataService.UploadImage(files[0]).subscribe(
343343
(result) => {
344-
this.event.image_url = result.picture;
344+
this.event.image_url = result;
345345
this.networkBusy = false;
346346
this.snackBar.open('Image Uploaded', 'Dismiss', {
347347
duration: 2000,

src/app/page/event-details/event-details.component.css

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,17 @@
5151
word-wrap: break-word;
5252
}
5353

54+
.approved-button {
55+
background-color: white !important; /* Ensure the background remains white */
56+
color: green !important; /* Green text */
57+
border: 2px solid green !important; /* Green border */
58+
}
59+
.rejected-button {
60+
background-color: white !important; /* Ensure the background remains white */
61+
color: red !important; /* Green text */
62+
border: 2px solid red !important; /* Green border */
63+
}
64+
5465
.event-body {
5566
max-width: 500px;
5667
margin: 0 auto;
@@ -94,7 +105,7 @@
94105
color: black;
95106
}
96107

97-
.verify-email-popup {
108+
/* .verify-email-popup {
98109
position: fixed;
99110
top: 50%;
100111
left: 60%;
@@ -104,7 +115,48 @@
104115
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
105116
z-index: 100000;
106117
transition: background-color 0.3s;
107-
}
118+
} */
119+
.verify-email-popup {
120+
position: fixed;
121+
top: 55%;
122+
left: 50%;
123+
transform: translate(-50%, -50%);
124+
background-color: white;
125+
border: 1px solid #ccc;
126+
border-radius: 8px;
127+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
128+
width: 40%;
129+
max-width: 40%;
130+
max-height: 70%; /* Prevent overflow */
131+
padding: 20px;
132+
display: flex;
133+
flex-direction: column;
134+
z-index: 1000;
135+
}
136+
137+
.close-button {
138+
position: absolute;
139+
top: 10px;
140+
right: 10px;
141+
width: 40px; /* Ensure the button is a perfect circle */
142+
height: 40px;
143+
border-radius: 50%; /* Make it circular */
144+
display: flex;
145+
align-items: center; /* Center the icon vertically */
146+
justify-content: center; /* Center the icon horizontally */
147+
background-color: white; /* Optional: Add a background color */
148+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); /* Optional: Add a shadow for better visibility */
149+
}
150+
151+
.scrollable-content {
152+
overflow-y: auto;
153+
max-height: 60%; /* Adjust height to allow scrolling */
154+
margin-bottom: 20px;
155+
}
156+
.popup-actions {
157+
display: flex;
158+
justify-content: space-between;
159+
}
108160

109161
.verify-email-popup button {
110162
margin-top: 10px;

src/app/page/event-details/event-details.component.html

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212

1313
<div right class="right">
1414
<div class="section">
15-
<div class="rl-header sm">{{ event.name }}</div>
15+
<div class="rl-header sm">{{ event.description }}</div>
1616
<div class="markdown">
17-
<div [innerHTML]="dataService.processMDHTML(event.description | markdown)"></div>
17+
<div [innerHTML]="dataService.processMDHTML(event.longdescription | markdown)"></div>
1818
</div>
1919
<ng-container *ngTemplateOutlet="achievements"></ng-container>
2020
</div>
@@ -87,9 +87,24 @@
8787
<div [innerHTML]="dataService.processMDHTML(event.longdescription | markdown)"></div>
8888
</div>
8989
<ng-container *ngIf="dataService.canViewMaxContent()">
90-
<button mat-raised-button color="primary" (click)="openVerifyEmailPopup()">
91-
Verify Email
92-
</button>
90+
<ng-container *ngIf="event.email_rejected; else emailStatus">
91+
<button mat-raised-button class="rejected-button" disabled>
92+
Event Rejected
93+
</button>
94+
</ng-container>
95+
<ng-template #emailStatus>
96+
<ng-container *ngIf="event.email_verified; else verifyEmailButton">
97+
<button mat-raised-button class="approved-button" disabled>
98+
Event Approved
99+
</button>
100+
</ng-container>
101+
<ng-template #verifyEmailButton>
102+
<button mat-raised-button color="primary" (click)="openVerifyEmailPopup()">
103+
Verify Email
104+
</button>
105+
</ng-template>
106+
</ng-template>
107+
93108
</ng-container>
94109
</ng-container>
95110
<ng-container *ngIf="!desktopMode">
@@ -120,10 +135,16 @@
120135

121136
<ng-container *ngIf="showVerifyEmailPopup">
122137
<div class="verify-email-popup">
123-
<div class="description markdown">
138+
<button mat-icon-button class="close-button" (click)="showVerifyEmailPopup = false">
139+
<mat-icon>close</mat-icon>
140+
</button>
141+
<div class="description markdown scrollable-content">
142+
<div [innerHTML]="dataService.processMDHTML(event.description | markdown)"></div>
124143
<div [innerHTML]="dataService.processMDHTML(event.longdescription | markdown)"></div>
125144
</div>
126-
<button mat-button (click)="approveEmail()">Approve</button>
127-
<button mat-button (click)="rejectEmail()">Reject</button>
145+
<div class="popup-actions">
146+
<button mat-button color="primary" (click)="approveEmail()">Approve</button>
147+
<button mat-button color="warn" (click)="rejectEmail()">Reject</button>
148+
</div>
128149
</div>
129150
</ng-container>

src/app/page/event-details/event-details.component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export class EventDetailsComponent implements OnChanges, OnInit {
2222
public error: number;
2323
@Input() public desktopMode = false;
2424
public showVerifyEmailPopup = false;
25-
25+
public emailRejected = false;
2626
constructor(
2727
private activatedRoute: ActivatedRoute,
2828
public dataService: DataService,
@@ -126,6 +126,7 @@ export class EventDetailsComponent implements OnChanges, OnInit {
126126
this.dataService.approveEmail(this.eventId).subscribe(
127127
() => {
128128
console.log('Email approved successfully!');
129+
this.event.email_verified = true;
129130
},
130131
(error) => {
131132
console.error('Error approving email:', error);
@@ -138,6 +139,7 @@ export class EventDetailsComponent implements OnChanges, OnInit {
138139
this.dataService.rejectEmail(this.eventId).subscribe(
139140
() => {
140141
console.log('Email rejected successfully!');
142+
this.event.email_rejected = true;
141143
},
142144
(error) => {
143145
console.error('Error rejecting email:', error);

0 commit comments

Comments
 (0)