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

Collapsed Field is not showing in form when using collapse class in django admin fieldsets #1

Open
mahbd opened this issue Oct 31, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@mahbd
Copy link

mahbd commented Oct 31, 2021

While I use collapse class, no show button not fields show up. Please see image for clearance

Django==3.2.8
python==3.10.0

settings.py

INSTALLED_APPS = [
    'admin_interface',
    'colorfield',
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'CheckAdmin',
]

models.py

class Check(models.Model):
    name = models.CharField(max_length=255)
    name1 = models.CharField(max_length=255)
    name2 = models.CharField(max_length=255)

admin.py

@admin.register(Check)
class CheckAdmin(admin.ModelAdmin):
    fieldsets = (
        (None, {
            'fields': ['name']
        }),
        ('Optionals', {
            'classes': ['collapse'],
            'fields': ['name1', 'name2']
        })
    )

Actually I found this problem when using django-admin-508 in another project. To be sure that the issue is being caused by django-admin-508 I created new project and found it is being caused by django-admin-508.

Note: Around six month ago when I was trying to use bootstrap4 in admin panel I faced same issue. So, I guess it is CSS related issue

@jorgegonzalez
Copy link
Contributor

Thanks for the report, I'll look into this soon.

@jorgegonzalez jorgegonzalez added the bug Something isn't working label Feb 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants