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

feat: ability to customize action button color #2288

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

gugupy
Copy link
Contributor

@gugupy gugupy commented Nov 25, 2024

Description

To customize the button color when the single parameter is True, you can assign the btn_class value based on the intended action.

@action("delete", "Delete", "Delete all Really?", "fa-rocket", btn_class="btn-danger")
def muldelete(self, items):
    if isinstance(items, list):
        self.datamodel.delete_all(items)
        self.update_redirect()
    else:
        self.datamodel.delete(items)
            return redirect(self.get_redirect())

The btn_class parameter is explicitly set to btn-danger to reflect the critical nature of the Delete action, ensuring the button visually communicates its purpose effectively.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Is CRUD MVC related.
  • Is Auth, RBAC security related.
  • Changes the security db schema.
  • Introduces new feature
  • Removes existing feature

Copy link
Contributor

@Yoyasp Yoyasp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a great option to have! Also nice to still let it have the default primary color.

@gugupy gugupy requested a review from Yoyasp January 10, 2025 08:07
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

Successfully merging this pull request may close these issues.

3 participants