]> git.ipfire.org Git - ipfire.org.git/commitdiff
people: Only show registrations table when registrations exist
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 17 Oct 2018 13:22:19 +0000 (14:22 +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/registrations.html
src/templates/people/sip.html

index 0143b389c1944df2641e03ca59c6d87e73bc2549..2b3799e00ed76266bc3b964fe8b2a84035a12497 100644 (file)
@@ -1,17 +1,25 @@
-<table class="table table-sm mb-0">
-       <tbody>
-               {% for reg in account.sip_registrations %}
-                       <tr>
-                               <td>{{ reg.user_agent }}</td>
-                               <td>{{ reg.protocol }}/{{ reg.network_ip }}:{{ reg.network_port }}</td>
-                               <td class="text-right">
-                                       {% if reg.is_reachable() and reg.latency %}
-                                               {{ "%.2f ms" % reg.latency }}
-                                       {% else %}
-                                               <span class="text-muted">{{ _("N/A") }}</span>
+{% if account.sip_registrations %}
+       <div class="card mb-3">
+               <div class="card-body">
+                       <h6 class="card-title">{{ _("Active Registrations") }}</h6>
+
+                       <table class="table table-sm mb-0">
+                               <tbody>
+                                       {% for reg in account.sip_registrations %}
+                                               <tr>
+                                                       <td>{{ reg.user_agent }}</td>
+                                                       <td>{{ reg.protocol }}/{{ reg.network_ip }}:{{ reg.network_port }}</td>
+                                                       <td class="text-right">
+                                                               {% if reg.is_reachable() and reg.latency %}
+                                                                       {{ "%.2f ms" % reg.latency }}
+                                                               {% else %}
+                                                                       <span class="text-muted">{{ _("N/A") }}</span>
+                                                               {% end %}
+                                                       </td>
+                                               </tr>
                                        {% end %}
-                               </td>
-                       </tr>
-               {% end %}
-       </tbody>
-</table>
+                               </tbody>
+                       </table>
+               </div>
+       </div>
+{% end %}
index 8276ba7743c55cf1faedaf666421117fda6176de..eaf24e50c5d877f39b8ed20abbc02db7ecfa275a 100644 (file)
@@ -5,15 +5,7 @@
 {% block main %}
        {% module Channels(account) %}
 
-       <div class="card mb-3">
-               <div class="card-body">
-                       <h6 class="card-title">
-                               {{ _("Active SIP Registrations") }}
-                       </h6>
-
-                       {% module Registrations(account) %}
-               </div>
-       </div>
+       {% module Registrations(account) %}
 
        <div class="card">
                <div class="card-body">