Skip to content

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
@gugupy
Copy link
Contributor Author

gugupy commented Mar 3, 2025

Hi @dpgaspar, Could you please have a look at this pull request?

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