feat: implement user profiles with achievements and primary badge system #58

Merged
naomi merged 17 commits from feat/user-profiles into main 2026-02-19 22:21:18 -08:00
Showing only changes of commit 8837055e97 - Show all commits
@@ -387,6 +387,27 @@ import { ProfileReportWithUsers, CommentReportWithDetails, ReportStatus, ReportR
<p class="details-text">{{ reviewingProfileReport()!.details }}</p> <p class="details-text">{{ reviewingProfileReport()!.details }}</p>
</div> </div>
<!-- Admin Actions for Profile -->
<div class="admin-actions">
<strong>Admin Actions:</strong>
<div class="action-buttons">
<button
type="button"
class="btn btn-warning btn-sm"
(click)="editProfile(reviewingProfileReport()!)"
>
Edit Profile
</button>
<button
type="button"
class="btn btn-danger btn-sm"
(click)="makeProfilePrivate(reviewingProfileReport()!)"
>
Make Private
</button>
</div>
</div>
<!-- Review Form --> <!-- Review Form -->
<form (ngSubmit)="submitProfileReview()" class="review-form"> <form (ngSubmit)="submitProfileReview()" class="review-form">
<div class="form-group"> <div class="form-group">
@@ -501,6 +522,27 @@ import { ProfileReportWithUsers, CommentReportWithDetails, ReportStatus, ReportR
<p class="details-text">{{ reviewingCommentReport()!.details }}</p> <p class="details-text">{{ reviewingCommentReport()!.details }}</p>
</div> </div>
<!-- Admin Actions for Comment -->
<div class="admin-actions">
<strong>Admin Actions:</strong>
<div class="action-buttons">
<button
type="button"
class="btn btn-warning btn-sm"
(click)="editComment(reviewingCommentReport()!)"
>
Edit Comment
</button>
<button
type="button"
class="btn btn-danger btn-sm"
(click)="deleteComment(reviewingCommentReport()!)"
>
Delete Comment
</button>
</div>
</div>
<!-- Review Form --> <!-- Review Form -->
<form (ngSubmit)="submitCommentReview()" class="review-form"> <form (ngSubmit)="submitCommentReview()" class="review-form">
<div class="form-group"> <div class="form-group">
@@ -1030,6 +1072,50 @@ import { ProfileReportWithUsers, CommentReportWithDetails, ReportStatus, ReportR
margin: 0; margin: 0;
} }
/* Admin Actions */
.admin-actions {
margin-bottom: 1.5rem;
padding: 1rem;
background: var(--witch-lavender);
border-radius: 8px;
}
.admin-actions strong {
display: block;
margin-bottom: 0.75rem;
color: var(--witch-purple);
font-weight: 600;
}
.action-buttons {
display: flex;
gap: 0.75rem;
flex-wrap: wrap;
}
.btn-sm {
padding: 0.5rem 1rem;
font-size: 0.875rem;
}
.btn-warning {
background: #f59e0b;
color: white;
}
.btn-warning:hover:not(:disabled) {
background: #d97706;
}
.btn-danger {
background: #ef4444;
color: white;
}
.btn-danger:hover:not(:disabled) {
background: #dc2626;
}
/* Review Form */ /* Review Form */
.review-form { .review-form {
display: flex; display: flex;
@@ -1398,4 +1484,43 @@ export class AdminReportsComponent implements OnInit {
minute: '2-digit' minute: '2-digit'
}); });
} }
editComment(report: CommentReportWithDetails): void {
const commentId = report.reportedComment.id;
const newContent = prompt('Edit comment content:', report.reportedComment.content);
if (newContent !== null && newContent.trim() !== '') {
// TODO: Implement comment editing API call
this.toastService.success('Comment edit functionality coming soon');
}
}
deleteComment(report: CommentReportWithDetails): void {
const commentAuthor = report.reportedComment.user.username;
const confirmed = confirm(`Are you sure you want to delete this comment by ${commentAuthor}?`);
if (confirmed) {
// TODO: Implement comment deletion API call
this.toastService.success('Comment delete functionality coming soon');
}
}
editProfile(report: ProfileReportWithUsers): void {
const userId = report.reportedUser.id;
const username = report.reportedUser.username;
// Navigate to profile edit page or open edit modal
this.router.navigate(['/profile', username]);
this.toastService.success('Navigate to profile to edit');
}
makeProfilePrivate(report: ProfileReportWithUsers): void {
const username = report.reportedUser.username;
const confirmed = confirm(`Are you sure you want to make ${username}'s profile private?`);
if (confirmed) {
// TODO: Implement make profile private API call
this.toastService.success('Profile privacy functionality coming soon');
}
}
} }