Skip to content

Commit 81d0aa3

Browse files
authored
feat: djangoql (#1676)
1 parent fee2cd6 commit 81d0aa3

File tree

4 files changed

+51
-1
lines changed

4 files changed

+51
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ Need expert help with Django or Unfold? We offer services to support your projec
7575
- [django-modeltranslation](https://github.com/deschler/django-modeltranslation) - [Integration guide](https://unfoldadmin.com/docs/integrations/django-modeltranslation/)
7676
- [django-money](https://github.com/django-money/django-money) - [Integration guide](https://unfoldadmin.com/docs/integrations/django-money/)
7777
- [django-location-field](https://github.com/caioariede/django-location-field) - [Integration guide](https://unfoldadmin.com/docs/integrations/django-location-field/)
78+
- [djangoql](https://github.com/ivelum/djangoql) - [Integration guide](https://unfoldadmin.com/docs/integrations/djangoql/)
7879

7980
## Credits
8081

docs/integrations/djangoql.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
title: djangoql
3+
order: 0
4+
description: Integrate djangoql with Unfold for a modern, styled admin search experience.
5+
---
6+
7+
# djangoql
8+
9+
Unfold provides out-of-the-box support for the djangoql package by applying custom styles to its search input, toggle checkbox, and dropdown components. No additional configuration or changes to your `settings.py` file are required to enable this integration—simply ensure Unfold is installed and activated in your Django project.
10+
11+
- Only the default admin djangoql search UI receives Unfold styling for a consistent look and feel.
12+
- Custom pages generated by djangoql (such as embedded documentation pages) are not styled by Unfold.
13+
- Unfold also removes the "help" link to djangoql’s documentation page via CSS for a cleaner user interface.

src/unfold/static/unfold/css/styles.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/unfold/styles.css

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -686,3 +686,39 @@ trix-toolbar[id^="trix-toolbar-"] {
686686
.simplebar-horizontal-scrollbar-top .simplebar-track.simplebar-horizontal {
687687
@apply top-9
688688
}
689+
690+
/*******************************************************
691+
DjangoQL
692+
*******************************************************/
693+
textarea#searchbar {
694+
@apply font-medium placeholder-base-400 leading-[35px] max-h-[35px] min-h-[35px] whitespace-nowrap !w-full focus:outline-none;
695+
}
696+
697+
div.djangoql-completion {
698+
@apply border border-base-200 rounded-default shadow-xs bg-white dark:border-base-700 dark:bg-base-800 -ml-[39px] mt-[6px] w-[384px];
699+
}
700+
701+
div.djangoql-completion ul {
702+
@apply py-1;
703+
}
704+
705+
div.djangoql-completion li {
706+
@apply flex items-center leading-none mx-1 px-3 h-[30px] rounded-default text-sm hover:bg-base-100 hover:text-important hover:text-base-700 dark:hover:bg-base-700 dark:hover:text-base-200;
707+
}
708+
709+
div.djangoql-completion li.active {
710+
@apply bg-base-100 text-important dark:bg-base-700;
711+
}
712+
713+
div.djangoql-completion li i {
714+
@apply ml-auto text-sm text-default;
715+
}
716+
717+
div.djangoql-completion .syntax-help {
718+
@apply hidden;
719+
}
720+
721+
.djangoql-toggle {
722+
@apply appearance-none bg-white block border border-base-300 cursor-pointer h-4 min-w-4 relative rounded-[4px] shadow-xs w-4 hover:border-base-400 dark:bg-base-700 dark:border-base-500 dark:checked:after:text-white focus:outline focus:outline-2 focus:outline-offset-2 focus:outline-primary-500 after:absolute after:content-['check\_small'] after:flex! after:h-4 after:items-center after:justify-center after:leading-none after:material-symbols-outlined after:-ml-px after:-mt-px after:text-white after:transition-all after:w-4 dark:after:text-base-700 checked:bg-primary-600 dark:checked:bg-primary-600 checked:border-primary-600 dark:checked:border-primary-600 checked:transition-all checked:hover:border-primary-600;
723+
@apply relative -ml-4.5;
724+
}

0 commit comments

Comments
 (0)