diff --git a/mayan/apps/appearance/static/appearance/js/mayan_app.js b/mayan/apps/appearance/static/appearance/js/mayan_app.js index 1c386d949f..a4d3ed0790 100644 --- a/mayan/apps/appearance/static/appearance/js/mayan_app.js +++ b/mayan/apps/appearance/static/appearance/js/mayan_app.js @@ -217,6 +217,7 @@ class MayanApp { this.setupAJAXPeriodicWorkers(); this.setupAJAXSpinner(); this.setupAutoSubmit(); + this.setupFormHotkeys(); this.setupFullHeightResizing(); this.setupItemsSelector(); this.setupNavbarCollapse(); @@ -271,6 +272,21 @@ class MayanApp { }); } + setupFormHotkeys () { + $('body').on('keypress', '.form-hotkey-enter', function (e) { + if ((e.which && e.which == 13) || (e.keyCode && e.keyCode == 13)) { + $(this).find('.btn-hotkey-default').click(); + return false; + } else { + return true; + } + }); + $('body').on('dblclick', '.form-hotkey-double-click', function (e) { + $(this).find('.btn-hotkey-default').click(); + return false; + }); + } + setupFullHeightResizing () { var self = this; diff --git a/mayan/apps/appearance/templates/appearance/generic_form_subtemplate.html b/mayan/apps/appearance/templates/appearance/generic_form_subtemplate.html index 990e207631..2175b885b8 100644 --- a/mayan/apps/appearance/templates/appearance/generic_form_subtemplate.html +++ b/mayan/apps/appearance/templates/appearance/generic_form_subtemplate.html @@ -10,9 +10,9 @@
{% if form.is_multipart %} -
+ {% else %} - + {% endif %} {{ wizard.management_form }} @@ -75,7 +75,7 @@ {% if not form.management_form or wizard.management_form or form.forms %} {# Is a normal form, a wizard form, or a formset with at least one form #}
- {% if previous %} -   +   {% if cancel_label %}{{ cancel_label }}{% else %}{% trans 'Cancel' %}{% endif %} {% endif %} diff --git a/mayan/apps/appearance/templates/appearance/generic_multiform_subtemplate.html b/mayan/apps/appearance/templates/appearance/generic_multiform_subtemplate.html index eb695f0775..efd23254e9 100644 --- a/mayan/apps/appearance/templates/appearance/generic_multiform_subtemplate.html +++ b/mayan/apps/appearance/templates/appearance/generic_multiform_subtemplate.html @@ -2,9 +2,9 @@ {% load static %}
{% if is_multipart %} - + {% else %} - + {% endif %} {% for form_name, form in forms.items %} @@ -56,10 +56,10 @@
{% if not form_disable_submit %} - + {% endif %} {% if previous %} -   +   {% if cancel_label %}{{ cancel_label }}{% else %}{% trans 'Cancel' %}{% endif %} {% endif %} diff --git a/mayan/apps/sources/views.py b/mayan/apps/sources/views.py index dd63452cb7..0373ad7169 100644 --- a/mayan/apps/sources/views.py +++ b/mayan/apps/sources/views.py @@ -356,7 +356,7 @@ class UploadInteractiveView(UploadBaseView): kwargs=self.request.resolver_match.kwargs ), self.request.META['QUERY_STRING'] ), - 'form_class': 'dropzone', + 'form_css_classes': 'dropzone', 'form_disable_submit': True, 'form_id': 'html5upload', }