# HG changeset patch # User Thomas De Schampheleire # Date 1526846856 -7200 # Node ID dd9cb0a5aba34122fc14531f69a6dde61fcac09b # Parent 61f8ce5fff25652626d22907b89589815c20848c admin: hooks: restore delete functionality as intended Commit 9d34bea3059d9abd0d912f37a2475ee67c8e2918 ("style: various minor-ish markup changes, preparing for Bootstrap") partially broke the delete functionality of hooks. When clicking the delete button, the hook is deleted via AJAX and then the corresponding form group is intended to be removed visually. This relies on an 'id' attribute on the form-group div. The mentioned commit moved the div with the 'id' attribute outside the loop iterating over the different hooks, so that there no longer is a div with the id expected by the delete button. The hook would still be deleted, but the page visually still looks the same until refresh/Save. Move the diff back into the loop. This causes a little more visual separation between the different hooks, but still looks OK. The layout of the built-in hooks (that can't be removed) is left untouched. Making the same change there would be possible but there the extra vertical whitespace seems somewhat unnecessary, although this is personal. diff -r 61f8ce5fff25 -r dd9cb0a5aba3 kallithea/templates/admin/settings/settings_hooks.html --- a/kallithea/templates/admin/settings/settings_hooks.html Sun May 20 21:50:11 2018 +0200 +++ b/kallithea/templates/admin/settings/settings_hooks.html Sun May 20 22:07:36 2018 +0200 @@ -15,23 +15,23 @@ % if c.visual.allow_custom_hooks_settings: ${h.form(url('admin_settings_hooks'), method='post')}
-

${_('Custom Hooks')}

%for hook in c.custom_hooks: - <% input_id = hook.ui_key.replace('.', '_') %> - -
- ${h.hidden('hook_ui_key',hook.ui_key,id='hook_ui_key_'+input_id)} - ${h.hidden('hook_ui_value',hook.ui_value,id='hook_ui_value_'+input_id)} - ${h.text('hook_ui_value_new',hook.ui_value,id=input_id,size=60,class_='form-control')} - -
+
+ <% input_id = hook.ui_key.replace('.', '_') %> + +
+ ${h.hidden('hook_ui_key',hook.ui_key,id='hook_ui_key_'+input_id)} + ${h.hidden('hook_ui_value',hook.ui_value,id='hook_ui_value_'+input_id)} + ${h.text('hook_ui_value_new',hook.ui_value,id=input_id,size=60,class_='form-control')} + +
+
%endfor -