Skip to content

Refactor frontend css/javascript assets.#149

Closed
s-sajid-ali wants to merge 9 commits intomainfrom
frontend-refactor
Closed

Refactor frontend css/javascript assets.#149
s-sajid-ali wants to merge 9 commits intomainfrom
frontend-refactor

Conversation

@s-sajid-ali
Copy link
Member

@s-sajid-ali s-sajid-ali commented Feb 12, 2026

Too many merge conflicts, so used claude to duplicate the commit 1d8290f here.

s-sajid-ali and others added 9 commits February 12, 2026 18:57
- This commit strives to not change existing functionality
- Dependencies (bootstrap, datatables, jquery, etc) are now managed using npm
- Use vite to bundle javascript/css assets
- Start refactoring to typescript and removing duplicated code
- Start moving javascript out from templates
- Add ci to check with eslint/prettier
- Add htmx
- Fix LogoutView which now requires POST request as of Django5

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The previous commit refactored frontend assets to use vite but broke
FontAwesome icon loading because:
1. The font path was set incorrectly (../webfonts instead of ./webfonts)
2. The webfont files were not being copied to the bundles directory

This commit:
- Configures the FontAwesome SCSS variable to use the correct font path
- Adds a vite plugin to copy webfont files to the output directory
- Rebuilds the CSS bundle with the corrected font paths
- Adds fs-extra dev dependency for file copying in the build process

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Import nyu_violet.css into the bundled coldfront.scss so the branding
styles are included in the compiled CSS bundle.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…tor.

The refactored TypeScript modules in coldfront/static/src/ now provide all the JavaScript functionality that was previously duplicated across templates:
- DataTable initialization (dataTable.ts)
- Select2 initialization (select2.ts)
- Form handlers: reset, expand/collapse, selectAll checkboxes (form.ts)
- Date picker initialization (dateSelector.ts)
- Utility functions: getCookie, drawGauges (util.ts)

Removed ~423 lines of inline JavaScript from 26 templates.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…tstrap loads.

Bootstrap 4 requires jQuery to be available on the window object before it initializes. The previous import order caused dropdown functionality (including the logout button) to break because Bootstrap was imported before jQuery was assigned to window.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit fixes several issues where templates were partially reverted
after the frontend refactor (commit 1d8290f):

- Restore bundled JavaScript loading for center_summary.html and
  allocation_summary.html using bundle_snippet.html includes
- Wrap JavaScript in DOMContentLoaded event listeners for publication
  and user search templates
- Remove navbar manipulation scripts that were re-added after being
  deleted in the refactor
- Fix hardcoded static file paths to use {% static %} template tag
- Restore 'datatable' class on user_list_allocations.html table
- Fix indentation and formatting to match refactor commit style

Removed ~170 lines of duplicated/reverted inline JavaScript across
11 templates.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@s-sajid-ali s-sajid-ali marked this pull request as draft February 13, 2026 16:37
@s-sajid-ali
Copy link
Member Author

superseded by #150

this pr is mostly a failed attempt at getting claude to cherry-pick the upstream commit without the conflicts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments