diff --git a/base/templatetags/seahub_tags.py b/base/templatetags/seahub_tags.py index 5ebbd3495c..40437a340a 100644 --- a/base/templatetags/seahub_tags.py +++ b/base/templatetags/seahub_tags.py @@ -261,3 +261,10 @@ def translate_permission(value): def quote(value): from urllib2 import quote return quote(value) + +@register.filter(name='trim') +def trim(value, length): + if len(value) > length: + return value[:length-2] + '...' + else: + return value diff --git a/media/css/seahub.css b/media/css/seahub.css index d0db3cf585..382ea04dbe 100644 --- a/media/css/seahub.css +++ b/media/css/seahub.css @@ -720,8 +720,6 @@ textarea:-moz-placeholder {/* for FF */ .mygroup .name { display:inline-block; width:100%; - height:1.5em; - overflow:hidden; } #repo-create, #contact-add, diff --git a/templates/myhome.html b/templates/myhome.html index 1f876eaf64..4427427d30 100644 --- a/templates/myhome.html +++ b/templates/myhome.html @@ -56,14 +56,13 @@

{{ quota_usage|filesizeformat }} {% if quota > 0 %}/ {{ quota|filesizeformat }} {% endif %}

- {% with groups=joined_groups %} {% include "snippets/my_groups.html" %} {% endwith %} {% endblock %} {% block right_panel %} - + {% include "snippets/my_owned_repos.html" %} {% if events %} diff --git a/templates/snippets/my_groups.html b/templates/snippets/my_groups.html index 2292694c28..ddf66a3401 100644 --- a/templates/snippets/my_groups.html +++ b/templates/snippets/my_groups.html @@ -1,4 +1,4 @@ -{% load group_avatar_tags i18n %} +{% load seahub_tags group_avatar_tags i18n %} {% load url from future %}

{% trans "My Groups" %}

@@ -7,9 +7,9 @@ {% for group in groups %}
  • - {{ group.props.group_name }}的图标 + {{ group.props.group_name }} - {{ group.props.group_name }} + {{ group.props.group_name|trim:12 }}
  • {% endfor %}