nova-toggle
nova-toggle copied to clipboard
Use colour on index screen
To give you an example, we've got a field called 'emergency'. We wanted to make the label colour red for this, which works great on the edit screen.
However, when viewing it on the index screen, it still shows as a green dot which is confusing.
Nice idea @glennjacobs ,
This would probably be implemented with a couple of methods like ->setIndexTrueColor()
and ->setIndexFalseColor()
.
These would then get passed to the Index view. Instread of the current logic
:class="{'bg-success': field.value, 'bg-danger': !field.value}" />
it would need to be in a computed color() value based off the current value (T/F) and if there are colors set as well.
Are you up for writing a PR on this?
D
I'll take a look later and see what I can do.
no worries 👍
This looks like something. I would implement in the new version (v1).
I am currently working on the new version for the latest upcoming Nova version (v4) which will use Vue 3; and I will be implementing Headless UI's toggle. https://headlessui.dev/vue/switch
Sorry I never managed to do a PR, unfortunately, I haven't worked on Nova recently.
No worries - just doing a bit of housekeeping before I delve into this all.