This repository has been archived by the owner on Jun 29, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
スターテンプレートの修正と Persona.get_absolute_url の修正
- Loading branch information
1 parent
40d6a3c
commit 5c38b2e
Showing
3 changed files
with
13 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
<li class="star" star-id="{{ star.pk }}" star-quote="{{ star.quote }}" rel="tooltip" data-toggle="tooltip" title="{{ star.tooltip_text }}"> | ||
<div class="star-user"> | ||
<a href="{{ star.author.get_absolute_url }}"> | ||
<a href="{{ star.author.profile.get_absolute_url }}"> | ||
<img class="avatar avatar-small" src="{{ star.author.get_small_avatar }}"> | ||
{% if user has 'stars.star_delete' of star %} | ||
{# allowed_to_delete_starはstar_container.htmlから渡され、このスター郡が付加されているオブジェクトの編集権限をユーザが持っている場合にTrueとなる #} | ||
{# また SQL や メソッドの呼び出しを極力少なくするためにまずスターの所有者をチェックしてからパーミッションチェックを行なっている #} | ||
{% if allowed_to_delete_star or star.author == user and user has 'stars.delete_star' of star %} | ||
<a href="#" class="star-remove" style="display: none;"><span class="glyphicon glyphicon-remove"></span></a> | ||
{% endif %} | ||
</a> | ||
</div> | ||
</li> | ||
</li> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters