]> git.ipfire.org Git - ipfire.org.git/commitdiff
people: Move SIP status into phone number block
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 19 Nov 2020 16:46:59 +0000 (16:46 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 19 Nov 2020 16:46:59 +0000 (16:46 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Makefile.am
src/templates/people/base.html
src/templates/people/modules/sip-status.html [deleted file]
src/templates/people/user.html
src/web/__init__.py
src/web/people.py

index 39a36b4f39b04c05714d02e72e715e4dd10a5c99..98da537127b19ab8dfd2fd7fad299f012e5fba83 100644 (file)
@@ -302,8 +302,7 @@ templates_people_modules_DATA = \
        src/templates/people/modules/mos.html \
        src/templates/people/modules/password.html \
        src/templates/people/modules/password.js \
-       src/templates/people/modules/registrations.html \
-       src/templates/people/modules/sip-status.html
+       src/templates/people/modules/registrations.html
 
 templates_people_modulesdir = $(templates_peopledir)/modules
 
index e8f7ef9c159a19ab84a1038d1c22346cbbac4378..34b56a5559ad90bd3f3463caa5bd04cd0ecb8fb0 100644 (file)
                                        <span class="text-monospace">{{ account.uid }}</span>
                                </div>
 
-                               {% if current_user.is_staff() and account.has_sip() %}
-                                       <h5>
-                                               {{ account.sip_id }}
-
-                                               <small class="ml-2">
-                                                       {% module SIPStatus(account) %}
-                                               </small>
-                                       </h5>
-                               {% end %}
-
                                <div class="btn-toolbar mb-3">
                                        {% if account.has_shell() %}
                                                <a class="btn btn-light btn-sm btn-block" href="/~{{ account.uid }}/">
diff --git a/src/templates/people/modules/sip-status.html b/src/templates/people/modules/sip-status.html
deleted file mode 100644 (file)
index 1b2228a..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-{% if account.sip_channels %}
-    {% 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 %}
-    {% 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 %}
-{% elif account.uses_sip_forwarding() %}
-    {% if account.can_be_managed_by(current_user) %}
-        <a class="text-success" href="/users/{{ account.uid }}/sip">
-            {{ _("Forwarded") }}
-        </a>
-    {% else %}
-        <span class="text-success">{{ _("Forwarded") }}</span>
-    {% end %}
-{% else %}
-    {% 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 %}
index 313994ce408a4d6da39733dd083506e3196ff526..8ff9737022ef6fc7dc3878a74c2f92f1bcca3e3b 100644 (file)
                                                        <h6>{{ _("Phone Numbers") }}</h6>
 
                                                        <ul class="list-unstyled">
+                                                               {% if account.has_sip() %}
+                                                                       <li>
+                                                                               {% if account.sip_channels %}
+                                                                                       <i class="fas fa-phone-volume text-warning fa-fw"></i>
+                                                                               {% elif account.sip_registrations %}
+                                                                                       <i class="fas fa-phone-square text-success fa-fw"></i>
+                                                                               {% elif account.uses_sip_forwarding() %}
+                                                                                       <i class="fas fa-phone-square text-warning fa-fw"></i>
+                                                                               {% else %}
+                                                                                       <i class="fas fa-phone-square text-danger fa-fw"></i>
+                                                                               {% end %}
+
+                                                                               <a href="sip:{{ account.sip_url }}">{{ account.sip_id }}</a>
+                                                                       </li>
+                                                               {% end %}
+
                                                                {% if account.phone_number %}
                                                                        <li>
-                                                                               <i class="fas fa-phone"></i>
+                                                                               <i class="fas fa-phone fa-fw"></i>
 
                                                                                <a href="tel:{{ format_phone_number_to_e164(account.phone_number) }}">
                                                                                        {{ format_phone_number(account.phone_number) }}
 
                                                                {% if account.fax_number %}
                                                                        <li>
-                                                                               <i class="fas fa-fax"></i>
+                                                                               <i class="fas fa-fax fa-fw"></i>
 
                                                                                <a href="fax:{{ format_phone_number_to_e164(account.fax_number) }}">
                                                                                        {{ format_phone_number(account.fax_number) }}
                                                                {% for number in account.phone_numbers %}
                                                                        <li>
                                                                                {% if phonenumbers.number_type(number) == phonenumbers.PhoneNumberType.MOBILE %}
-                                                                                       <i class="fas fa-mobile" title="{{ _("Mobile") }}"></i>
+                                                                                       <i class="fas fa-mobile fa-fw" title="{{ _("Mobile") }}"></i>
                                                                                {% else %}
-                                                                                       <i class="fas fa-phone"></i>
+                                                                                       <i class="fas fa-phone fa-fw"></i>
                                                                                {% end %}
 
                                                                                <a href="tel:{{ format_phone_number_to_e164(number) }}"
index 5bf19dd14467aa1da2416b738be3bcaf379e9cf9..fd5f801642282c59d8dbcd82808877841ad2e0a5 100644 (file)
@@ -81,7 +81,6 @@ class Application(tornado.web.Application):
                                "NewAccounts"          : people.NewAccountsModule,
                                "Password"             : people.PasswordModule,
                                "Registrations"        : people.RegistrationsModule,
-                               "SIPStatus"            : people.SIPStatusModule,
 
                                # Nopaste
                                "Code"                 : nopaste.CodeModule,
index 6c31a82e85109c2fd7ae0e904499b5c915b3e775..9622aca347aed00b334381e8e617cf718b0691a9 100644 (file)
@@ -509,8 +509,3 @@ class PasswordModule(ui_modules.UIModule):
 class RegistrationsModule(ui_modules.UIModule):
        def render(self, account):
                return self.render_string("people/modules/registrations.html", account=account)
-
-
-class SIPStatusModule(ui_modules.UIModule):
-       def render(self, account):
-               return self.render_string("people/modules/sip-status.html", account=account)