From 11ec432f84e3a5cc6cce7ec2bd29e5d60c394a92 Mon Sep 17 00:00:00 2001 From: llj Date: Wed, 9 Jul 2014 17:51:07 +0800 Subject: [PATCH] [user role] bugfix and improvement --- media/css/seahub.css | 17 ++++--- seahub/forms.py | 4 +- seahub/group/templates/group/group_info.html | 5 ++ seahub/group/templates/group/groups.html | 2 + .../templates/group/groups_left_panel.html | 14 ++---- .../templates/group/groups_right_panel.html | 21 ++++----- .../templates/profile/set_profile.html | 5 +- .../templates/share/priv_shared_files.html | 12 +++-- seahub/templates/home_base.html | 6 +++ seahub/templates/myhome.html | 47 ++++++------------- seahub/templates/sysadmin/sys_useradmin.html | 19 ++++---- seahub/templates/sysadmin/useradmin_js.html | 30 ++++++------ .../templates/sysadmin/useradmin_table.html | 5 +- seahub/views/__init__.py | 3 +- seahub/views/sysadmin.py | 2 +- 15 files changed, 94 insertions(+), 98 deletions(-) diff --git a/media/css/seahub.css b/media/css/seahub.css index fe86a1dc70..45578c7f35 100644 --- a/media/css/seahub.css +++ b/media/css/seahub.css @@ -68,6 +68,7 @@ .icon-picture:before { content: "\f03e"; } .icon-undo:before { content: "\f0e2"; } .icon-repeat:before { content: "\f01e"; } +.icon-question-sign:before { content: "\f059"; } /****** sf-icon-xx ********/ @font-face { @@ -124,7 +125,7 @@ textarea { resize: vertical; /* for drag */ outline:0; } -textarea, select, input { border: 1px solid #ddd; } +textarea, input { border: 1px solid #ddd; } input { height:22px; margin:3px 0; outline:0; } input, button { display:inline-block;/*for ie*/ } input[type=submit], @@ -136,7 +137,8 @@ button, input[type=submit], input[type=button], input.submit, -.fileinput-button { +.fileinput-button, +select { padding:5px 6px; background:-webkit-linear-gradient(top, #fafafb, #eeeeee); background:-moz-linear-gradient(top, #fafafb, #eeeeee); @@ -144,6 +146,9 @@ input.submit, border: 1px solid #c5c5c5; border-radius: 2px; } +select { + outline:none; +} input[type=radio] { height:auto; border:0;/*for ie*/ @@ -188,7 +193,8 @@ button::-moz-focus-inner {/*Remove button padding in FF*/ display: block; } input[type=submit], -input.submit { +input.submit, +button.submit { margin-top:8px; } input[type=submit]:hover, @@ -1476,7 +1482,6 @@ textarea:-moz-placeholder {/* for FF */ } #repo-create-form .perm { width:268px; - height:22px; margin-bottom:10px; } .event-group-hd { @@ -2454,8 +2459,7 @@ textarea:-moz-placeholder {/* for FF */ } #file-enc { border:1px solid #ddd; - border-radius:2px; - background:#efefef; + padding:0; } #file-view-tip { height: 150px; @@ -2948,6 +2952,7 @@ textarea:-moz-placeholder {/* for FF */ } #mass-email { width:432px; + padding:0; } /* payments */ #plans { diff --git a/seahub/forms.py b/seahub/forms.py index cfd5b38342..1e0a9af95f 100644 --- a/seahub/forms.py +++ b/seahub/forms.py @@ -28,7 +28,7 @@ class AddUserForm(forms.Form): email = self.cleaned_data['email'] try: user = User.objects.get(email=email) - raise forms.ValidationError(_("A user with this email already")) + raise forms.ValidationError(_("A user with this email already exists.")) except User.DoesNotExist: return self.cleaned_data['email'] @@ -42,7 +42,7 @@ class AddUserForm(forms.Form): """ if 'password1' in self.cleaned_data and 'password2' in self.cleaned_data: if self.cleaned_data['password1'] != self.cleaned_data['password2']: - raise forms.ValidationError(_("The two password fields didn't match.")) + raise forms.ValidationError(_("The two passwords didn't match.")) return self.cleaned_data class RepoCreateForm(forms.Form): diff --git a/seahub/group/templates/group/group_info.html b/seahub/group/templates/group/group_info.html index 78119981cc..9527c048b4 100644 --- a/seahub/group/templates/group/group_info.html +++ b/seahub/group/templates/group/group_info.html @@ -121,7 +121,10 @@ +{% if request.user.role == default_user or request.user.role == None %} {% include "snippets/repo_create_form.html" %} +{% endif %} +

{% trans 'Library' %} {% trans 'is encrypted' %}

@@ -154,6 +157,7 @@ $('.download').click(function() { window.open('{{ SITE_ROOT }}seafile_access_check/?repo_id=' + e(repo_id)); }); +{% if request.user.role == default_user or request.user.role == None %} function repoCreateSuccessCallback() { location.reload(); } @@ -161,6 +165,7 @@ function repoCreateSuccessCallback() { {% with post_url=repo_create_url %} {% include 'snippets/repo_create_js.html' %} {% endwith %} +{% endif %} {% if recent_commits %} {% include 'snippets/list_commit_detail.html' %} diff --git a/seahub/group/templates/group/groups.html b/seahub/group/templates/group/groups.html index 02e99860e1..37760243a8 100644 --- a/seahub/group/templates/group/groups.html +++ b/seahub/group/templates/group/groups.html @@ -15,10 +15,12 @@ {% block extra_script %} {% endblock %} diff --git a/seahub/templates/myhome.html b/seahub/templates/myhome.html index a165ecc8c5..acf166cb62 100644 --- a/seahub/templates/myhome.html +++ b/seahub/templates/myhome.html @@ -6,17 +6,14 @@ {% block extra_style %} {% if need_guide %}