File tree Expand file tree Collapse file tree
openwisp_utils/admin_theme Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -216,7 +216,7 @@ def get_dashboard_context(request):
216216 if 'js' in template_config [0 ]:
217217 js += list (template_config [0 ]['js' ])
218218 if template_config [1 ]:
219- extra_config = template_config [1 ]
219+ extra_config . update ( template_config [1 ])
220220
221221 context .update (
222222 {
Original file line number Diff line number Diff line change @@ -98,7 +98,14 @@ def register_dashboard_charts(self):
9898 'css' : ('dashboard-test.css' ,),
9999 'js' : ('dashboard-test.js' ,),
100100 },
101- extra_config = {'test_extra_config' : 'dashboard-test.config' },
101+ extra_config = {'test_extra_config1' : 'dashboard-test.config1' },
102+ )
103+ register_dashboard_template (
104+ position = 1 ,
105+ config = {
106+ 'template' : 'dashboard_test.html' ,
107+ },
108+ extra_config = {'test_extra_config2' : 'dashboard-test.config2' },
102109 )
103110
104111 def register_menu_groups (self ):
Original file line number Diff line number Diff line change 11< div style ="display:none "> Testing dashboard</ div >
2- {% if test_extra_config %}
3- < div style ="display:none "> {{ test_extra_config }}</ div >
2+ {% if test_extra_config1 %}
3+ < div style ="display:none "> {{ test_extra_config1 }}</ div >
4+ {% endif %}
5+ {% if test_extra_config2 %}
6+ < div style ="display:none "> {{ test_extra_config2 }}</ div >
47{% endif %}
Original file line number Diff line number Diff line change @@ -139,7 +139,8 @@ def test_index_content(self):
139139 )
140140 self .assertContains (response , 'dashboard-test.js' )
141141 self .assertContains (response , 'dashboard-test.css' )
142- self .assertContains (response , 'dashboard-test.config' )
142+ self .assertContains (response , 'dashboard-test.config1' )
143+ self .assertContains (response , 'dashboard-test.config2' )
143144 self .assertContains (response , 'jquery.init.js' )
144145 self .assertContains (response , 'Operator presence in projects' )
145146 self .assertContains (response , 'with_operator' )
You can’t perform that action at this time.
0 commit comments