Mercurial > kallithea
annotate rhodecode/templates/admin/settings/hooks.html @ 1460:b50348816a80 beta
Added more advanced hook management into rhodecode admin settings
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Fri, 09 Sep 2011 20:30:14 +0300 |
parents | |
children | aaec08ad9daf |
rev | line source |
---|---|
1460
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
1 ## -*- coding: utf-8 -*- |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
2 <%inherit file="/base/base.html"/> |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
3 |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
4 <%def name="title()"> |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
5 ${_('Settings administration')} - ${c.rhodecode_name} |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
6 </%def> |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
7 |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
8 <%def name="breadcrumbs_links()"> |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
9 ${h.link_to(_('Admin'),h.url('admin_home'))} » ${_('Settings')} |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
10 </%def> |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
11 |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
12 <%def name="page_nav()"> |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
13 ${self.menu('admin')} |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
14 </%def> |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
15 |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
16 <%def name="main()"> |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
17 <div class="box"> |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
18 <!-- box / title --> |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
19 <div class="title"> |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
20 ${self.breadcrumbs()} |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
21 </div> |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
22 <!-- end box / title --> |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
23 |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
24 <h3>${_('Built in hooks - read only')}</h3> |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
25 <div class="form"> |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
26 <div class="fields"> |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
27 % for hook in c.hooks: |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
28 <div class="field"> |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
29 <div class="label label"> |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
30 <label for="${hook.ui_key}">${hook.ui_key}</label> |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
31 </div> |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
32 <div class="input" style="margin-left:280px"> |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
33 ${h.text(hook.ui_key,hook.ui_value,size=60,readonly="readonly")} |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
34 </div> |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
35 </div> |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
36 % endfor |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
37 </div> |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
38 </div> |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
39 |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
40 <h3>${_('Custom hooks')}</h3> |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
41 ${h.form(url('admin_setting', setting_id='hooks'),method='put')} |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
42 <div class="form"> |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
43 <div class="fields"> |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
44 |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
45 % for hook in c.custom_hooks: |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
46 <div class="field" id="${'id%s' % hook.ui_id }"> |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
47 <div class="label label"> |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
48 <label for="${hook.ui_key}">${hook.ui_key}</label> |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
49 </div> |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
50 <div class="input" style="margin-left:280px"> |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
51 ${h.hidden('hook_ui_key',hook.ui_key)} |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
52 ${h.hidden('hook_ui_value',hook.ui_value)} |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
53 ${h.text('hook_ui_value_new',hook.ui_value,size=60)} |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
54 <span class="delete_icon action_button" |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
55 onclick="ajaxActionHook(${hook.ui_id},'${'id%s' % hook.ui_id }')"> |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
56 ${_('remove')} |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
57 </span> |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
58 </div> |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
59 </div> |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
60 % endfor |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
61 |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
62 <div class="field"> |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
63 <div class="input" style="margin-left:-180px;position: absolute;"> |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
64 <div class="input"> |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
65 ${h.text('new_hook_ui_key',size=30)} |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
66 </div> |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
67 </div> |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
68 <div class="input" style="margin-left:280px"> |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
69 ${h.text('new_hook_ui_value',size=60)} |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
70 </div> |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
71 </div> |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
72 <div class="buttons" style="margin-left:280px"> |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
73 ${h.submit('save','Save',class_="ui-button")} |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
74 </div> |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
75 </div> |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
76 </div> |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
77 ${h.end_form()} |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
78 </div> |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
79 <script type="text/javascript"> |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
80 function ajaxActionHook(hook_id,field_id) { |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
81 var sUrl = "${h.url('admin_setting', setting_id='hooks')}"; |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
82 var callback = { |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
83 success: function (o) { |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
84 var elem = YUD.get(""+field_id); |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
85 elem.parentNode.removeChild(elem); |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
86 }, |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
87 failure: function (o) { |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
88 alert("${_('Failed to remove hook')}"); |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
89 }, |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
90 }; |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
91 var postData = '_method=delete&hook_id=' + hook_id; |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
92 var request = YAHOO.util.Connect.asyncRequest('POST', sUrl, callback, postData); |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
93 }; |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
94 </script> |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
95 |
b50348816a80
Added more advanced hook management into rhodecode admin settings
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
96 </%def> |