From 233e8a0cd33ad436aff60aba40b5ff7373fccd2f Mon Sep 17 00:00:00 2001 From: candifloss Date: Fri, 4 Apr 2025 15:39:04 +0530 Subject: [PATCH] Style: CSV preview - Add bootstrap layout & css for CSV preview template --- templates/csv_preview.html | 186 ++++++++++++++++++++++++------------- 1 file changed, 124 insertions(+), 62 deletions(-) diff --git a/templates/csv_preview.html b/templates/csv_preview.html index 0bca849..df46834 100644 --- a/templates/csv_preview.html +++ b/templates/csv_preview.html @@ -5,77 +5,139 @@ CSV Preview {% include 'favicon.html' %} - + + {% include 'header.html' %} -
-

CSV Preview

+ +
+

CSV Preview

- - {% with messages = get_flashed_messages(with_categories=true) %} - {% if messages %} -
- Errors found during submission (click to expand): -
    - {% for category, message in messages %} -
  • {{ category }}: {{ message }}
  • - {% endfor %} -
-
- {% endif %} - {% endwith %} - - - {% for table_name, entries, editable, tableclass in [ - ('New Entries', new_entries, true, 'table-valid-entries'), - ('Existing Entries', existing_entries, true, 'table-valid-entries'), - ('Invalid Entries', invalid_entries, false, 'table-invalid-entries') - ] %} - {% if entries %} -

{{ table_name }}

- {% if table_name == 'Invalid Entries' %} - {% if mode == 'import' %} -

These entries already exist:

- {% elif mode == 'edit' %} -

These entries do not exist:

- {% endif %} - {% endif %} - - - - {% for attrib in item_attributes %} - - {% endfor %} - - - - {% for entry in entries %} - - {% for attrib in item_attributes %} - + + {% with messages = get_flashed_messages(with_categories=true) %} + {% if messages %} +
+
+ Errors found during submission (click to expand/collapse): +
    + {% for category, message in messages %} +
  • {{ category }}: {{ message }}
  • {% endfor %} -
- {% endfor %} - -
{{ attrib.display_name }}
- {{ entry[attrib.attrib_name] }} -
- {% endif %} - {% endfor %} + + + + {% endif %} + {% endwith %} - - {% if new_entries or existing_entries %} -
- -
- {% endif %} + + {% for table_name, entries, editable, tableclass in [ + ('New Entries', new_entries, true, 'table-valid-entries'), + ('Existing Entries', existing_entries, true, 'table-valid-entries'), + ('Invalid Entries', invalid_entries, false, 'table-invalid-entries') + ] %} + {% if entries %} +
+

{{ table_name }}

+ {% if table_name == 'Invalid Entries' %} +
+ {% if mode == 'import' %} + These entries already exist and won't be imported + {% elif mode == 'edit' %} + These entries don't exist and can't be edited + {% endif %} +
+ {% endif %} + +
+ + + + {% for attrib in item_attributes %} + + {% endfor %} + + + + {% for entry in entries %} + + {% for attrib in item_attributes %} + + {% endfor %} + + {% endfor %} + +
{{ attrib.display_name }}
+ {{ entry[attrib.attrib_name] }} +
+
+
+ {% endif %} + {% endfor %} - - + +
+
+ + + {% if new_entries or existing_entries %} +
+ +
+ {% endif %} +
+
- + + + \ No newline at end of file