11{% extends "base.html" %}
22{# Copyright The IETF Trust 2015, All Rights Reserved #}
3- {% load origin %}
3+ {% load origin staticfiles %}
44{% load future %}
55{% load staticfiles %}
66{% load bootstrap3 %}
77
8+ {% block pagehead %}
9+ < link rel ="stylesheet " href ="{% static "jquery.tablesorter /css/theme.bootstrap.min.css" %}">
10+ {% endblock %}
11+
812{% block title %}{{ cl.long_name }}{% endblock %}
913
1014{% block content %}
@@ -34,12 +38,12 @@ <h1>{{ cl.long_name }}</h1>
3438 < li > Search for the document or documents you want to add using the datatracker search form.</ li >
3539 < li > In the search results, you'll find a link to add individual documents to your list.</ li >
3640 </ ul >
37- < a class ="btn btn-default " href ="/doc/search/ "> Document search</ a >
41+ < p > < a class ="btn btn-default " href ="/doc/search/ "> Document search</ a > </ p >
3842
39- < table class ="table table-condensed table-striped ">
43+ < table class ="table table-condensed table-striped tablesorter ">
4044 < thead >
4145 < tr >
42- < th > Name</ th > < th > State</ th > < th > Title</ th > < th > </ th >
46+ < th > Name</ th > < th > State</ th > < th > Title</ th > < th class =" sorter-false " > </ th >
4347 </ tr >
4448 </ thead >
4549 < tbody >
@@ -56,9 +60,9 @@ <h1>{{ cl.long_name }}</h1>
5660 </ div >
5761
5862 < div class ="tab-pane " id ="rules ">
59- < table class ="table table-condensed table-striped ">
63+ < table class ="table table-condensed table-striped tablesorter ">
6064 < thead >
61- < tr > < th > Rule</ th > < th > Value</ th > < th > Documents</ th > < th > </ th > </ tr >
65+ < tr > < th > Rule</ th > < th > Value</ th > < th > Documents</ th > < th class =" sorter-false " > </ th > </ tr >
6266 </ thead >
6367 < tbody >
6468 {% for rule in cl.rule_set.all %}
@@ -111,22 +115,26 @@ <h3>Add a new rule</h3>
111115
112116{% endblock %}
113117
118+ {% block js %}
119+ < script src ="{% static "jquery.tablesorter /js/jquery.tablesorter.combined.min.js" %}"> </ script >
120+
114121{% comment %}
115- XXX scrolling jumps around when using this, unfortunately
122+ Stay on the current tab after form submission.
123+ If other pages need this functionality, it should move to ietf.js.
124+ {% endcomment %}
116125< script >
117- $ ( '.nav-memory a' ) . click ( function ( e ) {
118- e . preventDefault ( ) ;
119- $ ( this ) . tab ( 'show' ) ;
120- } ) ;
121-
122- // store the currently selected tab in the hash value
123- $ ( "ul.nav-tabs > li > a" ) . on ( "shown.bs.tab" , function ( e ) {
124- var id = $ ( e . target ) . attr ( "href" ) . substr ( 1 ) ;
125- window . location . hash = id ;
126+ $ ( function ( ) {
127+ $ ( 'a[data-toggle="tab"]' ) . on ( "click" , function ( e ) {
128+ // save the current tab
129+ localStorage . setItem ( "currentTab" , $ ( e . target ) . attr ( "href" ) ) ;
130+ } ) ;
131+
132+ // go to "currentTab", if it exists
133+ var currentTab = localStorage . getItem ( "currentTab" ) ;
134+ if ( currentTab ) {
135+ $ ( 'a[href="' + currentTab + '"]' ) . click ( ) ;
136+ }
126137} ) ;
127-
128- // on load of the page: switch to the currently selected tab
129- var hash = window . location . hash ;
130- $ ( '.nav-memory a[href="' + hash + '"]' ) . tab ( 'show' ) ;
131138</ script >
132- {% endcomment %}
139+
140+ {% endblock %}
0 commit comments