Initial commit with project setup
This commit is contained in:
59
templates/manage_toxicities.html
Normal file
59
templates/manage_toxicities.html
Normal file
@@ -0,0 +1,59 @@
|
||||
{% extends "admin_base.html" %}
|
||||
|
||||
{% block title %}Manage Toxicity Levels{% endblock %}
|
||||
|
||||
{% block admin_content %}
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
||||
<!-- Add new toxicity level form -->
|
||||
<div class="bg-gray-50 p-6 rounded-lg">
|
||||
<h2 class="text-xl font-bold mb-4">Add New Toxicity Level</h2>
|
||||
<form method="POST" enctype="multipart/form-data" class="space-y-4">
|
||||
<div>
|
||||
<label for="name" class="block text-sm font-medium text-gray-700">Name</label>
|
||||
<input type="text" name="name" id="name" required
|
||||
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500">
|
||||
</div>
|
||||
<div>
|
||||
<label for="description" class="block text-sm font-medium text-gray-700">Description</label>
|
||||
<textarea name="description" id="description" rows="3"
|
||||
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500"></textarea>
|
||||
</div>
|
||||
<div>
|
||||
<label for="icon" class="block text-sm font-medium text-gray-700">Icon (SVG)</label>
|
||||
<input type="file" name="icon" id="icon" accept=".svg" class="mt-1 block w-full text-sm text-gray-700">
|
||||
</div>
|
||||
<button type="submit" class="w-full btn-main text-lg font-semibold">Add Toxicity Level</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- List of existing toxicity levels -->
|
||||
<div class="bg-gray-50 p-6 rounded-lg">
|
||||
<h2 class="text-xl font-bold mb-4">Existing Toxicity Levels</h2>
|
||||
<div class="space-y-4">
|
||||
{% for toxicity in toxicities %}
|
||||
<div class="p-4 rounded-lg shadow flex justify-between items-center">
|
||||
<div class="flex items-center gap-3">
|
||||
{% if toxicity.icon %}
|
||||
<img src="{{ url_for('static', filename='icons/' ~ toxicity.icon) }}" alt="Icon" class="w-8 h-8 inline-block">
|
||||
{% endif %}
|
||||
<div>
|
||||
<h3 class="font-bold">{{ toxicity.name }}</h3>
|
||||
{% if toxicity.description %}
|
||||
<p class="text-gray-600 mt-2">{{ toxicity.description }}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex space-x-2">
|
||||
<a href="{{ url_for('edit_toxicity', toxicity_id=toxicity.id) }}" class="btn-edit">Edit</a>
|
||||
<form id="delete-toxicity-{{ toxicity.id }}" method="POST" action="{{ url_for('delete_toxicity', toxicity_id=toxicity.id) }}" style="display:inline;">
|
||||
<button type="button" onclick="showDeleteModal('delete-toxicity-{{ toxicity.id }}', 'Are you sure you want to delete the toxicity level {{ toxicity.name }}?')" class="btn-delete">Delete</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<p class="text-gray-500">No toxicity levels added yet.</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user