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

WIP #400

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from
Draft

Conversation

jcougnaud
Copy link
Contributor

Modification du render dans osis-portal :

from bootstrap3.renderers import FieldRenderer
from bootstrap3.utils import add_css_class


class OsisFieldRenderer(FieldRenderer):
    # 1ère version
    def __init__(self, field, *args, **kwargs):
        if not kwargs.get('success_class'):
            kwargs['success_class'] = getattr(field, 'success_class', '')
        
        super().__init__(field, *args, **kwargs)

    # 2ème version
    def get_form_group_class(self):
        form_group_class = super().get_form_group_class()
        if self.field.value() in self.field.field.empty_values:
            form_group_class = add_css_class(form_group_class, 'empty-field')
        return form_group_class

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.

1 participant