Revert "Updated a lot of stuff"

This reverts commit 915febb352.

Made on behalf of @ComputerTech312
This commit is contained in:
Julian Marcos
2024-10-14 16:23:04 +02:00
parent 875fd9a6b2
commit 58884e119d
16 changed files with 887 additions and 255 deletions

128
templates/modapp.html Normal file
View File

@@ -0,0 +1,128 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ircquotes: Admin Panel</title>
<link rel="stylesheet" href="{{ url_for('static', filename='styles.css') }}" />
</head>
<body bgcolor="#ffffff" text="#000000" link="#c08000" vlink="#c08000" alink="#c08000">
<!-- Navigation -->
<center>
<table cellpadding="2" cellspacing="0" width="80%" border="0">
<tr>
<td bgcolor="#c08000" align="left">
<font size="+1"><b><i>ircquotes</i></b></font>
</td>
<td bgcolor="#c08000" align="right">
<font face="arial" size="+1"><b>Admin Panel</b></font>
</td>
</tr>
</table>
<table cellpadding="2" cellspacing="0" width="80%" border="0">
<tr>
<td class="footertext" align="left" bgcolor="#f0f0f0"></td>
<td align="right" bgcolor="#f0f0f0" class="toplinks" colspan="2">
<a href="/">Home</a> /
<a href="/random">Random</a> /
<a href="/submit">Submit</a> /
<a href="/browse">Browse</a> /
<a href="/modapp">Modapp</a>
</td>
</tr>
</table>
</center>
<!-- Main Content: All Quotes for Moderation -->
<center>
<h2>All Quotes for Moderation</h2>
<!-- Filter Options -->
<form method="GET" action="/modapp">
<label for="filter">Filter by:</label>
<select name="filter" id="filter">
<option value="pending" {% if filter_status == 'pending' %}selected{% endif %}>Pending</option>
<option value="approved" {% if filter_status == 'approved' %}selected{% endif %}>Approved</option>
<option value="rejected" {% if filter_status == 'rejected' %}selected{% endif %}>Rejected</option>
</select>
<input type="submit" value="Apply Filter">
</form>
{% if quotes.items %}
<!-- Table for Quotes -->
<table border="1" cellpadding="5" cellspacing="0" width="100%">
<tr>
<th>Quote ID</th>
<th>Quote</th>
<th>Status</th>
<th>Submitted At</th>
<th>IP Address</th>
<th>User Agent</th>
<th>Actions</th>
</tr>
<!-- Loop through quotes -->
{% for quote in quotes.items %}
<tr style="background-color:
{% if quote.status == 1 %} #d4edda {% elif quote.status == 2 %} #f8d7da {% else %} #fff {% endif %}">
<td>#{{ quote.id }}</td>
<td>{{ quote.text }}</td>
<td>
{% if quote.status == 0 %}
Pending
{% elif quote.status == 1 %}
Approved
{% else %}
Rejected
{% endif %}
</td>
<td>{{ quote.submitted_at.strftime('%Y-%m-%d %H:%M:%S') if quote.submitted_at else 'N/A' }}</td>
<td>{{ quote.ip_address }}</td>
<td>{{ quote.user_agent }}</td>
<td>
<a href="/approve/{{ quote.id }}">Approve</a> |
<a href="/reject/{{ quote.id }}">Reject</a> |
<a href="/delete/{{ quote.id }}">Delete</a>
</td>
</tr>
{% endfor %}
</table>
<!-- Pagination Links -->
<div id="pagination">
{% if quotes.has_prev %}
<a href="{{ url_for('modapp', page=quotes.prev_num, filter=filter_status) }}">&laquo; Previous</a>
{% endif %}
<span>Page {{ quotes.page }} of {{ quotes.pages }}</span>
{% if quotes.has_next %}
<a href="{{ url_for('modapp', page=quotes.next_num, filter=filter_status) }}">Next &raquo;</a>
{% endif %}
</div>
{% else %}
<p>No quotes available for moderation.</p>
{% endif %}
</center>
<!-- Footer -->
<center>
<table border="0" cellpadding="2" cellspacing="0" width="80%" bgcolor="#c08000">
<tr>
<td bgcolor="#f0f0f0" class="toplinks" colspan="2">
<a href="/">Home</a> /
<a href="/random">Random</a> /
<a href="/submit">Submit</a> /
<a href="/browse">Browse</a> /
</td>
</tr>
<tr>
<td class="footertext" align="left">&nbsp;</td>
<td class="footertext" align="right">
{{ approved_count }} quotes approved; {{ pending_count }} quotes pending; {{ rejected_count }} quotes rejected
</td>
</tr>
</table>
</center>
</body>
</html>