53 lines
2.1 KiB
HTML
53 lines
2.1 KiB
HTML
{% extends "admin/base.html" %}
|
|
|
|
{% block title %}Add Item - Digital Garage Sale{% endblock %}
|
|
|
|
{% block content %}
|
|
<h2>Add New Item</h2>
|
|
|
|
<form method="post" action="{{ url_for('admin.add_item') }}" enctype="multipart/form-data">
|
|
<div class="form-group">
|
|
<label for="title">Item Title</label>
|
|
<input type="text" id="title" name="title" class="form-control" required>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="description">Description</label>
|
|
<textarea id="description" name="description" class="form-control" rows="4" required></textarea>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="price">Price ($)</label>
|
|
<input type="number" id="price" name="price" class="form-control" step="0.01" min="0" required>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="category_id">Category</label>
|
|
<select id="category_id" name="category_id" class="form-control" required>
|
|
<option value="">Select a category</option>
|
|
{% for category in categories %}
|
|
<option value="{{ category.id }}">{{ category.name }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="status">Status</label>
|
|
<select id="status" name="status" class="form-control" required>
|
|
<option value="For Sale">For Sale</option>
|
|
<option value="On Hold">On Hold</option>
|
|
<option value="Sold">Sold</option>
|
|
</select>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="image">Item Image</label>
|
|
<input type="file" id="image" name="image" class="form-control">
|
|
<small>Optional. Accepted formats: JPG, PNG, GIF</small>
|
|
</div>
|
|
|
|
<button type="submit" class="btn btn-primary">Add Item</button>
|
|
<a href="{{ url_for('admin.items') }}" class="btn" style="margin-left: 0.5rem;">Cancel</a>
|
|
</form>
|
|
{% endblock %}
|