aboutsummaryrefslogtreecommitdiff
path: root/app/templates/threads
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2018-07-28 15:30:59 +0100
committerrubenwardy <rw@rubenwardy.com>2018-07-28 15:30:59 +0100
commite82166f87e89f329e9fd94a26dfc8651c69deb91 (patch)
tree43fc3c193295dba4d6c235d0910b8999ae85a93b /app/templates/threads
parent909a2b4ce9ffd325fff06cc26d996c19ca117aa6 (diff)
downloadcheatdb-e82166f87e89f329e9fd94a26dfc8651c69deb91.tar.xz
Add subscribe/unsubscribe button
Diffstat (limited to 'app/templates/threads')
-rw-r--r--app/templates/threads/view.html21
1 files changed, 17 insertions, 4 deletions
diff --git a/app/templates/threads/view.html b/app/templates/threads/view.html
index 397fba3..71580de 100644
--- a/app/templates/threads/view.html
+++ b/app/templates/threads/view.html
@@ -6,11 +6,24 @@ Threads
{% block content %}
<h1>{% if thread.private %}&#x1f512; {% 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 %}