learning-unlimited / ESP-Website

A website to help manage the logistics of large, short-term educational programs
82 stars 57 forks source link

Reset and remove optional fruitsalad variables #3696

Closed willgearty closed 6 months ago

willgearty commented 8 months ago

This adds the following functionality to the theme editor:

And when optional variables are included (I believe this is just for the fruitsalad theme atm):

I've checked and the addition and removal of variables is saved whenever you press the "Test" submission button.

image

Fixes #3674. Supersedes #3675.

willgearty commented 7 months ago

@kkbrum I'm not quite sure what you mean by the "default" color. Do you mean the first color in the palette (in which case the default for all of them would be the same)? Or do you mean the color that the variable is normally set to (in which case the default may be different for each variable)?

kkbrum commented 7 months ago

I think it should start as the color that the variable is automatically set to if it is not included as an optional variable. So it's different for each one. Then you can see the current color when you add it as a variable so you know you're working on the right thing and have a good baseline for the color. And then can reset it to that as well.

willgearty commented 6 months ago

OK, I've made it so that when you add a new variable, the initial color is the default color. And, whenever you reset one of these variables (plus the other variables, including the rounding_radius), it resets to whatever the default color/value is.

willgearty commented 6 months ago

OK, @kkbrum, the most recent commit does the first point (great suggestion), but I don't think I'll implement your second point because I want the "Reset Color" buttons to all do the same thing (reset to the theme default).