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 %}
                            | {{ attrib.display_name }} | 
                        {% endfor %}
                    
                
                
                    {% for entry in entries %}
                        
                            {% for attrib in item_attributes %}
                                | 
                                    {{ entry[attrib.attrib_name] }}
                                 | 
                            {% endfor %}
                        
                    {% endfor %}
                
            
        {% endif %}
    {% endfor %}
    
    {% if new_entries or existing_entries %}
    
    {% endif %}