mirror of
https://gitlab.com/tildes/tildes.git
synced 2026-04-16 06:18:34 +02:00
Hide "View Markdown" when user can edit the post
If a user can edit a post, they don't need the ability to view the markdown separately, so the button doesn't need to be shown in those cases. I'm not sure if this should be a separate permission defined inside the ACL or not.
This commit is contained in:
@@ -202,6 +202,8 @@
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
{# Don't show the "View Markdown" button (or dropdown) if the user can edit #}
|
||||
{% if not request.has_permission("edit", comment) %}
|
||||
<li>
|
||||
<div class="dropdown dropdown-right">
|
||||
<button class="btn-post-action dropdown-toggle">
|
||||
@@ -222,6 +224,7 @@
|
||||
</menu>
|
||||
</div>
|
||||
</li>
|
||||
{% endif %}
|
||||
</menu>
|
||||
<div class="btn-post-settings"></div>
|
||||
{% endif %}
|
||||
|
||||
@@ -173,7 +173,11 @@
|
||||
{{ post_action_toggle_button("remove", topic, topic.is_removed) }}
|
||||
{% endif %}
|
||||
|
||||
{% if topic.is_text_type and request.has_permission("view_content", topic) %}
|
||||
{# Only show "View Markdown" (and dropdown) when it's a text topic and the user is
|
||||
allowed to view the content, but can't edit it #}
|
||||
{% if topic.is_text_type
|
||||
and request.has_permission("view_content", topic)
|
||||
and not request.has_permission("edit", topic) %}
|
||||
<li>
|
||||
<div class="dropdown dropdown-right">
|
||||
<button class="btn-post-action dropdown-toggle">
|
||||
|
||||
Reference in New Issue
Block a user