Browse Source

Add missing hooks

Peter Justin 7 years ago
parent
commit
75ee7f8801

+ 3 - 3
flaskbb/plugins/spec.py

@@ -100,8 +100,8 @@ def flaskbb_tpl_after_registration_form():
 
 
 @spec
-def flaskbb_tpl_before_update_user_details():
-    """This event is emitted in the Change User Details form **before** an
+def flaskbb_tpl_before_user_details_form():
+    """This hook is emitted in the Change User Details form **before** an
     input field is rendered.
 
     in :file:`templates/user/change_user_details.html`.
@@ -109,7 +109,7 @@ def flaskbb_tpl_before_update_user_details():
 
 
 @spec
-def flaskbb_tpl_after_update_user_details():
+def flaskbb_tpl_after_user_details_form():
     """This hook is emitted in the Change User Details form **after** the last
     input field has been rendered but before the submit field.
 

+ 2 - 2
flaskbb/templates/auth/register.html

@@ -13,7 +13,7 @@
     <div class="panel-body">
         <form class="form-horizontal" role="form" method="POST">
             {{ form.hidden_tag() }}
-            {{ emit_event('before-registration-form') }}
+            {{ run_hook('flaskbb_tpl_before_registration_form') }}
             {{ horizontal_field(form.username)}}
             {{ horizontal_field(form.email)}}
             {{ horizontal_field(form.password)}}
@@ -26,7 +26,7 @@
             {{ horizontal_field(form.language) }}
             {{ horizontal_field(form.accept_tos)}}
             {{ horizontal_field(form.submit)}}
-            {{ emit_event('after-registration-form') }}
+            {{ run_hook('flaskbb_tpl_after_registration_form') }}
         </form>
     </div>
 </div>

+ 2 - 2
flaskbb/templates/user/change_user_details.html

@@ -10,7 +10,7 @@
     <div class="panel-body page-body">
         <form class="form-horizontal" role="form" method="POST">
             {{ form.hidden_tag() }}
-            {{ emit_event('before-update-user-details') }}
+            {{ run_hook('flaskbb_tpl_before_user_details_form') }}
             {{ horizontal_select_field(form.birthday, select_class="form-control", surrounded_div="col-sm-4") }}
             {{ horizontal_field(form.gender) }}
             {{ horizontal_field(form.location) }}
@@ -18,7 +18,7 @@
             {{ horizontal_field(form.avatar) }}
             {{ horizontal_field(form.signature, div_class="col-sm-8 editor", rows="5", placeholder="", **{'data-provide': 'markdown', 'class': 'flaskbb-editor'}) }}
             {{ horizontal_field(form.notes, div_class="col-sm-8 editor", rows="12", placeholder="", **{'data-provide': 'markdown', 'class': 'flaskbb-editor'}) }}
-            {{ emit_event('after-update-user-details') }}
+            {{ run_hook('flaskbb_tpl_after_user_details_form') }}
             {{ horizontal_field(form.submit) }}
 
             {% include theme('editor_help.html') %}