Skip to content

Commit

Permalink
Merge branch 'release/2.9.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
abidibo committed Jan 12, 2024
2 parents e02de1f + 1cdaae1 commit 602424e
Show file tree
Hide file tree
Showing 16 changed files with 80 additions and 12 deletions.
2 changes: 1 addition & 1 deletion baton/static/baton/app/dist/baton.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions baton/static/baton/app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion baton/static/baton/app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "baton",
"version": "2.8.1",
"version": "2.9.0",
"description": "Django Baton App",
"main": "index.js",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions baton/static/baton/app/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ window.Baton = {
},
Analytics: Analytics,
Dispatcher: Dispatcher,
Modal: Modal
Modal: Modal,
jQuery: jQuery,
}

window.jQuery = jQuery
window.bootstrap = bootstrap
3 changes: 3 additions & 0 deletions baton/static/baton/app/src/styles/_rangefilter.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.admindatefilter p:not([class]) {
display: none !important;
}
4 changes: 2 additions & 2 deletions baton/static/baton/app/src/styles/_root.scss
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@
--#{$prefix}baton-changelist-bg: #fff;
--#{$prefix}baton-changelist-border-color: #fff;
--#{$prefix}baton-changelist-toolbar-bg: #f5f5f5;
--#{$prefix}baton-changelist-toolbar-btn-bg: #fff;
--#{$prefix}baton-changelist-toolbar-btn-bg: #f0f0f0;
--#{$prefix}baton-changelist-toolbar-btn-color: #000;
--#{$prefix}baton-changelist-toolbar-btn-hover-bg: #fafafa;
--#{$prefix}baton-changelist-sort-icon-color: #999;
Expand Down Expand Up @@ -430,7 +430,7 @@
--#{$prefix}baton-changelist-bg: #252525;
--#{$prefix}baton-changelist-border-color: #202020;
--#{$prefix}baton-changelist-toolbar-bg: #2a2a2a;
--#{$prefix}baton-changelist-toolbar-btn-bg: #222;
--#{$prefix}baton-changelist-toolbar-btn-bg: rgba(0, 0, 0, .2);
--#{$prefix}baton-changelist-toolbar-btn-color: #fff;
--#{$prefix}baton-changelist-toolbar-btn-hover-bg: #111;
--#{$prefix}baton-changelist-sort-icon-color: #999;
Expand Down
38 changes: 38 additions & 0 deletions baton/static/baton/app/src/styles/_select2.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
.select2-container {
max-width: 100% !important;
min-width: 250px;

.select2-selection {
background: var(--bs-body-bg) !important;
border: var(--bs-border-width) solid var(--bs-border-color) !important;
}

.select2-selection__arrow {
margin-top: 3px;
}
}

[data-bs-theme="dark"] {
.select2-dropdown {
background: var(--bs-body-bg);
color: var(--bs-body-color);
}
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
color: var(--bs-body-color) !important;
margin-top: 2px;
}

.select2-container--admin-autocomplete .select2-search--dropdown .select2-search__field,
.select2-container--default .select2-search--dropdown .select2-search__field {
border: var(--bs-border-width) solid var(--bs-border-color) !important;
outline: 0;
}

.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-results__option select2-results__option--highlighted,
.select2-container--admin-autocomplete .select2-results__option--highlighted[aria-selected] {
background: var(--bs-info) !important;
color: var(--bs-black) !important;
}
2 changes: 2 additions & 0 deletions baton/static/baton/app/src/styles/baton.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ $fa-font-path: '../../node_modules/@fortawesome/fontawesome-free/webfonts';
@import 'analytics';
@import 'admindocs';
@import 'filer';
@import 'rangefilter';
@import 'select2';
2 changes: 1 addition & 1 deletion baton/static/baton/js_snippets/init_baton.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
$(document).ready(function () {
Baton.init(JSON.parse(document.getElementById('baton-config').textContent));
})
})(jQuery, undefined)
})(Baton.jQuery, undefined)
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
# built documents.
#
# The short X.Y version.
version = u'2.8.1'
release = u'2.8.1'
version = u'2.9.0'
release = u'2.9.0'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

setup(
name='django-baton',
version='2.8.1',
version='2.9.0',
packages=['baton', 'baton.autodiscover', 'baton.templatetags'],
include_package_data=True,
license='MIT License',
Expand Down
1 change: 1 addition & 0 deletions testapp/app/app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admindocs',
'django_select2',
'easy_thumbnails',
'admin_auto_filters',
'rangefilter',
Expand Down
1 change: 1 addition & 0 deletions testapp/app/app/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
# path('admin/newschange/<int:id>', news_change_view),
path('admin/', admin.site.urls),
path('baton/', include('baton.urls')),
path("select2/", include("django_select2.urls")),
path('tinymce/', include('tinymce.urls')),
]

Expand Down
Binary file modified testapp/app/db.sqlite3
Binary file not shown.
3 changes: 3 additions & 0 deletions testapp/app/news/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
from baton.admin import InputFilter, MultipleChoiceListFilter
from rangefilter.filter import DateRangeFilter
from admin_auto_filters.filters import AutocompleteFilter

from .forms import ActivityForm
from .models import News, Category, Attachment, Video, Activity
from import_export import resources
from import_export.admin import ImportExportModelAdmin
Expand Down Expand Up @@ -58,6 +60,7 @@ class VideosInline(admin.StackedInline):

class ActivitiesInline(GenericStackedInline):
model = Activity
form = ActivityForm
extra = 1


Expand Down
20 changes: 20 additions & 0 deletions testapp/app/news/forms.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from django import forms
from django_select2 import forms as s2forms

from . import models


class UserWidget(s2forms.ModelSelect2Widget):
search_fields = [
"username__icontains",
"email__icontains",
]


class ActivityForm(forms.ModelForm):
class Meta:
model = models.Activity
fields = "__all__"
widgets = {
"user": UserWidget,
}

0 comments on commit 602424e

Please sign in to comment.