]> git.ipfire.org Git - ipfire.org.git/commitdiff
people: Make SIP status link clickable for admins
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 17 Oct 2018 13:18:21 +0000 (14:18 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 17 Oct 2018 15:12:45 +0000 (16:12 +0100)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/templates/people/modules/sip-status.html

index ab4b93122b93c153e3f5015463c7f43c92c2c081..abb7f8171477a1d8a7db0668b4e73925efcc0838 100644 (file)
@@ -1,11 +1,25 @@
 {% if account.sip_channels %}
-    <a class="text-warning" href="/users/{{ account.uid }}/sip">
-        {{ _("On The Phone") }} ({{ len(account.sip_registrations) }})
-    </a>
+    {% if account.can_be_managed_by(current_user) %}
+        <a class="text-warning" href="/users/{{ account.uid }}/sip">
+            {{ _("On The Phone") }}
+        </a>
+    {% else %}
+        <span class="text-warning">{{ _("On The Phone") }}</span>
+    {% end %}
 {% elif account.sip_registrations %}
-    <a class="text-success" href="/users/{{ account.uid }}/sip">
-        {{ _("Online") }} ({{ len(account.sip_registrations) }})
-    </a>
+    {% if account.can_be_managed_by(current_user) %}
+        <a class="text-success" href="/users/{{ account.uid }}/sip">
+            {{ _("Online") }} ({{ len(account.sip_registrations) }})
+        </a>
+    {% else %}
+        <span class="text-success">{{ _("Online") }}</span>
+    {% end %}
 {% else %}
-    <span class="text-danger">{{ _("Offline") }}</span>
+    {% if account.can_be_managed_by(current_user) %}
+        <a class="text-danger" href="/users/{{ account.uid }}/sip">
+            {{ _("Offline") }}
+        </a>
+    {% else %}
+        <span class="text-danger">{{ _("Offline") }}</span>
+    {% end %}
 {% end %}