charettes / django-colorful

Extension to the Django web framework that provides database and form color fields
https://pypi.python.org/pypi/django-colorful
MIT License
169 stars 58 forks source link

Add possibility to leave colorfield blank #39

Closed SimonBarendse closed 3 years ago

SimonBarendse commented 7 years ago

Hi, First of all, thanks for a great extension! I enjoy it very much. As I've noticed some others required as well (#28), I am looking for an option to leave the colorfield blank.

This is a first draft of a possible solution. If you can spare the time I would love to get some feedback.

For now the extra checkbox indicating whether a value has been set is not updated. I would like to hide this and set it to false when the color-input is clicked.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-11.8%) to 88.172% when pulling eff771be62d60498af810929ffdbb0fced4bce28 on SimonBarendse:master into 7b54bf9b758e6fd9aaaaf78819b5eb15e51ac5de on charettes:master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-11.8%) to 88.172% when pulling eff771be62d60498af810929ffdbb0fced4bce28 on SimonBarendse:master into 7b54bf9b758e6fd9aaaaf78819b5eb15e51ac5de on charettes:master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-19.2%) to 80.769% when pulling 742ca0c5dfcf44d0f64a0f23ea763ab760407910 on SimonBarendse:master into 7b54bf9b758e6fd9aaaaf78819b5eb15e51ac5de on charettes:master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-19.2%) to 80.769% when pulling 742ca0c5dfcf44d0f64a0f23ea763ab760407910 on SimonBarendse:master into 7b54bf9b758e6fd9aaaaf78819b5eb15e51ac5de on charettes:master.

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling e2be2779b8b840b3c4d2ff0d8120b426c81cf489 on SimonBarendse:master into 9bf995a26154453d4890478767ffb28af2f85657 on charettes:master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-19.2%) to 80.769% when pulling 9c451315b3e9451883846b0d3c9d4150ed1ac6d8 on SimonBarendse:master into 7b54bf9b758e6fd9aaaaf78819b5eb15e51ac5de on charettes:master.

yakky commented 6 years ago

@charettes how can I help to get this merged?

(tests fail as python 3.2/3.3 are no longer available on travis)

charettes commented 6 years ago

@yakky I'll deal with the build issues tonight but tests should be added for the new code.

charettes commented 6 years ago

Alright CI issues are fixed. Rebasing on top of the latest master branch or merging it in should get you started toward adding full coverage for your changes.

yakky commented 6 years ago

@SimonBarendse do you need any help on this?

SimonBarendse commented 6 years ago

@yakky I currently do not have a lot of spare time. If you would be willing to help out with writing tests, that would be great. More suggestions for improvements are welcome too :)

I've rebased on master, CI seems to work now.

yakky commented 6 years ago

@SimonBarendse will do

SimonBarendse commented 6 years ago

@yakky Had some free time after all :)

charettes commented 6 years ago

Hey @SimonBarendse thanks for the tests. I had a question, if the checkbox is hidden how is a user supposed to mark the field blank once a color is selected?

SimonBarendse commented 6 years ago

Hi @charettes good question. That is currently not possible. When the user selects a color the checkbox is unchecked and the color is used (instead of blank).

With the checkbox hidden, there is currently no possibility to set the field to None again once a color is selected.

To provide that functionality, maybe we should make it optional to make the checkbox visible to the user?

charettes commented 6 years ago

I feel like having an always visible checkbox with an empty label that would disable the color input when checked and renable it when unchecked would make the most sense here.

SimonBarendse commented 6 years ago

Sounds good! Will look into that later

guettli commented 6 years ago

What are the next steps? It would be nice to have this feature.

charettes commented 6 years ago

@guettli https://github.com/charettes/django-colorful/pull/39#issuecomment-380223695

guettli commented 3 years ago

I won't work on this issue. If nobody does, then it might makes sense to close it?

SimonBarendse commented 3 years ago

Thanks all for providing feedback on this PR! I'm sorry for leaving this PR without any response from my side for so long.

I no longer have a use case for this and have no plans on continuing this PR. If anyone else does (still) have a use for this functionality, please feel free to re-open and take over. For now, I'll close this PR.