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