Files
@ 631e8000eae8
Branch filter:
Location: kallithea/rhodecode/templates/admin/settings/hooks.html - annotation
631e8000eae8
3.0 KiB
text/html
diff parser: match the header order of hg diff --git patches
The output might look like:
diff --git a/A b/B
old mode 100644
new mode 100755
rename from A
rename to B
--- a/A
+++ b/B
Such files were shown as 'modified binary file chmod 100644 => 100755' without
diff.
Now the chmod and diff will be shown ... but still not the rename.
Correct parsing of headers do require a better parser - one do not just use a
regexp.
The output might look like:
diff --git a/A b/B
old mode 100644
new mode 100755
rename from A
rename to B
--- a/A
+++ b/B
Such files were shown as 'modified binary file chmod 100644 => 100755' without
diff.
Now the chmod and diff will be shown ... but still not the rename.
Correct parsing of headers do require a better parser - one do not just use a
regexp.
b50348816a80 b50348816a80 b50348816a80 b50348816a80 1f334a68d057 b50348816a80 b50348816a80 b50348816a80 b50348816a80 b50348816a80 b50348816a80 b50348816a80 b4f401524060 b50348816a80 b50348816a80 b50348816a80 b50348816a80 b50348816a80 b50348816a80 f91d3f9b7230 b50348816a80 b50348816a80 f91d3f9b7230 b50348816a80 b50348816a80 b50348816a80 b50348816a80 c20adbaf16af c20adbaf16af c20adbaf16af c20adbaf16af c20adbaf16af c20adbaf16af c20adbaf16af b4f401524060 b50348816a80 b4f401524060 b50348816a80 f91d3f9b7230 b50348816a80 b50348816a80 b50348816a80 b50348816a80 f91d3f9b7230 b50348816a80 b50348816a80 b50348816a80 b50348816a80 b50348816a80 f91d3f9b7230 b50348816a80 b50348816a80 b50348816a80 f91d3f9b7230 b50348816a80 b50348816a80 b50348816a80 b50348816a80 b50348816a80 f91d3f9b7230 f91d3f9b7230 b50348816a80 b50348816a80 b50348816a80 b50348816a80 b50348816a80 b50348816a80 b50348816a80 b50348816a80 b50348816a80 b50348816a80 b50348816a80 7ae36df760ce f91d3f9b7230 b50348816a80 b50348816a80 b50348816a80 b50348816a80 b50348816a80 b50348816a80 b50348816a80 b50348816a80 b50348816a80 b50348816a80 b50348816a80 b50348816a80 b50348816a80 b50348816a80 b50348816a80 b50348816a80 b50348816a80 b50348816a80 b50348816a80 b50348816a80 f91d3f9b7230 f91d3f9b7230 | ## -*- coding: utf-8 -*-
<%inherit file="/base/base.html"/>
<%def name="title()">
${_('Settings administration')} · ${c.rhodecode_name}
</%def>
<%def name="breadcrumbs_links()">
${h.link_to(_('Admin'),h.url('admin_home'))} » ${_('Settings')}
</%def>
<%def name="page_nav()">
${self.menu('admin')}
</%def>
<%def name="main()">
<div class="box">
<!-- box / title -->
<div class="title">
${self.breadcrumbs()}
</div>
<!-- end box / title -->
<h3>${_('Built in hooks - read only')}</h3>
<div class="form">
<div class="fields">
% for hook in c.hooks:
<div class="field">
<div class="label label">
<label for="${hook.ui_key}">${hook.ui_key}</label>
</div>
<div class="input" style="margin-left:280px">
${h.text(hook.ui_key,hook.ui_value,size=60,readonly="readonly")}
</div>
</div>
% endfor
</div>
</div>
<h3>${_('Custom hooks')}</h3>
${h.form(url('admin_setting', setting_id='hooks'),method='put')}
<div class="form">
<div class="fields">
% for hook in c.custom_hooks:
<div class="field" id="${'id%s' % hook.ui_id }">
<div class="label label">
<label for="${hook.ui_key}">${hook.ui_key}</label>
</div>
<div class="input" style="margin-left:280px">
${h.hidden('hook_ui_key',hook.ui_key)}
${h.hidden('hook_ui_value',hook.ui_value)}
${h.text('hook_ui_value_new',hook.ui_value,size=60)}
<span class="delete_icon action_button"
onclick="ajaxActionHook(${hook.ui_id},'${'id%s' % hook.ui_id }')">
${_('remove')}
</span>
</div>
</div>
% endfor
<div class="field">
<div class="input" style="margin-left:-180px;position: absolute;">
<div class="input">
${h.text('new_hook_ui_key',size=30)}
</div>
</div>
<div class="input" style="margin-left:280px">
${h.text('new_hook_ui_value',size=60)}
</div>
</div>
<div class="buttons" style="margin-left:280px">
${h.submit('save',_('Save'),class_="ui-btn large")}
</div>
</div>
</div>
${h.end_form()}
</div>
<script type="text/javascript">
function ajaxActionHook(hook_id,field_id) {
var sUrl = "${h.url('admin_setting', setting_id='hooks')}";
var callback = {
success: function (o) {
var elem = YUD.get(""+field_id);
elem.parentNode.removeChild(elem);
},
failure: function (o) {
alert("${_('Failed to remove hook')}");
},
};
var postData = '_method=delete&hook_id=' + hook_id;
var request = YAHOO.util.Connect.asyncRequest('POST', sUrl, callback, postData);
};
</script>
</%def>
|