File tree Expand file tree Collapse file tree 3 files changed +20
-2
lines changed Expand file tree Collapse file tree 3 files changed +20
-2
lines changed Original file line number Diff line number Diff line change 52
52
color : var (--admin-interface-generic-link-active-color );
53
53
}
54
54
55
+ .admin-interface .tabbed-changeform-tabs .tabbed-changeform-tablink .error {
56
+ color : var (--error-fg ) !important ;
57
+ }
58
+
55
59
.admin-interface .tabbed-changeform-tabs-remaining-space {
56
60
flex : 1 ;
57
61
border-bottom : 1px solid var (--border-color );
Original file line number Diff line number Diff line change 4
4
5
5
scope . tabbedChangeForm = {
6
6
7
+ hightlightTabsWithErrors : function ( ) {
8
+ document . querySelectorAll ( ".errorlist" ) . forEach ( ( el ) => {
9
+ const tabContent = el . closest ( ".tabbed-changeform-tabcontent" ) ;
10
+ if ( tabContent ) {
11
+ const tabName = tabContent . id . replace ( "tabcontent-" , "" ) ;
12
+ const tabEl = document . getElementById ( "tablink-" + tabName ) ;
13
+ if ( tabEl ) {
14
+ tabEl . classList . add ( "error" ) ;
15
+ }
16
+ }
17
+ } ) ;
18
+ } ,
19
+
7
20
openTab : function ( event , tabName ) {
8
21
this . openTabByName ( tabName ) ;
9
22
} ,
67
80
68
81
// scope.tabbedChangeForm.openTabByLocationHash();
69
82
document . addEventListener ( 'DOMContentLoaded' , function ( ) {
83
+ scope . tabbedChangeForm . hightlightTabsWithErrors ( ) ;
70
84
scope . tabbedChangeForm . openTabByLocationHash ( ) ;
71
85
} , false ) ;
72
86
Original file line number Diff line number Diff line change 5
5
6
6
{% get_admin_interface_setting "show_fieldsets_as_tabs" as show_fieldsets_as_tabs %}
7
7
{% get_admin_interface_setting "show_inlines_as_tabs" as show_inlines_as_tabs %}
8
- {% admin_interface_use_changeform_tabs adminform inline_admin_formsets as admin_interface_use_changeform_tabs %}
8
+ {% admin_interface_use_changeform_tabs adminform inline_admin_formsets as use_changeform_tabs %}
9
9
10
- {% if not admin_interface_use_changeform_tabs %}
10
+ {% if not use_changeform_tabs %}
11
11
12
12
{{ block.super }}
13
13
You can’t perform that action at this time.
0 commit comments