Skip to content

Commit

Permalink
Hide post form and create thread button when not logged in
Browse files Browse the repository at this point in the history
  • Loading branch information
shakedown-street committed Jun 19, 2024
1 parent 0b61fb2 commit b838f81
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions punkweb_bb/templates/punkweb_bb/subcategory.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ <h1>{{subcategory.name}}</h1>
{% endif %}
</div>

{% if request.user.is_authenticated %}
{% if subcategory|can_post:request.user %}
<a class="pw-button ghost primary" href="{% url 'punkweb_bb:thread_create' subcategory.slug %}">Create Thread</a>
{% else %}
Expand All @@ -64,6 +65,7 @@ <h1>{{subcategory.name}}</h1>
Create Thread
</button>
{% endif %}
{% endif %}
</div>

<div class="pw-card fluid mb-4">
Expand Down
2 changes: 2 additions & 0 deletions punkweb_bb/templates/punkweb_bb/thread.html
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ <h1>{{thread.title}}</h1>

{% include 'punkweb_bb/components/pagination_controls.html' with paginator=posts %}

{% if request.user.is_authenticated %}
{% if thread|can_post:request.user %}
<div class="pw-card fluid mt-4">
<div class="pw-card-header">Reply to thread</div>
Expand All @@ -259,5 +260,6 @@ <h1>{{thread.title}}</h1>
</div>
</div>
{% endif %}
{% endif %}

{% endblock %}

0 comments on commit b838f81

Please sign in to comment.