summaryrefslogtreecommitdiff
path: root/src/application/templates/bootstrap-3/view_topic.twig
diff options
context:
space:
mode:
Diffstat (limited to 'src/application/templates/bootstrap-3/view_topic.twig')
-rw-r--r--src/application/templates/bootstrap-3/view_topic.twig40
1 files changed, 34 insertions, 6 deletions
diff --git a/src/application/templates/bootstrap-3/view_topic.twig b/src/application/templates/bootstrap-3/view_topic.twig
index 383dd41..7009afc 100644
--- a/src/application/templates/bootstrap-3/view_topic.twig
+++ b/src/application/templates/bootstrap-3/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" %}
@@ -178,30 +184,40 @@
{{ ctx.topic.title }}
<div class="pull-right text-normal">
{% if canEdit and not ctx.topic.isLocked %}
- <button id="btn-edit-title" class="btn btn-default js-only"><span class="fa fa-pencil" aria-hidden="true"></span> {{ __("Edit title") }}</button>
+ <button id="btn-edit-title" class="btn btn-default btn-xs js-only"><span class="fa fa-pencil" aria-hidden="true"></span> {{ __("Edit title") }}</button>
{% endif %}
{% if canReply %}
- <button id="btn-reply" class="btn btn-default js-only"><span class="fa fa-comment" aria-hidden="true"></span> {{ __("Reply") }}</button>
+ <button id="btn-reply" class="btn btn-default btn-xs js-only"><span class="fa fa-comment" aria-hidden="true"></span> {{ __("Reply") }}</button>
+ {% endif %}
+ {% if canSubscribe %}
+ <form action="?_action=subscribetopic" method="post" class="seamless-inline">
+ <input type="hidden" name="topic" value="{{ ctx.topic.id }}">
+ {% if isSubscribed %}
+ <button type="submit" class="btn btn-xs btn-default"><span class="fa fa-bell-slash" aria-hidden="true"></span> {{ __("Unsubscribe from topic") }}</button>
+ {% else %}
+ <button type="submit" class="btn btn-xs btn-default"><span class="fa fa-bell" aria-hidden="true"></span> {{ __("Subscribe to topic") }}</button>
+ {% endif %}
+ </form>
{% endif %}
{% if canEdit %}
{% if ctx.topic.isLocked %}
<form action="?_action=locktopic" method="post" class="seamless-inline">
<input type="hidden" name="topic" value="{{ ctx.topic.id }}">
<input type="hidden" name="locked" value="false">
- <button type="submit" class="btn btn-success"><span class="fa fa-unlock" aria-hidden="true"></span> {{ __("Unlock topic") }}</button>
+ <button type="submit" class="btn btn-success btn-xs"><span class="fa fa-unlock" aria-hidden="true"></span> {{ __("Unlock topic") }}</button>
</form>
{% else %}
<form action="?_action=locktopic" method="post" class="seamless-inline">
<input type="hidden" name="topic" value="{{ ctx.topic.id }}">
<input type="hidden" name="locked" value="true">
- <button type="submit" class="btn btn-warning"><span class="fa fa-lock" aria-hidden="true"></span> {{ __("Lock topic") }}</button>
+ <button type="submit" class="btn btn-warning btn-xs"><span class="fa fa-lock" aria-hidden="true"></span> {{ __("Lock topic") }}</button>
</form>
{% endif %}
{% endif %}
{% if canDelete %}
<form action="?_action=deletetopic" method="post" class="seamless-inline">
<input type="hidden" name="topic" value="{{ ctx.topic.id }}">
- <button type="submit" class="btn btn-danger"><span class="fa fa-trash" aria-hidden="true"></span> {{ __("Delete topic") }}</button>
+ <button type="submit" class="btn btn-danger btn-xs"><span class="fa fa-trash" aria-hidden="true"></span> {{ __("Delete topic") }}</button>
</form>
{% endif %}
</div>
@@ -209,7 +225,14 @@
{{ __("Started by %user% on %date%", {
"user": (ctx.topicAuthor is not null) ? ('<a href="?_action=viewuser&amp;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>',
- }) }}
+ }) }} &bull; {{ ___(
+ "%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="form-inline seamless-inline">
@@ -351,6 +374,11 @@ $(function() {
}) }}</label>
<input type="file" name="files[]" id="i_files" multiple accept="*/*">
</div>
+ {% if not isSubscribed %}
+ <div class="checkbox">
+ <label><input type="checkbox" name="subscribe" value="on" checked> {{ __("Subscribe to topic") }}</label>
+ </div>
+ {% endif %}
<button type="submit" class="btn btn-success">{{ __("Post reply") }} <span class="fa fa-send" aria-hidden="true"></span></button>
</form>
{% else %}