forked from edgewall/trac
-
Notifications
You must be signed in to change notification settings - Fork 1
/
jadmin_plugins.html
238 lines (226 loc) · 9.33 KB
/
jadmin_plugins.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
{# Copyright (C) 2006-2014 Edgewall Software
This software is licensed as described in the file COPYING, which
you should have received as part of this distribution. The terms
are also available at http://trac.edgewall.com/license.html.
This software consists of voluntary contributions made by many
individuals. For the exact contribution history, see the revision
history and logs, available at http://trac.edgewall.org/.
#}
# extends "jadmin.html"
<!DOCTYPE html>
<html>
<head>
<title>
# block admintitle
${_("Plugins")}
# endblock admintitle
</title>
<script type="text/javascript" src="${chrome.htdocs_location}js/folding.js"></script>
<script type="text/javascript">/*<![CDATA[*/
jQuery(document).ready(function($) {
// Sets state of group toggler when component checkboxes are clicked
function setGroupTogglerState() {
var table = $(this).closest("table.listing");
var checkboxes = $("td.sel input:checkbox:enabled", table);
var num_selected = checkboxes.filter(":checked").length;
var none_selected = num_selected === 0;
var all_selected = num_selected === checkboxes.length;
$("th.sel input:checkbox", table)
.prop({"checked": all_selected,
"indeterminate": !(none_selected || all_selected)});
}
// Add group event behavior for controlling state of toggler
$("table.listing td.sel input:checkbox:enabled")
.click(setGroupTogglerState);
// Add click behavior for the group toggler and initialize its state
$("table.listing th.sel").wrapInner('<label></label>').children()
.each(function() {
$('<input type="checkbox"/>').click(function() {
$("td.sel input:checkbox:enabled",
$(this).closest("table.listing")).prop("checked", this.checked);
}).prependTo(this).each(setGroupTogglerState);
});
$("h3.foldable").enableFolding(true, true);
$("p.foldable").enableFolding(true, false);
$("thead .trac-toggler a").each(function() {
$(this).attr("href", "").click(function() {
var td = $(this).closest("table").find("tbody td");
var a = td.find(".trac-toggler a");
if ($(this).text() == "+") {
td.removeClass("collapsed");
a.text("–");
} else {
td.addClass("collapsed");
a.text("+");
}
return false;
});
});
});
/*]]>*/</script>
</head>
<body>
# block adminpanel
<h2>
# set nb_plugins
<span class="trac-count">(${len(plugins)})</span>
# endset
# trans nb_plugins = nb_plugins
Manage Plugins ${nb_plugins}
# endtrans
</h2>
<form id="addplug" class="addnew" method="post" enctype="multipart/form-data" action="">
${jmacros.form_token_input()}
<fieldset>
<legend>${_("Install Plugin:")}</legend>
<div class="field">
<label>
${_("File:")} <input type="file" name="plugin_file" class="trac-disable-determinant"
${{'disabled': readonly}|htmlattr} />
</label>
</div>
<div class="buttons">
<input type="submit" name="install" class="trac-disable trac-disable-on-submit"
value="${_('Install')}"${{'disabled': readonly}|htmlattr} />
</div>
<p class="help">
# if readonly:
# trans
The web server does not have sufficient permissions to
store files in the environment plugins directory.
# endtrans
# else:
# trans
Upload a plugin packaged as Python egg.
# endtrans
# endif
</p>
</fieldset>
</form>
# for plugin in plugins:
<form id="edit-plugin-${plugin.name.lower()}" method="post" action="">
${jmacros.form_token_input()}
<div class="plugin" id="trac-plugin-${plugin.name}">
<h3 class="foldable">${plugin.name} ${plugin.version}</h3>
<!--! FIXME: Plugin uninstall disabled as it is unreliable (#3545)
<div class="uninstall buttons">
<input type="hidden" name="plugin_filename"
value="${plugin.plugin_filename}" />
<input type="submit" name="uninstall" value="${_('Uninstall')}"
${{'disabled': readonly}|htmlattr} />
</div> -->
# if plugin.info:
<p class="summary">${plugin.info.get('summary')}</p>
# if 'home_page' in plugin.info or 'author' in plugin.info or 'author_email' in plugin.info:
<dl class="info">
# if 'author' in plugin.info or 'author_email' in plugin.info:
<dt>${_("Author:")}</dt>
<dd>
# if plugin.info.get('author_email'):
<a href="mailto:${plugin.info.author_email}">
${plugin.info.author or plugin.info.author_email}
</a>
# else:
${plugin.info.author or plugin.info.author_email}
# endif
</dd>
# endif
# if plugin.info.get('home_page'):
<dt>${_("Home page:")}</dt>
<dd>
<a onclick="window.open(this.href); return false"
href="${plugin.info.home_page}">${plugin.info.home_page}</a>
</dd>
# endif
# if plugin.info.get('license'):
<dt>${_("License:")}</dt>
<dd>${plugin.info.license}</dd>
# endif
</dl>
# endif
# endif
<table class="listing">
<thead>
<tr>
<th>
${_("Component")}
<span class="trac-toggler">
[<a title="Show all descriptions" href="${href.admin('general', 'plugin', show=plugin.name)
+ '#trac-plugin-' + plugin.name}">+</a>]
[<a title="Hide all descriptions" href="${href.admin('general', 'plugin')
+ '#trac-plugin-' + plugin.name}">–</a>]
</span>
</th>
<th class="sel">${_("Enabled")}</th>
</tr>
</thead>
# for module_name, module in plugin.modules|dictsort:
<tbody>
<tr>
# set show_doc = show == plugin.name or show == module_name
<td id="trac-mod-${module_name}"
class="trac-module${' collapsed' if not show_doc and module.description}">
<p class="trac-heading${' foldable' if module.description}">
# if module.description:
<a class="trac-name"
href="${href.admin('general', 'plugin', show=module_name if not show_doc else none)
+ '#trac-mod-' + module_name}">${module_name}.*</a>
# else:
<span class="trac-name">${module_name}.*</span>
# endif
# if module.summary:
<span class="trac-summary"> — ${module.summary}</span>
# endif
</p>
# if module.description:
<div>${safe_wiki_to_html(context, module.description)}</div>
# endif
</td>
<td class="sel trac-module"></td>
</tr>
# for component_name, component in module.components|dictsort:
<tr>
# set show_doc = show == plugin.name or show == component.full_name
<td id="trac-comp-${component.full_name}"
class="trac-component${' collapsed' if not show_doc}">
<p class="trac-heading${' foldable' if component.description}">
# if component.description:
<a class="trac-name"
href="${href.admin('general', 'plugin', show=component.full_name if not show_doc else none)
+ '#trac-comp-' + component.full_name}">${component_name}</a>
# else:
<span class="trac-name">${component_name}</span>
# endif
# if component.summary:
<span class="trac-summary"> — ${component.summary}</span>
# endif
</p>
# if component.description:
<div>${safe_wiki_to_html(context, component.description)}</div>
# endif
</td>
<td class="sel trac-component">
# if not component.required:
<input type="hidden" name="component"
value="${module_name}.${component_name}" />
# endif
<input type="checkbox" name="enable"
value="${module_name}.${component_name}"
${{'checked': component.enabled,
'disabled': component.required}|htmlattr} />
</td>
</tr>
# endfor
</tbody>
# endfor
</table>
<div class="buttons">
<input type="hidden" name="plugin" value="${loop.index0}" />
<input type="submit" name="update" value="${_('Apply changes')}" />
</div>
</div>
</form>
# endfor
# endblock adminpanel
</body>
</html>