From eebf54d0a3704e0f6d264ca930f95fab081382d3 Mon Sep 17 00:00:00 2001 From: candifloss <candifloss@candifloss.cc> Date: Fri, 4 Apr 2025 16:14:25 +0530 Subject: [PATCH] Style: Delete page preview - Add bootstrap style to item preview on delete page --- templates/delete.html | 98 +++++++++++++++++++++++++++++++------------ 1 file changed, 71 insertions(+), 27 deletions(-) diff --git a/templates/delete.html b/templates/delete.html index 1e89bb4..d217d52 100644 --- a/templates/delete.html +++ b/templates/delete.html @@ -5,38 +5,82 @@ <title>Delete Item</title> {% include 'favicon.html' %} <link href="{{ url_for('static', filename='css/bootstrap.min.css') }}" rel="stylesheet"> + <link href="{{ url_for('static', filename='css/bootstrap-icons.min.css') }}" rel="stylesheet"> + <style> + .delete-container { + max-width: 800px; + margin: 0 auto; + } + .preview-card { + background: white; + border-radius: 0.5rem; + box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075); + } + .attribute-grid { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); + gap: 1rem; + } + .attribute-item { + padding: 0.75rem; + border-bottom: 1px solid #eee; + } + .attribute-label { + font-weight: 600; + color: #6c757d; + } + .sticky-actions { + position: sticky; + bottom: 0; + background: white; + padding: 1rem 0; + border-top: 1px solid #dee2e6; + margin-top: 2rem; + } + </style> </head> -<body align="center"> +<body> {% include 'header.html' %} - <main class="container mt-5 pt-3"> - <h2>Are you sure you want to delete the item?</h2> - <!-- Confirmation form --> - <form action='' method="post"> - <br> - <input type="submit" value="Delete"> - <button type="button" onclick="window.location.href='/'">Cancel</button> - </form> + <main class="container mt-5"> + <div class="delete-container"> + <h2 class="mb-4 text-center">Confirm Deletion</h2> + <p class="lead text-center text-danger mb-4"> + <i class="bi bi-exclamation-triangle-fill"></i> Are you sure you want to delete this item? + </p> - <!-- Display a preview of the item --> - <table border="1" align="center"> - <thead> - <tr> - <th>Attribute</th> - <th>Value</th> - </tr> - </thead> - <tbody> - {% for attrib in item_attributes %} - <tr> - <td>{{ attrib.display_name }}</td> - <td>{{ item[attrib.attrib_name] }}</td> - </tr> - {% endfor %} - </tbody> - </table> + <!-- Item Preview --> + <div class="preview-card p-4 mb-4"> + <h3 class="h5 mb-3">Item Details</h3> + <div class="attribute-grid"> + {% for attrib in item_attributes %} + <div class="attribute-item"> + <div class="attribute-label">{{ attrib.display_name }}</div> + <div class="attribute-value">{{ item[attrib.attrib_name] }}</div> + </div> + {% endfor %} + </div> + </div> + + <!-- Sticky action buttons --> + <div class="sticky-actions"> + <div class="d-flex justify-content-center gap-3"> + <button type="button" + onclick="window.location.href='/'" + class="btn btn-outline-secondary px-4"> + <i class="bi bi-x-lg me-1"></i>Cancel + </button> + <form action="" method="post" class="mb-0"> + <button type="submit" class="btn btn-danger px-4"> + <i class="bi bi-trash3 me-1"></i>Confirm Delete + </button> + </form> + </div> + </div> + </div> </main> - <!-- Bootstrap JS (for dropdowns) --> + + <!-- Bootstrap JS --> <script src="{{ url_for('static', filename='js/bootstrap.bundle.min.js') }}"></script> </body> </html> \ No newline at end of file