From a4895f06680beaf447ed43ee326423fcc8232815 Mon Sep 17 00:00:00 2001 From: Olivier Keun Date: Fri, 22 Jul 2011 16:25:57 +0200 Subject: News frontpage layout changes Signed-off-by: Dan McGee --- public/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'public/views.py') diff --git a/public/views.py b/public/views.py index 46291b88..e3f3b02f 100644 --- a/public/views.py +++ b/public/views.py @@ -13,7 +13,7 @@ from django.views.generic.simple import direct_to_template def index(request): pkgs = utils.get_recent_updates() context = { - 'news_updates': News.objects.order_by('-postdate', '-id')[:10], + 'news_updates': News.objects.order_by('-postdate', '-id')[:15], 'pkg_updates': pkgs, } return direct_to_template(request, 'public/index.html', context) -- cgit v1.2.3-2-g168b From 6b15298483db6be873edc72c3e96fd5668a3cbc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20B=C3=A4chler?= Date: Fri, 19 Aug 2011 19:38:17 +0200 Subject: download: add link to the ISO snapshots Dan: use relative links if possible, use releng link from settings, fix HTML closing tags. Signed-off-by: Dan McGee --- public/views.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'public/views.py') diff --git a/public/views.py b/public/views.py index e3f3b02f..821e4d5c 100644 --- a/public/views.py +++ b/public/views.py @@ -3,6 +3,7 @@ from mirrors.models import MirrorUrl from news.models import News from . import utils +from django.conf import settings from django.contrib.auth.models import User from django.db.models import Q from django.http import Http404 @@ -59,10 +60,14 @@ def download(request): protocol__is_download=True, mirror__public=True, mirror__active=True, mirror__isos=True ) + context = { + 'releng_iso_url': settings.ISO_LIST_URL, + } return list_detail.object_list(request, qset.order_by('mirror__country', 'mirror__name', 'protocol'), template_name="public/download.html", - template_object_name="mirror_url") + template_object_name="mirror_url", + extra_context=context) def feeds(request): context = { -- cgit v1.2.3-2-g168b From 71e57570c262fffb11ca6e0dc97342119198f740 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Tue, 11 Oct 2011 19:29:15 -0500 Subject: Pylint suggested and other cleanups Signed-off-by: Dan McGee --- public/views.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'public/views.py') diff --git a/public/views.py b/public/views.py index 821e4d5c..14dd6353 100644 --- a/public/views.py +++ b/public/views.py @@ -5,7 +5,6 @@ from . import utils from django.conf import settings from django.contrib.auth.models import User -from django.db.models import Q from django.http import Http404 from django.views.generic import list_detail from django.views.generic.simple import direct_to_template @@ -34,18 +33,18 @@ USER_LISTS = { }, } -def userlist(request, type='devs'): +def userlist(request, user_type='devs'): users = User.objects.order_by('username').select_related('userprofile') - if type == 'devs': + if user_type == 'devs': users = users.filter(is_active=True, groups__name="Developers") - elif type == 'tus': + elif user_type == 'tus': users = users.filter(is_active=True, groups__name="Trusted Users") - elif type == 'fellows': + elif user_type == 'fellows': users = users.filter(is_active=False, groups__name__in=["Developers", "Trusted Users"]) else: raise Http404 - context = USER_LISTS[type].copy() + context = USER_LISTS[user_type].copy() context['users'] = users return direct_to_template(request, 'public/userlist.html', context) -- cgit v1.2.3-2-g168b From 85657db05d7f65604340699cfcb9967c9e81a0ef Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Mon, 21 Nov 2011 10:08:23 -0600 Subject: Better support for non-latin full names Add a 'latin_name' field to the user profile so we can better support those developers with names in non-Latin scripts, and yet still show a Latin name as necessary on the developer profile page. This field only shows up if populated. Also, use consistent sorting everywhere- rather than using username, always use first_name and last_name fields. Signed-off-by: Dan McGee --- public/views.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'public/views.py') diff --git a/public/views.py b/public/views.py index 14dd6353..c28fd303 100644 --- a/public/views.py +++ b/public/views.py @@ -34,13 +34,15 @@ USER_LISTS = { } def userlist(request, user_type='devs'): - users = User.objects.order_by('username').select_related('userprofile') + users = User.objects.order_by( + 'first_name', 'last_name').select_related('userprofile') if user_type == 'devs': users = users.filter(is_active=True, groups__name="Developers") elif user_type == 'tus': users = users.filter(is_active=True, groups__name="Trusted Users") elif user_type == 'fellows': - users = users.filter(is_active=False, groups__name__in=["Developers", "Trusted Users"]) + users = users.filter(is_active=False, + groups__name__in=["Developers", "Trusted Users"]) else: raise Http404 -- cgit v1.2.3-2-g168b