diff --git a/bugheist/urls.py b/bugheist/urls.py index 5f0729362..90628e6da 100644 --- a/bugheist/urls.py +++ b/bugheist/urls.py @@ -23,6 +23,7 @@ url(r'^like_issue/(?P\d+)/$', website.views.like_issue,name="like_issue"), url(r'^issue/edit/$', website.views.IssueEdit), url(r'^issue/update/$', website.views.UpdateIssue), + url(r'^like_issue/(?P\w+)/$', website.views.follower_list,name="follower_list"), url(r'^issue/(?P\w+)/$', IssueView.as_view(), name="issue_view"), url(r'^follow_user/(?P[^/]+)/', website.views.follow_user,name="follow_user"), url(r'^all_activity/$', AllIssuesView.as_view(), name="all_activity"), diff --git a/website/templates/follower_list.html b/website/templates/follower_list.html new file mode 100644 index 000000000..ab7c82219 --- /dev/null +++ b/website/templates/follower_list.html @@ -0,0 +1,23 @@ +{% extends "base.html" %} +{% load gravatar %} +{% load staticfiles %} +{% load humanize %} + +{% block content %} +
+

Followers:

+
+ {% for user in followers %} +
+ {% if user.socialaccount_set.all.0.get_avatar_url %} + + {% else %} + + {% endif %} + {{user.username}} +
+ {% endfor %} +
+
+ +{% endblock %} \ No newline at end of file diff --git a/website/templates/followers.html b/website/templates/followers.html index d18077e64..e105ce48a 100644 --- a/website/templates/followers.html +++ b/website/templates/followers.html @@ -19,5 +19,5 @@

Following: {{ follows }}

-

Followed by: {{ followed_by }}

+

Followed by: {{ followed_by }}

\ No newline at end of file diff --git a/website/views.py b/website/views.py index 28279d9a3..552d0c663 100644 --- a/website/views.py +++ b/website/views.py @@ -901,3 +901,13 @@ def like_issue(request,issue_pk): context['object'] = issue context['likes'] = total_votes return render(request,'likers.html',context) +def follower_list(request,username): + user = User.objects.get(username=username) + context={} + lis = [] + prof_list = user.userprofile.follower.all() + for userprofile in prof_list: + user = User.objects.get(username=str(userprofile.user)) + lis.append(user) + context['followers'] = lis + return render(request,'follower_list.html',context) \ No newline at end of file