From e3df7b561e4d85e6e8e84c97d2f31410c4fb088c Mon Sep 17 00:00:00 2001 From: llj Date: Tue, 29 Sep 2015 12:04:41 +0800 Subject: [PATCH] [web setting] bugfix & improvement --- media/css/seahub.css | 85 +++++++------------ .../templates/snippets/web_settings_form.html | 40 ++++----- seahub/templates/sysadmin/settings.html | 77 ++++++++--------- 3 files changed, 88 insertions(+), 114 deletions(-) diff --git a/media/css/seahub.css b/media/css/seahub.css index 216eedfe8c..b8d93af6ce 100644 --- a/media/css/seahub.css +++ b/media/css/seahub.css @@ -1939,9 +1939,11 @@ textarea:-moz-placeholder {/* for FF */ #rename-form .input { font-size:14px; } +.web-setting-form .submit, #rename-form .submit { color:green; } +.web-setting-form .cancel, #rename-form .cancel { color:#666; } @@ -1949,6 +1951,8 @@ textarea:-moz-placeholder {/* for FF */ #rename-form .submit { margin:0; } +.web-setting-form .submit, +.web-setting-form .cancel, #rename-form .submit, #rename-form .cancel { font-size:16px; @@ -3640,68 +3644,43 @@ img.thumbnail { max-height: 24px; } -/* seahub web setting */ -.seahub-web-settings { - margin-top:15px; -} +/* seahub web settings */ .seahub-web-settings h4 { + padding:3px 10px; background:#f7f7f7; + border-radius:2px; margin:15px 0; - padding:4px 0 4px 14px; } -.web-setting-name { - width:190px; - margin-left:14px; -} -.web-setting-name label { - width:175px; - margin:3px 0; -} -.web-setting-description { - width:480px; +.web-setting-form { margin-bottom:20px; } .web-setting-name, -.web-setting-description { +.web-setting-input, +.web-setting-ops { display:inline-block; +} +.web-setting-name { + width:180px; + padding:0 10px; + vertical-align:top; + font-weight:normal; + line-height:28px; +} +.web-setting-input { + width:400px; +} +.web-setting-name, +.web-setting-input .input { + margin:0; +} +.web-setting-ops { + width:100px; vertical-align:top; } -.web-setting-description .web-setting-help-tip { - font-size:12px; +.web-setting-form .submit, +.web-setting-input { + margin-top:0; } -.web-input-setting-form .web-setting-help-tip { - width:380px; - color:#888; - line-height:1.4; - margin:2px 0 0 0; -} -.web-input-setting-form .error { - margin:2px 0 0 0; -} -.web-input-setting-form .input , -.web-input-setting-form .submit { - margin:3px 0 0 0; -} -.web-input-setting-form .input { - width:370px; - padding:0 0 0 5px; - height:23px; -} -.web-input-setting-form .submit { - padding:2px 8px; - margin-left:20px; -} -.web-input-setting-form .cancel-setting { - opacity:0.6; - padding:3px 6px 5px; -} -.web-input-setting-form .cancel-setting:hover { - opacity:1; -} -.web-checkbox-setting-form { - width:370px; -} -.web-checkbox-setting-form .web-setting-help-tip { - top:-7px; - left:1px; +.web-setting-form .submit { + margin-right:5px; } diff --git a/seahub/templates/snippets/web_settings_form.html b/seahub/templates/snippets/web_settings_form.html index 25cb465c53..df524e033c 100644 --- a/seahub/templates/snippets/web_settings_form.html +++ b/seahub/templates/snippets/web_settings_form.html @@ -1,28 +1,28 @@ {% load i18n %} {% if type == 'input' %} -
- -
-
-
{% csrf_token %} - - -
+ +
{{ setting_display_name }}
+
+

-

{{ help_tip }}

- -
+

{{ help_tip }}

+
+
+ + +
+ {% endif %} {% if type == 'checkbox' %} -
- -
- -
-
{% csrf_token %} - {{ help_tip }} -
-
+
{% csrf_token %} +
{{ setting_display_name }}
+
+ +
+
{% endif %} diff --git a/seahub/templates/sysadmin/settings.html b/seahub/templates/sysadmin/settings.html index c51490efca..67e8e98b1a 100644 --- a/seahub/templates/sysadmin/settings.html +++ b/seahub/templates/sysadmin/settings.html @@ -8,7 +8,7 @@
-

Url

+

URL

{% with type="input" setting_display_name="SERVICE_URL" help_tip="The URL of the server, like https://seafile.example.com or http://192.168.1.2:8000" setting_name="SERVICE_URL" setting_val=config_dict.SERVICE_URL %} @@ -45,15 +45,15 @@

Password

- {% with type="checkbox" setting_display_name="strong password" help_tip="Force user use a strong password when singup up or change password." setting_name="USER_STRONG_PASSWORD_REQUIRED" setting_val=config_dict.USER_STRONG_PASSWORD_REQUIRED %} + {% with type="checkbox" setting_display_name="strong password" help_tip="Force user to use a strong password when sign up or change password." setting_name="USER_STRONG_PASSWORD_REQUIRED" setting_val=config_dict.USER_STRONG_PASSWORD_REQUIRED %} {% include "snippets/web_settings_form.html" %} {% endwith %} - {% with type="input" setting_display_name="password minimum length" help_tip="The least number of characters when user make up an account password." setting_name="USER_PASSWORD_MIN_LENGTH" setting_val=config_dict.USER_PASSWORD_MIN_LENGTH %} + {% with type="input" setting_display_name="password minimum length" help_tip="The least number of characters an account password should include." setting_name="USER_PASSWORD_MIN_LENGTH" setting_val=config_dict.USER_PASSWORD_MIN_LENGTH %} {% include "snippets/web_settings_form.html" %} {% endwith %} - {% with type="input" setting_display_name="password strength level" help_tip="The level of password strength when user make up an account passowrd." setting_name="USER_PASSWORD_STRENGTH_LEVEL" setting_val=config_dict.USER_PASSWORD_STRENGTH_LEVEL %} + {% with type="input" setting_display_name="password strength level" help_tip="The level of an account password's strength." setting_name="USER_PASSWORD_STRENGTH_LEVEL" setting_val=config_dict.USER_PASSWORD_STRENGTH_LEVEL %} {% include "snippets/web_settings_form.html" %} {% endwith %}
@@ -61,15 +61,15 @@

Library

- {% with type="checkbox" setting_display_name="library history" help_tip="If allow user keep library history" setting_name="ENABLE_REPO_HISTORY_SETTING" setting_val=config_dict.ENABLE_REPO_HISTORY_SETTING %} + {% with type="checkbox" setting_display_name="library history" help_tip="Allow user to keep library history" setting_name="ENABLE_REPO_HISTORY_SETTING" setting_val=config_dict.ENABLE_REPO_HISTORY_SETTING %} {% include "snippets/web_settings_form.html" %} {% endwith %} - {% with type="checkbox" setting_display_name="encrypt library" help_tip="If allow user create encrypted library" setting_name="ENABLE_ENCRYPT_LIBRARY" setting_val=config_dict.ENABLE_ENCRYPT_LIBRARY %} + {% with type="checkbox" setting_display_name="encrypted library" help_tip="Allow user to create encrypted library" setting_name="ENABLE_ENCRYPT_LIBRARY" setting_val=config_dict.ENABLE_ENCRYPT_LIBRARY %} {% include "snippets/web_settings_form.html" %} {% endwith %} - {% with type="input" setting_display_name="library password minimum length" help_tip="The least number of characters that can make up an encrypt library password." setting_name="REPO_PASSWORD_MIN_LENGTH" setting_val=config_dict.REPO_PASSWORD_MIN_LENGTH %} + {% with type="input" setting_display_name="library password minimum length" help_tip="The least number of characters an encrypted library password should include." setting_name="REPO_PASSWORD_MIN_LENGTH" setting_val=config_dict.REPO_PASSWORD_MIN_LENGTH %} {% include "snippets/web_settings_form.html" %} {% endwith %}
@@ -86,44 +86,37 @@ {% block extra_script %}