From aafd3410f59bcc9ceb245f98ca47d2369b695c25 Mon Sep 17 00:00:00 2001 From: llj Date: Sat, 9 Nov 2013 15:55:48 +0800 Subject: [PATCH] improved ui of repo_decrypt page --- seahub/templates/decrypt_repo_form.html | 5 +++-- seahub/templates/repo.html | 16 ++++++++++++++-- 2 files changed, 17 insertions(+), 4 deletions(-) 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." %}

-
{% csrf_token %} + {% csrf_token %} @@ -14,7 +14,8 @@ {% for error in form.errors.values %} {{ error|escape }} {% endfor %} -

{% trans "Change how to view encrypted libraries online" %}

+ {% url 'edit_profile' as profile_edit_url %} +

{% blocktrans %}You can change how to view encrypted libraries online here.{% endblocktrans %}

{% 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 %} +
+

{% trans "This library is encrypted. Please input the password if you want to browse it online. And the password will be kept in the browser for only 1 hour." %}

+ + + +

+ {% url 'edit_profile' as profile_edit_url %} +

{% blocktrans %}You can change how to view encrypted libraries online here.{% endblocktrans %}

+
+{% endif %} + {% endblock %} {% block extra_script %} @@ -272,8 +284,8 @@ if ('localStorage' in window && window['localStorage'] !== null) { decrypt_repo(); } function decrypt_repo() { - var decrypt_form = $('

{% trans "This library is encrypted. Please input the password if you want to browse it online. And the password will be kept in the browser for only 1 hour." %}

{% trans "Change how to view encrypted libraries online" %}

'); - $('#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);