Skip to content

Commit 4881c26

Browse files
committed
Merge branch 'master' into angular-upgrade
2 parents c1ad78f + bebe7a6 commit 4881c26

File tree

7 files changed

+201
-59
lines changed

7 files changed

+201
-59
lines changed

src/app/interfaces.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,10 @@ export interface IEvent {
3434
str_id: string;
3535
name: string;
3636
description: string;
37+
email_subject: string;
3738
longdescription: string;
3839
email_verified: boolean,
40+
email_rejected: boolean,
3941
image_url: string;
4042
website_url: string;
4143
start_time: Date;

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,8 @@
201201
<mat-form-field class="full-width-details">
202202
<textarea
203203
matInput
204-
placeholder="Description"
205-
[(ngModel)]="event.description"
204+
placeholder="Email Subject"
205+
[(ngModel)]="event.email_subject"
206206
rows="8"
207207
>
208208
</textarea>
@@ -213,8 +213,9 @@
213213
<mat-form-field class="full-width-details">
214214
<textarea
215215
matInput
216-
placeholder="Email Content"
216+
placeholder="Email Content / InstiApp Description"
217217
[(ngModel)]="event.longdescription"
218+
(ngModelChange)="event.description = $event"
218219
rows="8"
219220
></textarea>
220221
</mat-form-field>
@@ -355,7 +356,7 @@
355356
</div>
356357

357358
<div right class="md-preview">
358-
<div class="rl-header head">Description Preview</div>
359+
<div class="rl-header head">Email Preview</div>
359360
<div class="subh">
360361
Styling with
361362
<a
@@ -365,6 +366,7 @@
365366
>
366367
is supported
367368
</div>
368-
<markdown class="markdown" [data]="event.description"></markdown>
369+
<markdown class="markdown" [data]="event.email_subject"></markdown>
370+
<markdown class="markdown" [data]="event.longdescription"></markdown>
369371
</div>
370372
</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
@@ -342,7 +342,7 @@ export class AddEventComponent implements OnInit {
342342
}
343343
this.dataService.UploadImage(files[0]).subscribe(
344344
(result) => {
345-
this.event.image_url = result.picture;
345+
this.event.image_url = result;
346346
this.networkBusy = false;
347347
this.snackBar.open("Image Uploaded", "Dismiss", {
348348
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: 30 additions & 9 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.email_subject }}</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>
@@ -79,17 +79,32 @@
7979
<div class="event-body">
8080
<ng-container *ngIf="desktopMode || dataService.isMobile()">
8181
<div class="description markdown">
82-
<div [innerHTML]="dataService.processMDHTML(event.description | markdown)"></div>
82+
<div [innerHTML]="dataService.processMDHTML(event.email_subject | markdown)"></div>
8383
<!-- <div [innerHTML]="dataService.processMDHTML(event.long_description | markdown)"></div> -->
8484
</div>
8585
<ng-container *ngIf="dataService.canViewMaxContent()">
8686
<div class="longdescription markdown">
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.email_subject | 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
@@ -23,7 +23,7 @@ export class EventDetailsComponent implements OnChanges, OnInit {
2323
public error: number;
2424
@Input() public desktopMode = false;
2525
public showVerifyEmailPopup = false;
26-
26+
public emailRejected = false;
2727
constructor(
2828
private activatedRoute: ActivatedRoute,
2929
public dataService: DataService,
@@ -127,6 +127,7 @@ export class EventDetailsComponent implements OnChanges, OnInit {
127127
this.dataService.approveEmail(this.eventId).subscribe(
128128
() => {
129129
console.log('Email approved successfully!');
130+
this.event.email_verified = true;
130131
},
131132
(error) => {
132133
console.error('Error approving email:', error);
@@ -139,6 +140,7 @@ export class EventDetailsComponent implements OnChanges, OnInit {
139140
this.dataService.rejectEmail(this.eventId).subscribe(
140141
() => {
141142
console.log('Email rejected successfully!');
143+
this.event.email_rejected = true;
142144
},
143145
(error) => {
144146
console.error('Error rejecting email:', error);

0 commit comments

Comments
 (0)