Add subscribe/unsubscribe button
This commit is contained in:
@@ -6,11 +6,24 @@ Threads
|
||||
|
||||
{% block content %}
|
||||
<h1>{% if thread.private %}🔒 {% endif %}{{ thread.title }}</h1>
|
||||
{% if thread.package or current_user.is_authenticated %}
|
||||
{% if thread.package %}
|
||||
<p>Package: <a href="{{ thread.package.getDetailsURL() }}">{{ thread.package.title }}</a></p>
|
||||
{% endif %}
|
||||
|
||||
{% if thread.package %}
|
||||
<p>
|
||||
Package: <a href="{{ thread.package.getDetailsURL() }}">{{ thread.package.title }}</a>
|
||||
</p>
|
||||
{% if current_user.is_authenticated %}
|
||||
{% if current_user in thread.watchers %}
|
||||
<form method="post" action="{{ thread.getUnsubscribeURL() }}">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
|
||||
<input type="submit" value="Unsubscribe" />
|
||||
</form>
|
||||
{% else %}
|
||||
<form method="post" action="{{ thread.getSubscribeURL() }}">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
|
||||
<input type="submit" value="Subscribe" />
|
||||
</form>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% if thread.private %}
|
||||
|
||||
Reference in New Issue
Block a user