]> git.ipfire.org Git - ipfire.org.git/commitdiff
talk: Drop old modules
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 10 Oct 2018 14:56:37 +0000 (15:56 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 10 Oct 2018 14:57:49 +0000 (15:57 +0100)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/templates/talk/modules/call-log.html [deleted file]
src/templates/talk/modules/contact.html [deleted file]
src/templates/talk/modules/lines.html [deleted file]
src/templates/talk/modules/ongoing-calls.html [deleted file]
src/web/__init__.py
src/web/ui_modules.py

diff --git a/src/templates/talk/modules/call-log.html b/src/templates/talk/modules/call-log.html
deleted file mode 100644 (file)
index fb9fe12..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-<h3>{{ _("Call Log") }}</h3>
-
-<table class="table table-sm table-hover table-striped">
-       <thead>
-               <tr>
-                       <th>{{ _("Date") }}</th>
-                       <th>{{ _("Conversational Partner") }}</th>
-                       <th>{{ _("Duration") }}</th>
-               </tr>
-       </thead>
-       <tbody>
-               {% for entry in calls %}
-                       {% if entry.sip_code == "200" %}
-                               <tr>
-                       {% elif entry.caller == viewer.sip_id %}
-                               <tr class="warning">
-                       {% else %}
-                               <tr class="info">
-                       {% end %}
-                               <td>{{ locale.format_date(entry.time, full_format=True, relative=False) }}</td>
-                               <td>
-                                       {% if entry.called == viewer.sip_id %}
-                                               <span class="glyphicon glyphicon-arrow-left text-success" title="{{ _("incoming") }}"></span>
-                                               {% if entry.caller_account %}
-                                                       <a href="/phonebook/{{ entry.caller_account.uid }}">{{ entry.caller_account.name }}</a>
-                                                       <span class="text-muted">({{ entry.caller }})</span>
-                                               {% else %}
-                                                       {{ entry.caller }}
-                                               {% end %}
-                                       {% elif entry.caller == viewer.sip_id %}
-                                               <span class="glyphicon glyphicon-arrow-right text-info" title="{{ _("outgoing") }}"></span>
-                                               {% if entry.called_account %}
-                                                       <a href="/phonebook/{{ entry.called_account.uid }}">{{ entry.called_account.name }}</a>
-                                                       <span class="text-muted">({{ entry.called }})</span>
-                                               {% else %}
-                                                       {{ entry.called }}
-                                               {% end %}
-                                       {% end %}
-                               </td>
-                               <td>
-                                       {% if entry.sip_code == "200" %}
-                                               {{ entry.duration }}
-                                       {% else %}
-                                               {% if entry.reason == "Busy Here" %}
-                                                       {{ _("Busy") }}
-                                               {% elif entry.reason in ("Cancelled", "Request Cancelled", "Request Timeout") %}
-                                                       {% if entry.caller == viewer.sip_id %}
-                                                               {{ _("no answer") }}
-                                                       {% else %}
-                                                               {{ _("missed call") }}
-                                                       {% end %}
-                                               {% else %}
-                                                       {{ entry.sip_code }} {{ entry.reason }}
-                                               {% end %}
-                                       {% end %}
-                               </td>
-                       </tr>
-               {% end %}
-       </tbody>
-</table>
diff --git a/src/templates/talk/modules/contact.html b/src/templates/talk/modules/contact.html
deleted file mode 100644 (file)
index 6c12b4d..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-{% if application == "ConfBridge" %}
-       {{ _("Conference Room %s") % number }}
-
-{% elif application == "Echo" %}
-       {{ _("Echo Test") }}
-
-{% elif application in ("VoiceMail", "VoiceMailMain") %}
-       {{ _("Voicemail") }}:
-
-       {% if account %}
-               <a href="/phonebook/{{ account.uid }}">{{ account.name }}</a>
-               <span class="text-muted">({{ number }})</span>
-       {% end %}
-
-{% elif account %}
-       <i class="fa fa-user"></i>
-       <a href="/phonebook/{{ account.uid }}">{{ account.name }}</a>
-       <span class="text-muted">({{ number }})</span>
-
-{% elif number == "900" %}
-       {{ _("Conference Service") }}
-
-{% elif number in ("980", "981", "982", "983", "984", "985", "986", "987", "988", "989") %}
-       {{ _("Parked Calls Extension") }} <span class="text-muted">({{ number }})</span>
-
-{% elif number == "992" %}
-       {{ _("Music") }}
-
-{% elif name and number %}
-       {{ name }} <span class="text-muted">({{ number }})</span>
-
-{% elif number %}
-       {{ number }}
-
-{% else %}
-       <span class="text-muted">{{ _("Unknown") }}</span>
-{% end %}
diff --git a/src/templates/talk/modules/lines.html b/src/templates/talk/modules/lines.html
deleted file mode 100644 (file)
index 5192b54..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-<h3>{{ _("Lines") }}</h3>
-
-<table class="table table-sm table-hover table-striped">
-       <thead>
-               <tr>
-                       {% if show_account %}
-                               <th>{{ _("Account") }}</th>
-                       {% end %}
-                       <th>{{ _("Expires") }}</th>
-                       <th>{{ _("Location") }}</th>
-                       <th>{{ _("User Agent") }}</th>
-               </tr>
-       </thead>
-       <tbody>
-               {% for line in lines %}
-                       <tr>
-                               {% if show_account %}
-                                       <td>
-                                               {% if line.account %}
-                                                       <a href="/phonebook/{{ line.account.uid }}">{{ line.account.name }}</a>
-                                                               <span class="text-muted">({{ line.account.sip_id }})</span>
-                                                       </a>
-                                               {% else %}
-                                                       {{ line.username }}@{{ line.domain }}
-                                               {% end %}
-                                       </td>
-                               {% end %}
-
-                               <td>{{ locale.format_date(line.expires) }}</td>
-                               <td>
-                                       {% if line.tls_enabled %}
-                                               <span class="glyphicon glyphicon-lock" title="{{ _("TLS") }}"></span>
-                                       {% end %}
-                                       {{ line.location }}
-                               </td>
-                               <td>{{ line.user_agent }}</td>
-                       </tr>
-               {% end %}
-       </tbody>
-</table>
diff --git a/src/templates/talk/modules/ongoing-calls.html b/src/templates/talk/modules/ongoing-calls.html
deleted file mode 100644 (file)
index eedeacd..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-{% if channels %}
-       <h3>{{ _("Ongoing Calls") }}</h3>
-
-       <table class="table table-hover table-striped">
-               <thead>
-                       <tr>
-                               <th>{{ _("Caller") }}</th>
-                               <th></th>
-                               <th>{{ _("Called") }}</th>
-                               <th>{{ _("Codec") }}</th>
-                               <th class="ar">{{ _("Duration") }}</th>
-                       </tr>
-               </thead>
-               <tbody>
-                       {% for c in channels %}
-                               <tr>
-                                       <td>
-                                               {% module TalkContact(c.caller, name=c.caller_name) %}
-                                       </td>
-
-                                       <td>
-                                               <span class="glyphicon glyphicon-arrow-right text-success"></span>
-                                       </td>
-
-                                       <td>
-                                               {% module TalkContact(c.callee, application=c.application) %}
-                                       </td>
-
-                                       <td>
-                                               {{ c.format }}
-                                       </td>
-
-                                       <td class="ar">{{ format_time(c.duration) }}</td>
-
-                                       <td class="ar">
-                                               <a class="btn btn-xs btn-danger" title="{{ _("Hangup") }}" href="/hangup/{{ c.id }}">
-                                                       <i class="fa fa-times"></i>
-                                               </a>
-                                       </td>
-                               </tr>
-                       {% end %}
-               </tbody>
-       </table>
-{% end %}
index 8c62f83008e8a30ff1eed691743694d1842de9b9..1688715a39211012e392f4964b5716b9b3beca32 100644 (file)
@@ -68,10 +68,6 @@ class Application(tornado.web.Application):
                                "FireinfoDeviceTable"  : ui_modules.FireinfoDeviceTableModule,
                                "FireinfoDeviceAndGroupsTable" : ui_modules.FireinfoDeviceAndGroupsTableModule,
                                "FireinfoGeoTable"        : ui_modules.FireinfoGeoTableModule,
-                               "TalkContact"          : ui_modules.TalkContactModule,
-                               "TalkCallLog"          : ui_modules.TalkCallLogModule,
-                               "TalkLines"            : ui_modules.TalkLinesModule,
-                               "TalkOngoingCalls"     : ui_modules.TalkOngoingCallsModule,
                        },
 
                        # Call this when a page wasn't found
index bb394b74c8caa68eacc9e4ce577b2c16d2a84c20..6984e21f73fceaa91a6dd7d7a65e264f5a4a99c6 100644 (file)
@@ -1,7 +1,5 @@
 #!/usr/bin/python
 
-
-
 import re
 import tornado.web
 import unicodedata
@@ -147,50 +145,3 @@ class ProgressBarModule(UIModule):
 
                return self.render_string("modules/progress-bar.html",
                        colour=colour, value=value)
-
-
-class TalkContactModule(UIModule):
-        def render(self, number, name=None, application=None):
-                account = self.backend.accounts.get_by_sip_id(number)
-
-                return self.render_string("talk/modules/contact.html",
-                        account=account, number=number, name=name, application=application)
-
-
-class TalkCallLogModule(UIModule):
-       def render(self, account=None, viewer=None):
-               if (account is None or not self.current_user == account) \
-                               and not self.current_user.is_admin():
-                       raise RuntimeException("Insufficient permissions")
-
-               if viewer is None:
-                       viewer = self.current_user
-
-               calls = self.backend.talk.get_call_log(account)
-
-               return self.render_string("talk/modules/call-log.html",
-                       calls=calls, viewer=viewer)
-
-
-class TalkLinesModule(UIModule):
-       def render(self, account=None, show_account=False):
-               if (account is None or not self.current_user == account) \
-                               and not self.current_user.is_admin():
-                       raise RuntimeException("Insufficient permissions")
-
-               lines = self.backend.talk.get_lines(account)
-
-               return self.render_string("talk/modules/lines.html",
-                       show_account=show_account, lines=lines)
-
-
-class TalkOngoingCallsModule(UIModule):
-       def render(self, account=None, debug=False):
-               if (account is None or not self.current_user == account) \
-                               and not self.current_user.is_admin():
-                       raise RuntimeException("Insufficient permissions")
-
-               channels = self.backend.talk.get_channels()
-
-               return self.render_string("talk/modules/ongoing-calls.html",
-                       account=account, channels=channels, debug=debug)