1818 <!-- AdminLTE Skins. Choose a skin from the css/skins
1919 folder instead of downloading all of them to reduce the load. -->
2020 < link rel ="stylesheet " href ={% static "admin/dist/css/skins/_all-skins.min.css" %}>
21- <!-- iCheck -->
22- < link rel ="stylesheet " href ={% static "admin/plugins/iCheck/flat/blue.css" %}>
23- <!-- Morris chart -->
24- < link rel ="stylesheet " href ={% static "admin/plugins/morris/morris.css" %}>
25- <!-- jvectormap -->
26- < link rel ="stylesheet " href ={% static "admin/plugins/jvectormap/jquery-jvectormap-1.2.2.css" %}>
27- <!-- Date Picker -->
28- < link rel ="stylesheet " href ={% static "admin/plugins/datepicker/datepicker3.css" %}>
29- <!-- Daterange picker -->
30- < link rel ="stylesheet " href ={% static "admin/plugins/daterangepicker/daterangepicker.css" %}>
31- <!-- bootstrap wysihtml5 - text editor -->
32- < link rel ="stylesheet " href ={% static "admin/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css" %}>
3321
22+ {% block custom_style %} {% endblock %}
3423 <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
3524 <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
3625 <!--[if lt IE 9]>
3726 <script src="//oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
3827 <script src="//oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
3928 <![endif]-->
29+
30+ {% block extrahead %} {% endblock %}
4031</ head >
41- < body class ="hold-transition skin-blue sidebar-mini ">
32+ < body class ="hold-transition skin-blue sidebar-mini fixed ">
4233< div class ="wrapper ">
4334
4435 < header class ="main-header ">
337328 <!-- /.search form -->
338329 <!-- sidebar menu: : style can be found in sidebar.less -->
339330 < ul class ="sidebar-menu ">
340- < li class ="header "> 页面导航 </ li >
341- < li class =" active " >
331+ < li class ="header "> {% trans 'MAIN NAVIGATION' %} </ li >
332+ < li >
342333 < a href ="/admin/ ">
343334 < i class ="fa fa-dashboard "> </ i > < span > {% trans 'Dashboard' %}</ span >
344335 </ a >
347338 {% if app_list %}
348339 {% for app in app_list %}
349340 < li class ="treeview ">
350- < a href ="# ">
341+ < a href ="javascript:void(0) ">
351342 < i class ="fa fa-database "> </ i >
352343 < span style ="overflow: hidden; display: inline-block; vertical-align:top; "> {{ app.name }}</ span >
353344 < span class ="pull-right-container ">
@@ -366,17 +357,17 @@ <h3>
366357 {% endif %}
367358 <!--{% if request.user.is_superuser %}-->
368359 <!--<li class="treeview">-->
369- <!--<a href="#">-->
370- <!--<i class="fa fa-cog"></i>-->
371- <!--<span>{% trans 'System manage' %}</span>-->
372- <!--<span class="pull-right-container">-->
373- <!--<i class="fa fa-angle-left pull-right"></i>-->
374- <!--</span>-->
375- <!--</a>-->
376- <!--<ul class="treeview-menu">-->
377- <!--<li><a href="" ><i class="fa fa-file-text-o"></i>{% trans 'Log manage' %}</a></li>-->
378- <!--<li><a href="/admin/config/system/" ><i class="fa fa-wrench"></i>{% trans 'System config' %}</a></li>-->
379- <!--</ul>-->
360+ <!--<a href="#">-->
361+ <!--<i class="fa fa-cog"></i>-->
362+ <!--<span>{% trans 'System manage' %}</span>-->
363+ <!--<span class="pull-right-container">-->
364+ <!--<i class="fa fa-angle-left pull-right"></i>-->
365+ <!--</span>-->
366+ <!--</a>-->
367+ <!--<ul class="treeview-menu">-->
368+ <!--<li><a href="" ><i class="fa fa-file-text-o"></i>{% trans 'Log manage' %}</a></li>-->
369+ <!--<li><a href="/admin/config/system/" ><i class="fa fa-wrench"></i>{% trans 'System config' %}</a></li>-->
370+ <!--</ul>-->
380371 <!--</li>-->
381372 <!--{% endif %}-->
382373
390381 </ aside >
391382
392383 <!-- Content Wrapper. Contains page content -->
393- < div class ="content-wrapper " style =" background-color: white " >
384+ < div class ="content-wrapper ">
394385 <!-- Content Header (Page header) -->
395386 {% block page_content %}
396387 {% endblock %}
@@ -607,39 +598,41 @@ <h3 class="control-sidebar-heading">Chat Settings</h3>
607598</ script >
608599<!-- Bootstrap 3.3.6 -->
609600< script src ={% static "admin/bootstrap/js/bootstrap.min.js" %}> </ script >
610- <!-- Morris.js charts -->
611- < script src ="//cdn.bootcss.com/raphael/2.1.0/raphael-min.js "> </ script >
612- < script src ={% static "admin/plugins/morris/morris.min.js" %}> </ script >
613- <!-- Sparkline -->
614- < script src ={% static "admin/plugins/sparkline/jquery.sparkline.min.js" %}> </ script >
615- <!-- jvectormap -->
616- < script src ={% static "admin/plugins/jvectormap/jquery-jvectormap-1.2.2.min.js" %}> </ script >
617- < script src ={% static "admin/plugins/jvectormap/jquery-jvectormap-world-mill-en.js" %}> </ script >
618- <!-- jQuery Knob Chart -->
619- < script src ={% static "admin/plugins/knob/jquery.knob.js" %}> </ script >
620- <!-- daterangepicker -->
621- < script src ="//cdn.bootcss.com/moment.js/2.11.2/moment.min.js "> </ script >
622- < script src ={% static "admin/plugins/daterangepicker/daterangepicker.js" %}> </ script >
623- <!-- datepicker -->
624- < script src ={% static "admin/plugins/datepicker/bootstrap-datepicker.js" %}> </ script >
625- <!-- Bootstrap WYSIHTML5 -->
626- < script src ={% static "admin/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js" %}> </ script >
627601<!-- Slimscroll -->
628602< script src ={% static "admin/plugins/slimScroll/jquery.slimscroll.min.js" %}> </ script >
629603<!-- FastClick -->
630604< script src ={% static "admin/plugins/fastclick/fastclick.js" %}> </ script >
631605<!-- AdminLTE App -->
632606< script src ={% static "admin/dist/js/app.min.js" %}> </ script >
633- <!-- AdminLTE dashboard demo (This is only for demo purposes) -->
634- < script src ={% static "admin/dist/js/pages/dashboard.js" %}> </ script >
635607<!-- AdminLTE for demo purposes -->
636608< script src ={% static "admin/dist/js/demo.js" %}> </ script >
637609< script >
638- // 用来控制iframe自适应行高
639- $ ( "#page_content" ) . load ( function ( ) {
640- var mainheight = $ ( this ) . contents ( ) . find ( "body" ) . height ( ) + 20 ;
641- $ ( this ) . height ( mainheight ) ;
642- } ) ;
610+ // use js control active status of siderbar-menu
611+ $ ( function ( ) {
612+ var menuActions = document . querySelectorAll ( '.sidebar-menu a' )
613+ for ( var i in menuActions ) {
614+ try {
615+ if ( window . location . pathname === '/admin/' ) {
616+ menuActions [ i ] . parentNode . setAttribute ( 'class' , 'active' )
617+ break
618+ }
619+
620+ if ( window . location . href . indexOf ( menuActions [ i ] . href ) !== - 1 ) {
621+ if ( menuActions [ i ] . href === window . location . origin + '/admin/' ) {
622+ continue
623+ }
624+
625+ console . log ( 'menu matched.' , window . location . href , menuActions [ i ] . href ) ;
626+ menuActions [ i ] . parentNode . setAttribute ( 'class' , 'active' ) ;
627+ menuActions [ i ] . parentNode . parentNode . setAttribute ( 'class' , 'treeview-menu menu-open' ) ;
628+ menuActions [ i ] . parentNode . parentNode . parentNode . setAttribute ( 'class' , 'treeview active' ) ;
629+ // break
630+ }
631+ } catch ( e ) {
632+ console . log ( window . location . href , menuActions [ i ] . href , e )
633+ }
634+ }
635+ } )
643636</ script >
644637
645638{% block custom_js %}{% endblock %}
0 commit comments