diff --git a/seahub/templates/decrypt_repo_form.html b/seahub/templates/decrypt_repo_form.html
index 47f5b9165d..d8f2df3409 100644
--- a/seahub/templates/decrypt_repo_form.html
+++ b/seahub/templates/decrypt_repo_form.html
@@ -4,7 +4,7 @@
{% block main_panel %}
{% trans "This library is encrypted. Please input the password if you want to browse it online. And the password will be kept on the server for only 1 hour." %}
-
{% endblock %}
diff --git a/seahub/templates/repo.html b/seahub/templates/repo.html
index d621c7aba6..40a2a173bb 100644
--- a/seahub/templates/repo.html
+++ b/seahub/templates/repo.html
@@ -205,6 +205,18 @@
{% include "snippets/group_recommend_form.html" %}
{% endwith %}
+ {% if repo.enc_version == 2 and not server_crypto and repo.encrypted %}
+
+{% endif %}
+
{% endblock %}
{% block extra_script %}
@@ -272,8 +284,8 @@ if ('localStorage' in window && window['localStorage'] !== null) {
decrypt_repo();
}
function decrypt_repo() {
- var decrypt_form = $('');
- $('#header').after(decrypt_form);
+ var decrypt_form = $('#repo-decrypt-form');
+ $('#header').after(decrypt_form.removeClass('hide'));
$('[type="submit"]', decrypt_form).click(function() {
var passwd = $('[name="password"]', decrypt_form).val(),
err = $('.error', decrypt_form);