devilry / trix2

Next generation Trix. Detailed task control and statistics app for better learning outcome.
BSD 3-Clause "New" or "Revised" License
2 stars 3 forks source link

Refactoring CSS and JS #146

Open torgeirl opened 6 months ago

torgeirl commented 6 months ago

Goals

Possible solutions


Tasks

Inline styling:

(* Inline styling is removed from /trix_admin/statistics.django.html, but that has caused (at least) two changes:

  1. the table header styling now has working directional arrows («A-Z indicators») :tada:
  2. the course tag has a nonfunctional X (should only be displayed on optional tags) :x:)

Inline scripts:


HTMX features that rely on eval() are:

Note that all features removed by disabling eval() can be reimplemented using your own custom javascript and the htmx event model.

Levijatan commented 6 months ago

The print button in trix/trix_student/templates/trix_student/assignment_list_base.django.html is pretty much the standard way to have a print button so I don't know if there is any other cleaner way to do it.

Levijatan commented 6 months ago

Moved the inline javascript in statistics.django.html out into their own file in 7aa0f05

Levijatan commented 6 months ago

Looking through all the javascript I think it wouldn't be to hard to replace most of it with HTMX, most of what angular is being used for seems to be simple state control. It would require some work on most of the views to get most out of it, but atleast I feel that it would be worth it.

torgeirl commented 6 months ago

The print button in trix/trix_student/templates/trix_student/assignment_list_base.django.html is pretty much the standard way to have a print button so I don't know if there is any other cleaner way to do it.

I've landed on simply removing it; most users are familiar with Ctrl+P and that has the bonus of allowing the user to print only select parts of the page instead of all assignments on a give page. :leaves:

Levijatan commented 6 months ago

Moved out the inline styles in statistics. 4888329. Quite happy that Less could generate css so it was quite nice to generate classes for progress bar width 1-100%

Levijatan commented 6 months ago

Could use the same css classes in assignment_list, pushed up in 62e0aa9