diff --git a/seahub/profile/templates/profile/set_profile.html b/seahub/profile/templates/profile/set_profile.html index 88b4be18dc..ac32178ab5 100644 --- a/seahub/profile/templates/profile/set_profile.html +++ b/seahub/profile/templates/profile/set_profile.html @@ -23,6 +23,8 @@
  • {% trans "Language" %}
  • +
  • {% trans "Email Notification" %}
  • + {% if two_factor_auth_enabled %}
  • {% trans "Two-Factor Authentication" %}
  • {% endif %} @@ -124,6 +126,19 @@ +
    +

    {% trans "Email Notification of File Changes" %}

    +
    {% csrf_token %} + {# email_notification_interval: in seconds #} +
    +
    +
    +
    +
    + +
    +
    + {% if two_factor_auth_enabled %}

    {% trans "Two-Factor Authentication" %}

    @@ -334,5 +349,21 @@ $('#update-webdav-passwd .generate-random-password').click(function() { } }); })(); + +$('#set-email-notice-interval-form').on('submit', function() { + var interval = $('[name="interval"]:checked', $(this)).val(); + $.ajax({ + url: '{{SITE_ROOT}}api2/account/info/', + type: 'PUT', + data: {'email_notification_interval': interval}, + dataType: 'json', + beforeSend: prepareCSRFToken, + success: function() { + feedback("{% trans "Success" %}", 'success'); + }, + error: ajaxErrorHandler + }); + return false; +}); {% endblock %}