1 {% extends
"base.html" %}
3 {% load maintain_extras %}
7 <link rel=
"stylesheet" type=
"text/css" href=
"../static/css/plugins.css" />
8 <script type=
"text/javascript">
9 var $errors
= undefined;
10 $(document
).ready(function() {
11 $('#plugins li.disabled input').live('click', function(){
12 $(this).attr('checked',false);
14 $errors
.empty().hide();
15 $('#enable h2 .plugin').html(this.parentNode
.id
);
16 $('#enable .description').html(this.parentNode
.title
);
17 $.getJSON('{{ROOT}}/plugin/depends', {'name':this.parentNode
.id
}, process_depends
);
20 $('#plugins li.enabled input').live('click', function(){
21 $(this).attr('checked',true);
23 $('#disable h2 .plugin').html(this.parentNode
.id
);
24 $('#disable .description').html(this.parentNode
.title
);
25 $errors
.empty().hide();
26 $.getJSON('{{ROOT}}/plugin/dependeds', {'name':this.parentNode
.id
}, process_dependeds
);
29 $('#enable button').click(function(){
31 name
= $('#enable h2 .plugin').html();
32 $.getJSON('{{ROOT}}/plugin/enable', {'name':name
}, process_enabled
);
37 $('#disable button').click(function(){
39 name
= $('#disable h2 .plugin').html();
40 $.getJSON('{{ROOT}}/plugin/disable', {'name':name
}, process_disabled
);
45 $('#disable .button_close, #enable .button_close').click(function(){
46 $('#enable, #disable').hide();
49 $('html').keypress(function(e
){
51 $('#enable, #disable').hide();
55 $errors
= $('#errors');
59 function process_depends(data
){
61 processes a list of depends for a plugin prior to displaying
64 if (data
.length
== 2 && data
[0] == -1) {
66 $errors
.append(data
[1]).show();
69 if (data
.length
== 0) {
70 $('#enable .messages').hide();
72 $('#enable .messages').show();
73 $list
= $('#enable .messages ul')
77 $list
.append('<li>'+plugin
['name']+'</li>')
80 $('#enable').show().find('button').focus();
83 function process_enabled(data
){
85 processes a response from attempting to enable a plugin. This
86 will either update the interface on a success or display a list
89 if (data
.length
== 2 && data
[0] == -1){
92 $errors
.append("<li>"+errors
[i
]+"</li>");
99 .removeClass('disabled')
101 .children('input').attr('checked',true);
106 function process_dependeds(data
){
108 processes a list of dependeds for a plugin prior to displaying
111 if (data
.length
== 0) {
112 $('#disable .messages').hide();
114 $('#disable .messages').show();
115 $list
= $('#disable .messages ul')
119 $list
.append('<li>'+plugin
['name']+'</li>')
122 $('#disable').show().find('button').focus();
125 function process_disabled(data
){
127 processes a response from attempting to disable a plugin.
133 .removeClass('enabled')
134 .addClass('disabled')
135 .children('input').attr('checked',false);
141 {% include
"../static/js/config_lock.js" %}
147 <ul id=
"errors"></ul>
150 {% for plugin in plugins %}
151 {% with plugin|config as config %}
152 <li id=
"{{config.name}}" title=
"{{plugin.description}}" class=
"{%if config.enabled%}enabled{%else%}disabled{%endif%}">
154 <input type=
"checkbox"
155 {%if config.enabled%}checked{%endif%}
156 {%if plugin.core %}disabled{%endif%}
158 {% if plugin.config_form %}
159 <a class=
"button_config button" href=
"{{ROOT}}/plugin/{{config.name}}/"></a>
166 <div id=
"enable" class=
"form">
168 <div class=
"button_close button"></div>
169 <h2><span class=
"label">Enable:
</span> <span class=
"plugin"></span></h2>
170 <div class=
"description"></div>
171 <div class=
"messages">
172 The following dependencies will also be enabled:
175 <button class=
"button_enable">Enable
</button>
179 <div id=
"disable" class=
"form">
181 <div class=
"button_close button"></div>
182 <h2><span class=
"label">Disable:
</span> <span class=
"plugin"></span></h2>
183 <div class=
"description"></div>
184 <div class=
"messages">
185 The following plugins depend on this plugin:
188 <button class=
"button_disable">Disable
</button>