# HG changeset patch # User anoop # Date 1265305755 -19800 # Node ID e137b605b8880dce74100a2196a442ddb08861c8 # Parent 8d52492d3c145beacb674e1d0ff957675495855d added browse users functionality, added user/browse.html, fixed view my profile template. diff -r 8d52492d3c14 -r e137b605b888 taskapp/views/user.py --- a/taskapp/views/user.py Thu Feb 04 23:17:59 2010 +0530 +++ b/taskapp/views/user.py Thu Feb 04 23:19:15 2010 +0530 @@ -128,3 +128,7 @@ profile = Profile.objects.get(user = request.user) edit_profile_form = UserProfileEditForm(instance = profile) return render_to_response('user/edit_profile.html',{'edit_profile_form' : edit_profile_form}) + +def browse_users(request): + userlist = User.objects.order_by('username') + return render_to_response('user/browse.html',{'userlist':userlist}) diff -r 8d52492d3c14 -r e137b605b888 templates/user/browse.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/templates/user/browse.html Thu Feb 04 23:19:15 2010 +0530 @@ -0,0 +1,7 @@ +{% extends 'base.html' %} +{% block content %} + List of all the users:
+ {% for user in userlist %} + {{ user.username }}
+ {% endfor %} +{% endblock %} diff -r 8d52492d3c14 -r e137b605b888 templates/user/edit_profile.html --- a/templates/user/edit_profile.html Thu Feb 04 23:17:59 2010 +0530 +++ b/templates/user/edit_profile.html Thu Feb 04 23:19:15 2010 +0530 @@ -1,7 +1,7 @@ {% extends 'base.html' %} {% block content %} -
-{{ edit_profile_form.as_p }} - -
+
+ {{ edit_profile_form.as_p }} + +
{% endblock %} diff -r 8d52492d3c14 -r e137b605b888 templates/user/my_profile.html --- a/templates/user/my_profile.html Thu Feb 04 23:17:59 2010 +0530 +++ b/templates/user/my_profile.html Thu Feb 04 23:19:15 2010 +0530 @@ -7,11 +7,12 @@ {% block content %} -

{{ profile }}'s Profile


+

{{ profile }}'s Profile

+
{% if edit_profile %} edit profile +
{% endif %} -
{% if profile.aboutme %}

About Me


{{ profile.aboutme }} {% endif %} diff -r 8d52492d3c14 -r e137b605b888 urls.py --- a/urls.py Thu Feb 04 23:17:59 2010 +0530 +++ b/urls.py Thu Feb 04 23:19:15 2010 +0530 @@ -4,7 +4,7 @@ from django.contrib import admin admin.autodiscover() -from pytask.taskapp.views.user import homepage, register, user_login, user_logout, view_my_profile, edit_my_profile +from pytask.taskapp.views.user import homepage, register, user_login, user_logout, view_my_profile, edit_my_profile, browse_users from pytask.taskapp.views.task import browse_tasks, view_task, create_task, add_mentor, add_tasks, claim_task, assign_task urlpatterns = patterns('', @@ -33,5 +33,5 @@ (r'^user/view/uid=(\d+)$', view_my_profile), (r'^user/edit/?$', edit_my_profile), - + (r'^user/browse/?$',browse_users), )