From 2ac9c9b7f6a5d320b961710c5875dbab4e53c66f Mon Sep 17 00:00:00 2001 From: llj Date: Mon, 21 May 2012 11:47:53 +0800 Subject: [PATCH 1/3] [group-member-add]enable add more than one at one time --- group/templates/group/group_manage.html | 2 +- group/views.py | 25 ++++++++++++++++--------- media/css/seahub.css | 3 ++- 3 files changed, 19 insertions(+), 11 deletions(-) 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..f0b9b00650 100644 --- a/media/css/seahub.css +++ b/media/css/seahub.css @@ -227,7 +227,8 @@ label { display: inline-block; margin:2px 0px; } margin-bottom:14px; } /*repo-share-form*/ -#to_email { +#to_email, +#added-member-name { width:260px; height:80px; } From 80a17711d2688f5951068c0071388d8cf0bc2e4a Mon Sep 17 00:00:00 2001 From: llj Date: Mon, 21 May 2012 15:08:34 +0800 Subject: [PATCH 2/3] modifed 'mygroup' in myhome --- media/css/seahub.css | 6 ++++-- templates/myhome.html | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/media/css/seahub.css b/media/css/seahub.css index f0b9b00650..d22e8bf047 100644 --- a/media/css/seahub.css +++ b/media/css/seahub.css @@ -185,10 +185,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*/ 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 %} -
    +
      {% for group in groups_manage %}

    • @@ -21,7 +21,7 @@

      我参加的小组

      {% if groups_join %} -
        +
          {% for group in groups_join %}

        • From 207f2364377dc5c7923ce276d70a1e211f3feb5e Mon Sep 17 00:00:00 2001 From: llj Date: Tue, 22 May 2012 16:21:16 +0800 Subject: [PATCH 3/3] modified registration pages, contact-add/edit, user-add * modifed ui of all pages above * add input field check before submit for forms --- contacts/templates/contacts/contact_add.html | 35 ++++-- contacts/templates/contacts/contact_edit.html | 26 ++-- media/css/seahub.css | 114 ++++++++---------- templates/add_user_form.html | 44 +++++-- templates/registration/activate.html | 6 +- .../registration/activation_complete.html | 4 +- .../registration/activation_email_subject.txt | 2 +- templates/registration/login.html | 27 ++--- templates/registration/logout.html | 2 +- .../registration/password_change_done.html | 6 +- .../registration/password_change_form.html | 41 ++++++- .../registration/password_reset_complete.html | 4 +- .../registration/password_reset_confirm.html | 11 +- .../registration/password_reset_done.html | 2 +- .../registration/password_reset_form.html | 16 +-- .../registration/registration_closed.html | 4 +- .../registration/registration_complete.html | 2 +- templates/registration/registration_form.html | 46 +++++-- templates/useradmin.html | 23 ++-- 19 files changed, 251 insertions(+), 164 deletions(-) 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/media/css/seahub.css b/media/css/seahub.css index d22e8bf047..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;} @@ -235,12 +228,11 @@ label { display: inline-block; margin:2px 0px; } 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/registration/activate.html b/templates/registration/activate.html index 9b59dcfb74..87c59ce6a8 100644 --- a/templates/registration/activate.html +++ b/templates/registration/activate.html @@ -1,7 +1,9 @@ {% extends "myhome_base.html" %} -{% block title %}Create an account{% endblock %} +{% block title %}激活码错误{% endblock %} {% block main_panel %} -

          激活码错误。

          +
          +

          激活码错误。

          +
          {% endblock %} diff --git a/templates/registration/activation_complete.html b/templates/registration/activation_complete.html index ef448b5a40..5a12652cf2 100644 --- a/templates/registration/activation_complete.html +++ b/templates/registration/activation_complete.html @@ -3,6 +3,8 @@ {% block title %}帐号已激活{% endblock %} {% block main_panel %} -

          你的帐号已经激活。 登录

          +
          +

          你的帐号已经激活。 登录

          +
          {% endblock %} diff --git a/templates/registration/activation_email_subject.txt b/templates/registration/activation_email_subject.txt index 111f8d7101..52868e78b4 100644 --- a/templates/registration/activation_email_subject.txt +++ b/templates/registration/activation_email_subject.txt @@ -1 +1 @@ -请激活你的帐号,完成注册 +请激活您的帐号,完成注册。 diff --git a/templates/registration/login.html b/templates/registration/login.html index 4421dd1f99..17593b908d 100644 --- a/templates/registration/login.html +++ b/templates/registration/login.html @@ -1,15 +1,15 @@ {% extends "myhome_base.html" %} -{% block title %}用户登录{% endblock %} +{% block title %}登录{% endblock %} {% block main_panel %} -
          -

          用户登录

          - {% endblock %} + {% block extra_script %} {% endblock %} - diff --git a/templates/registration/logout.html b/templates/registration/logout.html index 7af7361f7c..d9eb0301ba 100644 --- a/templates/registration/logout.html +++ b/templates/registration/logout.html @@ -3,7 +3,7 @@ {% block title %}退出{% endblock %} {% block main_panel %} -
          +

          感谢参与。

          重新登录
          diff --git a/templates/registration/password_change_done.html b/templates/registration/password_change_done.html index 5a53c0cde2..c92c42ba14 100644 --- a/templates/registration/password_change_done.html +++ b/templates/registration/password_change_done.html @@ -1,9 +1,11 @@ {% extends "accounts.html" %} -{% block title %}{% trans 'Password change successful' %}{% endblock %} +{% block title %}密码修改成功{% endblock %} {% block main_panel %} -

          您的密码已成功修改。

          +
          +

          您的密码已成功修改。

          +
          {% endblock %} diff --git a/templates/registration/password_change_form.html b/templates/registration/password_change_form.html index a35081ec0a..e685ad686f 100644 --- a/templates/registration/password_change_form.html +++ b/templates/registration/password_change_form.html @@ -2,16 +2,45 @@ {% block title %}密码修改{% endblock %} {% block main_panel %} -
          +

          密码修改

          -
          - {{ form.old_password }}
          + + + {{ form.old_password }} + + {{ form.new_password1 }} + + {{ form.new_password2 }} + {{ form.old_password.errors }} - {{ form.new_password1 }}
          {{ form.new_password1.errors }} - {{ form.new_password2 }}
          {{ form.new_password2.errors }} - +

          + +
          {% endblock %} + +{% block extra_script %} + +{% endblock %} diff --git a/templates/registration/password_reset_complete.html b/templates/registration/password_reset_complete.html index 228dd12f6f..836e2892cf 100644 --- a/templates/registration/password_reset_complete.html +++ b/templates/registration/password_reset_complete.html @@ -3,5 +3,7 @@ {% block title %}密码重置成功{% endblock %} {% block main_panel %} -

          密码重置成功。 登录

          +
          +

          密码重置成功。 登录

          +
          {% endblock %} diff --git a/templates/registration/password_reset_confirm.html b/templates/registration/password_reset_confirm.html index 1e5ddfcd21..78f3bda7d6 100644 --- a/templates/registration/password_reset_confirm.html +++ b/templates/registration/password_reset_confirm.html @@ -3,17 +3,18 @@ {% block title %}密码重置{% endblock %} {% block main_panel %} -
          +
          {% if validlink %}

          请输入新密码

          -
          + +{{ form.new_password1 }} {{ form.new_password1.errors }} -

          {{ form.new_password1 }}

          + +{{ form.new_password2 }} {{ form.new_password2.errors }} -

          {{ form.new_password2 }}

          -

          +
          {% else %} diff --git a/templates/registration/password_reset_done.html b/templates/registration/password_reset_done.html index cade32cfe6..96d0810f56 100644 --- a/templates/registration/password_reset_done.html +++ b/templates/registration/password_reset_done.html @@ -4,6 +4,6 @@ {% block main_panel %} -

          我们已经把密码重置说明发往您提交的邮箱里,请查收。

          +

          我们已经把密码重置说明发往您提交的邮箱里,请查收。

          {% endblock %} diff --git a/templates/registration/password_reset_form.html b/templates/registration/password_reset_form.html index c1fc0c7e9b..15fd560d87 100644 --- a/templates/registration/password_reset_form.html +++ b/templates/registration/password_reset_form.html @@ -2,12 +2,14 @@ {% block title %}密码重置{% endblock %} {% block main_panel %} -
          -

          密码重置

          -
          - {{ form.email }} -

          [我们会把新密码设置说明通过邮件发送给您]

          -{{ form.email.errors }} -
          +
          +

          密码重置

          +
          + + (我们会把新密码设置说明通过邮件发送给您) + {{ form.email }} + {{ form.email.errors }} + +
          {% endblock %} diff --git a/templates/registration/registration_closed.html b/templates/registration/registration_closed.html index dd1b1839ea..47ba71d8af 100644 --- a/templates/registration/registration_closed.html +++ b/templates/registration/registration_closed.html @@ -3,6 +3,8 @@ {% block title %}Create an account{% endblock %} {% block main_panel %} -

          注册关闭。

          +
          +

          注册关闭。

          +
          {% endblock %} diff --git a/templates/registration/registration_complete.html b/templates/registration/registration_complete.html index 0fa3938076..ac30e2f24b 100644 --- a/templates/registration/registration_complete.html +++ b/templates/registration/registration_complete.html @@ -1,7 +1,7 @@ {% extends "myhome_base.html" %} {% block title %}感谢注册{% endblock %} {% block main_panel %} -
          +
          {% if send_mail %}

          感谢注册,激活邮件已发往您的邮箱,请查收。

          如果您在收件箱里没找到,请检查下是否被当成垃圾邮件了。

          diff --git a/templates/registration/registration_form.html b/templates/registration/registration_form.html index cc53fa5da7..fc04f724ec 100644 --- a/templates/registration/registration_form.html +++ b/templates/registration/registration_form.html @@ -1,23 +1,43 @@ {% extends "myhome_base.html" %} -{% block title %}用户注册{% endblock %} +{% block title %}注册{% 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/useradmin.html b/templates/useradmin.html index 42d1f42512..f804e7ec47 100644 --- a/templates/useradmin.html +++ b/templates/useradmin.html @@ -48,19 +48,20 @@ {% block extra_script %}