Skip to content

Commit

Permalink
[req-changes] Added a submit button to openwisp-info page
Browse files Browse the repository at this point in the history
  • Loading branch information
pandafy committed Apr 18, 2024
1 parent 5799c8c commit 6051e0a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ <h2>Metric collection</h2>
<form method="POST" id="id_metric_collection_consent_form">
{% csrf_token %}
{{ metric_consent_form }}
<p><input type="submit" style="display:none;"></p>
</form>
{% endif %}
{% endblock metric_collect_consent %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
'use strict';

django.jQuery(document).ready(function($) {
$('#id_user_consented').change(function() {
$('#id_metric_collection_consent_form').submit();
django.jQuery(document).ready(function ($) {
$('#id_user_consented').change(function () {
let submitButton = $('#id_metric_collection_consent_form input[type="submit"]');
if (!submitButton.is(':visible')) {
$('#id_metric_collection_consent_form input[type="submit"]').show();
}
});
});

0 comments on commit 6051e0a

Please sign in to comment.