Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use colour on index screen #13

Open
glennjacobs opened this issue Aug 9, 2019 · 6 comments
Open

Use colour on index screen #13

glennjacobs opened this issue Aug 9, 2019 · 6 comments

Comments

@glennjacobs
Copy link

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.

@davidpiesse
Copy link
Owner

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

@glennjacobs
Copy link
Author

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

@davidpiesse
Copy link
Owner

no worries 👍

@davidpiesse
Copy link
Owner

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

@glennjacobs
Copy link
Author

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

@davidpiesse
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants