add edit link to authors
This commit is contained in:
parent
36e0cd797c
commit
4345e289e8
1 changed files with 14 additions and 1 deletions
|
@ -28,7 +28,20 @@
|
|||
</span>
|
||||
{% if post.is_editable_by(request.user) %}
|
||||
<span> [<a href="{{ url('admin:judge_blogpost_change', post.id) }}">{{ _('Edit') }}</a>]</span>
|
||||
{% else %}
|
||||
{% for author in post.authors.all() %}
|
||||
{% if author.user == request.user %}
|
||||
{% for post_org in post.organizations.all() %}
|
||||
{% for org in author.organizations.all() %}
|
||||
{% if org == post_org %}
|
||||
<span> [<a href="{{ url('edit_organization_blog', org.id , org.slug , post.id) }}">{{ _('Edit') }}</a>]</span>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
<div class="body content-description">
|
||||
{% cache 86400 'post_content' post.id MATH_ENGINE %}
|
||||
|
|
Loading…
Reference in a new issue