diff --git a/static/css/export_configuration.css b/static/css/export_configuration.css index 2b24266..6f4a64c 100644 --- a/static/css/export_configuration.css +++ b/static/css/export_configuration.css @@ -743,4 +743,56 @@ align-items: center; justify-content: center; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); +} + +/* Collapsible Sections */ +.collapsible-content { + max-height: 5000px; + overflow: hidden; + transition: max-height 0.5s ease-in-out, opacity 0.3s ease-in-out; + opacity: 1; +} + +.collapsible-content.collapsed { + max-height: 0; + opacity: 0; +} + +.toggle-icon { + transition: transform 0.3s ease; + margin-left: 10px; + font-size: 0.9em; + color: #6c757d; +} + +.toggle-icon.rotated { + transform: rotate(-180deg); +} + +.config-header[onclick], +.selected-columns-section h4[onclick] { + transition: background-color 0.2s ease; + border-radius: 8px; + padding: 10px; + margin: -10px; + user-select: none; +} + +.config-header[onclick]:hover, +.selected-columns-section h4[onclick]:hover { + background-color: rgba(0, 0, 0, 0.02); +} + +.config-header h3 { + display: flex; + align-items: center; + width: 100%; + justify-content: space-between; +} + +.selected-columns-section h4 { + display: flex; + align-items: center; + justify-content: space-between; + flex-wrap: wrap; } \ No newline at end of file diff --git a/static/js/export_configuration.js b/static/js/export_configuration.js index 8c76040..e399b46 100644 --- a/static/js/export_configuration.js +++ b/static/js/export_configuration.js @@ -8,6 +8,50 @@ let availableColumns = []; let sortableInstance = null; let savedColumnOrder = []; +function toggleSection(sectionId) { + try { + const section = document.getElementById(sectionId); + const icon = document.getElementById(sectionId + 'Icon'); + + if (!section) return; + + if (section.classList.contains('collapsed')) { + section.classList.remove('collapsed'); + if (icon) icon.classList.remove('rotated'); + } else { + section.classList.add('collapsed'); + if (icon) icon.classList.add('rotated'); + } + + // Save state + try { + const collapsedSections = JSON.parse(localStorage.getItem('collapsedSections') || '{}'); + collapsedSections[sectionId] = section.classList.contains('collapsed'); + localStorage.setItem('collapsedSections', JSON.stringify(collapsedSections)); + } catch (e) {} + } catch (error) { + console.error('Error toggling section:', error); + } +} + +function restoreCollapsedState() { + try { + const collapsedSections = JSON.parse(localStorage.getItem('collapsedSections') || '{}'); + + Object.keys(collapsedSections).forEach(sectionId => { + if (collapsedSections[sectionId]) { + const section = document.getElementById(sectionId); + const icon = document.getElementById(sectionId + 'Icon'); + + if (section) { + section.classList.add('collapsed'); + if (icon) icon.classList.add('rotated'); + } + } + }); + } catch (error) {} +} + // Initialize when DOM is loaded document.addEventListener('DOMContentLoaded', function() { console.log('Enhanced Export Configuration with Drag & Drop initialized'); diff --git a/templates/export_configuration.html b/templates/export_configuration.html index 7b3bd6b..99cdf93 100644 --- a/templates/export_configuration.html +++ b/templates/export_configuration.html @@ -89,12 +89,11 @@
-
+

- - Select & Order Columns for Export + Select & Order Columns for Export

-
+
- - -
-
-

How to Use

-
    -
  • Select columns: Check the boxes for columns you want to export
  • -
  • Customize names: Edit the "Export as" field to change column headers
  • -
  • Reorder columns: Drag & drop the selected columns to change their order in the Excel file
  • -
  • Preview: See how your export will look in the preview below
  • -
-
-
- - -
-

Available Columns

-
- {% for column in available_columns %} -
-
- - -
- -
- - -
+
+ + + +
+

Available Columns

+
+ {% for column in available_columns %} +
+
+ + +
+ +
+ + +
+
+ {% endfor %}
- {% endfor %}
-
- - -