Skip to content

Commit

Permalink
Modal of likers (#552)
Browse files Browse the repository at this point in the history
  • Loading branch information
mohitanand001 authored and jajodiaraghav committed Sep 8, 2017
1 parent d67451a commit a83b85c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
24 changes: 24 additions & 0 deletions website/templates/issue.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,32 @@ <h3 class="page-header">
</div>
</h3>
<strong>Domain:</strong>

<a href="{{object.url}}" target="_new" class="issue-domain">{{object.url}}</a>
<div class="pull-right">
<a href="#loginx" data-toggle="modal">Liked By</a>

<div id="loginx" class="modal" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-body">
<h3>Liked by:</h3>
{% for usr in likers %}
<div class="list-group-item">
{% if usr.user.socialaccount_set.all.0.get_avatar_url %}
<img src="{{usr.user.socialaccount_set.all.0.get_avatar_url}}" height="50px">
{% else %}
<img src="{% gravatar_url usr.user.email 50 %}">
{% endif %}
<a href="/profile/{{usr.user.username}}">{{usr.user.username}}</a>
</div>
{% endfor %}
</div>
</div>
</div>
</div>


<button class="btn btn-primary btn-xs copy-btn" data-clipboard-text="{{object.description}}">
<i class="glyphicon glyphicon-copy"></i> Copy Title
</button>
Expand Down
1 change: 1 addition & 0 deletions website/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,7 @@ def get_context_data(self, **kwargs):
context['all_comment'] = self.object.comments.all
context['all_users'] = User.objects.all()
context['likes'] = UserProfile.objects.filter(issue_upvoted=self.object).count()
context['likers'] = UserProfile.objects.filter(issue_upvoted=self.object)
return context


Expand Down

0 comments on commit a83b85c

Please sign in to comment.