diff options
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 %} |