diff --git a/contacts/templates/contacts/contact_add.html b/contacts/templates/contacts/contact_add.html index c944990622..996a4ff708 100644 --- a/contacts/templates/contacts/contact_add.html +++ b/contacts/templates/contacts/contact_add.html @@ -3,20 +3,33 @@ {% block nav_contacts_class %}class="cur"{% endblock %} {% block main_panel %} -
-

添加联系人

-
+
+

添加联系人(联系人列表)

+ + {{ form.user_email.as_hidden }} + + {{ form.contact_email }} + + {{ form.contact_name }} + + {{ form.note }} {% if error_msg %}

{{ error_msg }}

{% endif %} - {{ form.user_email.as_hidden }} - - {{ form.contact_email }}
- - {{ form.contact_name }}
- - {{ form.note }}
- 联系人列表 +

请输入邮箱地址。

+
{% endblock %} + +{% block extra_script %} + +{% endblock %} + diff --git a/contacts/templates/contacts/contact_edit.html b/contacts/templates/contacts/contact_edit.html index c1a67bcc1e..d5cdbc0017 100644 --- a/contacts/templates/contacts/contact_edit.html +++ b/contacts/templates/contacts/contact_edit.html @@ -3,22 +3,22 @@ {% block nav_contacts_class %}class="cur"{% endblock %} {% block main_panel %} -
-

编辑联系人

-
+
+

编辑联系人(联系人列表)

+ + {{ form.user_email.as_hidden }} + + {{ form.contact_email }} + + {{ form.contact_name }} + + {{ form.note }} + + {% if error_msg %}

{{ error_msg }}

{% endif %} - {{ form.user_email.as_hidden }} - - {{ form.contact_email }}
- - {{ form.contact_name }}
- - {{ form.note }}
- - - 联系人列表 +
{% endblock %} diff --git a/group/templates/group/group_manage.html b/group/templates/group/group_manage.html index a3099ab670..719f7e0070 100644 --- a/group/templates/group/group_manage.html +++ b/group/templates/group/group_manage.html @@ -44,7 +44,7 @@

-
+

输入不能为空。

diff --git a/group/views.py b/group/views.py index 2c3d83e442..bb87da75e9 100644 --- a/group/views.py +++ b/group/views.py @@ -121,15 +121,22 @@ def group_info(request, group_id): def group_add_member(request): if request.method == 'POST': group_id = request.POST.get('group_id') - member_name = request.POST.get('user_name').split(',')[0] - if not validate_emailuser(member_name): - err_msg = u'用户不存在' - return go_error(request, err_msg) - else: - try: - group_id_int = int(group_id) - except ValueError: - return go_error(request, u'group id 不是有效参数') + member_names = request.POST.get('user_name').split(',') + + try: + group_id_int = int(group_id) + except ValueError: + return go_error(request, u'group id 不是有效参数') + + for member_name in member_names: + member_name = member_name.strip(' ') + if not member_name: + continue + + if not validate_emailuser(member_name): + err_msg = u'用户不存在' + return go_error(request, err_msg) + try: ccnet_rpc.group_add_member(group_id_int, request.user.username, member_name) diff --git a/media/css/seahub.css b/media/css/seahub.css index 7d544ee682..553fa3b1d5 100644 --- a/media/css/seahub.css +++ b/media/css/seahub.css @@ -32,6 +32,37 @@ img { border:none; } h2 { font-size:18px; color:#808; margin:10px 0 8px; } h3 { font-size:15px; color:#808; font-weight:normal; margin:10px 0 6px; } ol { padding-left:2em; } +/* input button */ +textarea { border: 1px solid #80B0B0; } +input { + height:20px; + line-height:20px; + margin:3px 0; + border: 1px solid #80B0B0; +} +input[type=checkbox] { + height:auto; +} +input[type=submit], +button { + color: #080; + height:23px; + padding:2px 3px; + background: #EEE; + border: 1px solid #80B0B0; + border-radius: 3px; + -moz-border-radius:3px; + margin-top:8px; +} +button { + margin:0; +} +input[type=submit]:hover, +button:hover { + cursor:pointer; + background: #FFF; +} +label { display: inline-block; margin:2px 0px; } /* table */ table { border-spacing: 0; @@ -49,12 +80,6 @@ tr.hl { background-color: #ddddff; }/*highlight*/ .odd th { background:#ddd; } tr.first { background-color: #00FF00; } -.w350 { - width:350px; -} -.center { - margin:0 auto; -} /* container */ #wrapper { font: 13px/1.5 Arial, Helvetica, sans-serif; } #header, #main, #footer { width:950px; } @@ -105,58 +130,26 @@ tr.first { background-color: #00FF00; } #main .avatar_op ul ul li { float:left; margin-right:5px; } .avatar { float:left; width:120px; } .ele_info { float:right; width:450px; } -/* input button */ -textarea { border: 1px solid #80B0B0; } -input { - height:20px; - line-height:20px; - margin:2px 0; - border: 1px solid #80B0B0; + +/*narrow-panel*/ +.narrow-panel { + width:25em; + min-height:15em; + padding:2.5em; + background:#E9F1F4; + border-radius:4px; + -moz-border-radius:4px; + margin:5em auto 0; } -input[type=checkbox] { - height:auto; +.narrow-panel h2, +.narrow-panel h3 { + margin-top:0; } -input[type=submit], -button { - color: #080; - height:23px; - padding:2px 3px; - background: #EEE; - border: 1px solid #80B0B0; - border-radius: 3px; - -moz-border-radius:3px; - margin-top:5px; -} -button { - margin:0; -} -input[type=submit]:hover, -button:hover { - cursor:pointer; - background: #FFF; -} -label { display: inline-block; margin:2px 0px; } -#user-add-form label, -.reg label, -.pwd_change label { - width:5em; - text-align:right; -} -#user-add-form .submit, -.reg .submit { - margin-left:5em; -} -.login .submit { - margin-left:3em; -} -.login .error { - margin:3px 0 0 3em; -} -.pwd_change label { - width:6em; -} -.pwd_change .submit { - margin-left:6em; +.narrow-panel input[type="text"], +.narrow-panel input[type="password"] { + width:96%; + height:1.8em; + margin:0 0 0.6em; } /* popup dialog */ #basic-modal-content {display:none;} @@ -185,10 +178,12 @@ label { display: inline-block; margin:2px 0px; } } /*myhome*/ .mygroup { - float:left; + display:inline-block; width:70px; text-align:center; - margin:0 3px 5px 0; + word-wrap:break-word; + vertical-align:top; + margin:0 0px 5px 0; } /*repo page*/ @@ -227,17 +222,17 @@ label { display: inline-block; margin:2px 0px; } margin-bottom:14px; } /*repo-share-form*/ -#to_email { +#to_email, +#added-member-name { width:260px; height:80px; } /*contact*/ -.contact-op-form label { - width:6em; - text-align:right; +.contact-list-link { + font-size:13px; } -.contact-op-form .submit { - margin-left:6em; +.contact-list-link:hover { + text-decoration:none; } /* group */ .group-member-icon { diff --git a/templates/add_user_form.html b/templates/add_user_form.html index 34ab3f53d4..6d29708c41 100644 --- a/templates/add_user_form.html +++ b/templates/add_user_form.html @@ -2,21 +2,45 @@ {% block title %}添加用户{% endblock %} {% block nav_useradmin_class %}class="cur"{% endblock %} {% block main_panel %} +

添加用户

- + {{ form.email }} - {% if form.email.errors %} - {{ form.email.errors }} - {% endif %}
{{ form.password1 }} - {% if form.password1.errors %} - {{ form.password1.errors }} - {% endif %}
- {{ form.password2 }}
- + {{ form.password2 }} + + {{ form.email.errors }} + {{ form.password1.errors }} + {{ form.password2.errors }} +

+ + +
+{% endblock %} + +{% block extra_script %} + {% endblock %} - diff --git a/templates/myhome.html b/templates/myhome.html index 26aa7d035c..a97dbf7107 100644 --- a/templates/myhome.html +++ b/templates/myhome.html @@ -7,7 +7,7 @@

我管理的小组

{% if groups_manage %} -