# HG changeset patch # User verrierj # Date 1326275803 -3600 # Node ID 271235724f542f0bef94df6059ca6e46db191aec # Parent 20a702b86b0462f6307397f8fc4fb8672e843a2a Front page displays real annotation numbers diff -r 20a702b86b04 -r 271235724f54 src/ldt/ldt/ldt_utils/templates/front/front_home.html --- a/src/ldt/ldt/ldt_utils/templates/front/front_home.html Wed Jan 11 10:35:47 2012 +0100 +++ b/src/ldt/ldt/ldt_utils/templates/front/front_home.html Wed Jan 11 10:56:43 2012 +0100 @@ -19,7 +19,7 @@ {% for content in last_contents %}
{% trans 'by' %} IRI | {{content.duration_str}}
{% trans 'by' %} IRI | {{content.duration_str}}
{% if group.profile.description|length > 69 %}{{group.profile.description|safe|slice:":69"}}...{% else %}{{group.profile.description|safe}}{% endif %}
diff -r 20a702b86b04 -r 271235724f54 src/ldt/ldt/ldt_utils/views/front.py --- a/src/ldt/ldt/ldt_utils/views/front.py Wed Jan 11 10:35:47 2012 +0100 +++ b/src/ldt/ldt/ldt_utils/views/front.py Wed Jan 11 10:56:43 2012 +0100 @@ -7,15 +7,14 @@ from django.template import RequestContext from guardian.shortcuts import get_objects_for_group from ldt.ldt_utils.models import Content, Project -from ldt.security.utils import add_change_attr @login_required def front_home(request): # Get the 3 last annotated contents - last_contents = Content.objects.all()[:3] + last_contents = Content.objects.order_by('-content_creation_date')[:3] # Get the most annotated contents - most_contents = Content.objects.all()[4:12] + most_contents = Content.objects.order_by('-nb_annotation')[:8] # Get the active groups active_groups = Group.objects.exclude(name=settings.PUBLIC_GROUP_NAME)[:5]