Complete profanity filter UI integration

- Added tab-based admin interface with separate Profanity Filter tab
- Implemented custom word management (add/delete words with severity levels)
- Added profanity filter testing interface for real-time validation
- Integrated with profanity database API endpoints
- Added comprehensive CSS styling for new UI components
- Full admin interface for managing custom profanity words and categories
This commit is contained in:
Deco Vander 2025-07-04 00:07:03 -04:00
parent c7f39e4939
commit 71ddcc9a5c
2 changed files with 390 additions and 23 deletions

View file

@ -184,7 +184,7 @@
gap: 20px;
margin-bottom: 20px;
}
.stat-card {
background: var(--card-bg);
color: var(--text-color);
@ -193,19 +193,123 @@
box-shadow: 0 2px 4px var(--shadow);
text-align: center;
}
.stat-number {
font-size: 2em;
font-weight: bold;
color: #007bff;
}
.address-cell {
max-width: 300px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
/* Tab Navigation */
.tab-navigation {
display: flex;
gap: 10px;
margin-bottom: 20px;
border-bottom: 2px solid #ddd;
}
.tab-btn {
padding: 12px 20px;
background: none;
border: none;
border-bottom: 3px solid transparent;
cursor: pointer;
font-size: 16px;
font-weight: 500;
color: #666;
transition: all 0.3s ease;
}
.tab-btn.active {
color: #007bff;
border-bottom-color: #007bff;
background: rgba(0, 123, 255, 0.1);
}
.tab-btn:hover {
color: #007bff;
background: rgba(0, 123, 255, 0.05);
}
.tab-content {
display: none;
}
.tab-content.active {
display: block;
}
/* Profanity Management Forms */
.profanity-add-form,
.profanity-test-form {
background: #f8f9fa;
padding: 20px;
border-radius: 8px;
margin-bottom: 20px;
}
.profanity-add-form h4,
.profanity-test-form h4 {
margin-top: 0;
color: #495057;
}
.form-row {
display: flex;
gap: 10px;
align-items: center;
flex-wrap: wrap;
}
.form-row input,
.form-row select {
padding: 8px 12px;
border: 1px solid #ddd;
border-radius: 4px;
font-size: 14px;
}
.form-row input[type="text"] {
flex: 1;
min-width: 200px;
}
.form-row select {
min-width: 140px;
}
.test-results {
margin-top: 15px;
padding: 15px;
border-radius: 4px;
min-height: 40px;
font-family: monospace;
}
.test-results.clean {
background: #d4edda;
border: 1px solid #c3e6cb;
color: #155724;
}
.test-results.profane {
background: #f8d7da;
border: 1px solid #f5c6cb;
color: #721c24;
}
.test-results.empty {
background: #e2e3e5;
border: 1px solid #d6d8db;
color: #6c757d;
}
/* Mobile responsiveness for admin panel */
@media (max-width: 768px) {
@ -366,26 +470,90 @@
</div>
</div>
<div class="form-section">
<h3>All Location Reports</h3>
<table class="locations-table">
<thead>
<tr>
<th>ID</th>
<th>Status</th>
<th>Address</th>
<th>Description</th>
<th>Persistent</th>
<th>Reported</th>
<th>Actions</th>
</tr>
</thead>
<tbody id="locations-tbody">
<tr>
<td colspan="7">Loading...</td>
</tr>
</tbody>
</table>
<!-- Tab Navigation -->
<div class="tab-navigation">
<button class="tab-btn active" data-tab="locations">📍 Location Reports</button>
<button class="tab-btn" data-tab="profanity">🚫 Profanity Filter</button>
</div>
<!-- Locations Tab -->
<div id="locations-tab" class="tab-content active">
<div class="form-section">
<h3>All Location Reports</h3>
<table class="locations-table">
<thead>
<tr>
<th>ID</th>
<th>Status</th>
<th>Address</th>
<th>Description</th>
<th>Persistent</th>
<th>Reported</th>
<th>Actions</th>
</tr>
</thead>
<tbody id="locations-tbody">
<tr>
<td colspan="7">Loading...</td>
</tr>
</tbody>
</table>
</div>
</div>
<!-- Profanity Management Tab -->
<div id="profanity-tab" class="tab-content">
<div class="form-section">
<h3>Custom Profanity Words</h3>
<!-- Add new word form -->
<div class="profanity-add-form">
<h4>Add Custom Word</h4>
<form id="add-profanity-form">
<div class="form-row">
<input type="text" id="new-word" placeholder="Enter word or phrase" required>
<select id="new-severity">
<option value="low">Low Severity</option>
<option value="medium" selected>Medium Severity</option>
<option value="high">High Severity</option>
</select>
<input type="text" id="new-category" placeholder="Category (optional)" value="custom">
<button type="submit">Add Word</button>
</div>
</form>
</div>
<!-- Test profanity filter -->
<div class="profanity-test-form">
<h4>Test Profanity Filter</h4>
<form id="test-profanity-form">
<div class="form-row">
<input type="text" id="test-text" placeholder="Enter text to test" required>
<button type="submit">Test Filter</button>
</div>
<div id="test-results" class="test-results"></div>
</form>
</div>
<!-- Custom words table -->
<table class="locations-table">
<thead>
<tr>
<th>ID</th>
<th>Word</th>
<th>Severity</th>
<th>Category</th>
<th>Added</th>
<th>Actions</th>
</tr>
</thead>
<tbody id="profanity-tbody">
<tr>
<td colspan="6">Loading...</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>