diff options
author | Jonas Kohl | 2024-12-26 20:12:34 +0100 |
---|---|---|
committer | Jonas Kohl | 2024-12-26 20:12:34 +0100 |
commit | 686fff945e0b4697aa74da404ce90534bb7b121d (patch) | |
tree | cb5582c8d118cb480f2978fa821950f4a2259401 /src/application/templates/old | |
parent | 11fed2c8ce3dd38fe686e7b27db738f64373fe3d (diff) |
Add async email and topic subscribingv0.7.2
Diffstat (limited to 'src/application/templates/old')
-rw-r--r-- | src/application/templates/old/view_topic.twig | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/src/application/templates/old/view_topic.twig b/src/application/templates/old/view_topic.twig index 613de49..70d0d67 100644 --- a/src/application/templates/old/view_topic.twig +++ b/src/application/templates/old/view_topic.twig @@ -30,6 +30,12 @@ or currentUser.hasPermission(permission("DELETE_OTHER_TOPIC")) ) %} +{% set canSubscribe = currentUser is not null %} + +{% set isSubscribed = + currentUser is not null + and ctx.subscription is not null %} + {% set title = ctx.topic.title %} {% extends "base.twig" %} @@ -76,6 +82,16 @@ #}</form> {%- endif -%} {%- endif -%} + {%- if canSubscribe -%} + <form action="?_action=subscribetopic" method="post" class="inline">{# + #}<input type="hidden" name="topic" value="{{ ctx.topic.id }}"> + {%- if isSubscribed -%} + <button type="submit" class="seamless m-r"><img src="/ui/theme-files/old/unsubscribe.gif" width="16" height="16" draggable="false" alt="{{ __("Unsubscribe from topic") }}"></button> + {%- else -%} + <button type="submit" class="seamless m-r"><img src="/ui/theme-files/old/subscribe.gif" width="16" height="16" draggable="false" alt="{{ __("Subscribe to topic") }}"></button> + {%- endif -%} + </form> + {%- endif -%} {%- if canDelete -%} <form action="?_action=deletetopic" method="post" class="inline">{# #}<input type="hidden" name="topic" value="{{ ctx.topic.id }}">{# @@ -87,7 +103,14 @@ {{ __("Started by %user% on %date%", { "user": (ctx.topicAuthor is not null) ? ('<a href="?_action=viewuser&user=' ~ ctx.topicAuthor.id|url_encode|e("html") ~ '">' ~ ctx.topicAuthor.displayName|e("html") ~ '</a>') : __("(deleted)"), "date": '<span class="_time">' ~ ctx.topic.creationDate.format("c")|e("html") ~ '</span>', - }) }} + }) }} • {{ ___( + "%n% person is watching this topic", + "%n% people are watching this topic", + ctx.subscription_count, + { + n: ctx.subscription_count, + }, + ) }} </div> {% if canEdit %} <form action="?_action=updatetopic" method="post" id="editHeading" style="display: none;" class="inline"> @@ -216,6 +239,10 @@ $(function() { }) }}</label><br> <input type="file" name="files[]" id="i_files" multiple accept="*/*"><br> <br> + {% if not isSubscribed %} + <label><input type="checkbox" name="subscribe" value="on" checked> {{ __("Subscribe to topic") }}</label><br> + <br> + {% endif %} <button type="submit">{{ __("Post reply") }}</button> </form> {% else %} |