nova-toggle icon indicating copy to clipboard operation
nova-toggle copied to clipboard

Use colour on index screen

Open glennjacobs opened this issue 5 years ago • 6 comments

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.

glennjacobs avatar Aug 09 '19 10:08 glennjacobs

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

davidpiesse avatar Aug 09 '19 10:08 davidpiesse

I'll take a look later and see what I can do.

glennjacobs avatar Aug 09 '19 10:08 glennjacobs

no worries 👍

davidpiesse avatar Aug 09 '19 10:08 davidpiesse

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

davidpiesse avatar Apr 16 '21 07:04 davidpiesse

Sorry I never managed to do a PR, unfortunately, I haven't worked on Nova recently.

glennjacobs avatar Apr 16 '21 08:04 glennjacobs

No worries - just doing a bit of housekeeping before I delve into this all.

davidpiesse avatar Apr 16 '21 08:04 davidpiesse