This is an automated email from the ASF dual-hosted git repository.

kentontaylor pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/allura.git


The following commit(s) were added to refs/heads/master by this push:
     new 57d1aca95 [#9485] Disable OAuth2 authorize button and change its text 
value on click
57d1aca95 is described below

commit 57d1aca95957864eaa05f0dcc51831da6533d164
Author: Carlos Cruz <carlos.c...@slashdotmedia.com>
AuthorDate: Fri Jul 5 15:58:21 2024 +0000

    [#9485] Disable OAuth2 authorize button and change its text value on click
---
 Allura/allura/templates/oauth2_authorize.html | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/Allura/allura/templates/oauth2_authorize.html 
b/Allura/allura/templates/oauth2_authorize.html
index 8bcba060f..1afb4f830 100644
--- a/Allura/allura/templates/oauth2_authorize.html
+++ b/Allura/allura/templates/oauth2_authorize.html
@@ -55,9 +55,21 @@
       <input type="hidden" name="client_id" value="{{client.client_id}}"/>
       <input type="hidden" name="credentials" value="{{credentials}}"/>
       <input type="submit" class="submit" style="background: #ccc;color:#555" 
name="no" value="No, do not authorize {{ client.name }}">
-      <input type="submit" class="button" name="yes" value="Yes, authorize {{ 
client.name }}"><br>
+      <input id="authorize-ok" type="submit" class="button" name="yes" 
value="Yes, authorize {{ client.name }}"><br>
       {{lib.csrf_token()}}
     </form>
 </div>
 </div>
 {% endblock %}
+
+{% block extra_js %}
+<script type="text/javascript">
+  $(function() {
+    $('#authorize-ok').click(function() {
+      $(this).attr('disabled', 'disabled');
+      $(this).attr('value', 'Authorizing {{ client.name }}...');
+      $(this).closest('form').submit();
+    });
+  })
+</script>
+{% endblock %}

Reply via email to