1 {% extends
"base.html" %}
4 <link rel=
"stylesheet" type=
"text/css" href=
"../static/css/config.css" />
6 <script type=
"text/javascript" src=
"http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
7 <script type=
"text/javascript">
9 var $errors
= undefined;
10 var $cur_form
= undefined;
13 $(document
).ready(function() {
14 $errors
= $('#errors');
15 $('#tab_content :first').each(function(){
16 switch_tab(this.id
.slice(5));
19 $('input.save').live('click', function(){
21 $form
= $(this.parentNode
.parentNode
.parentNode
);
22 $inputs
= $form
.find('input,select');
24 for (i
=0; i
<$inputs
.length
; i
++) {
25 input
= $inputs
.get(i
);
26 args
[input
.name
]= $(input
).val();
30 $errors
.hide().empty();
31 $.post('save', args
, process_save
, 'json');
34 $('input, select').live('keypress',function(e
){
36 $form
= $(this.parentNode
.parentNode
.parentNode
);
37 $form
.find('input.save').trigger('click');
41 $('#tabs .tab').click(function() {
42 switch_tab(this.id
.slice(4));
48 function switch_tab(name
){
50 $('#tabs .active').removeClass('active');
51 $('#tab_' + name
).addClass('active');
53 // switch form pane content
54 $node
= $('#form_'+name
);
55 if ($cur_form
!= undefined){
56 $cur_form
.remove().appendTo("#tab_content");
59 $node
.remove().appendTo("#current_tab");
62 function process_save(data
) {
64 $('#success').show().delay(1500).fadeOut(1500);
69 $errors
.append('<li>'+ error
[0] +' - '+ error
[1] +'</li>');
75 {% include
"../static/js/config_lock.js" %}
80 <div id=
"success">Saved
</div>
84 <h1>Configuration:
<span class=
"highlight">{{name}}
</span></h1>
90 <div id=
"current_tab"></div>
91 <div id=
"tab_content">
92 {% block tab_content %}
93 {% include
"config_form.html" %}