From: Michael Tremer Date: Wed, 10 Oct 2018 14:56:37 +0000 (+0100) Subject: talk: Drop old modules X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5f740b7519854e34c29b12e6559db60d34956533;p=ipfire.org.git talk: Drop old modules Signed-off-by: Michael Tremer --- diff --git a/src/templates/talk/modules/call-log.html b/src/templates/talk/modules/call-log.html deleted file mode 100644 index fb9fe12c..00000000 --- a/src/templates/talk/modules/call-log.html +++ /dev/null @@ -1,60 +0,0 @@ -

{{ _("Call Log") }}

- - - - - - - - - - - {% for entry in calls %} - {% if entry.sip_code == "200" %} - - {% elif entry.caller == viewer.sip_id %} - - {% else %} - - {% end %} - - - - - {% end %} - -
{{ _("Date") }}{{ _("Conversational Partner") }}{{ _("Duration") }}
{{ locale.format_date(entry.time, full_format=True, relative=False) }} - {% if entry.called == viewer.sip_id %} - - {% if entry.caller_account %} - {{ entry.caller_account.name }} - ({{ entry.caller }}) - {% else %} - {{ entry.caller }} - {% end %} - {% elif entry.caller == viewer.sip_id %} - - {% if entry.called_account %} - {{ entry.called_account.name }} - ({{ entry.called }}) - {% else %} - {{ entry.called }} - {% end %} - {% end %} - - {% 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 %} -
diff --git a/src/templates/talk/modules/contact.html b/src/templates/talk/modules/contact.html deleted file mode 100644 index 6c12b4d1..00000000 --- a/src/templates/talk/modules/contact.html +++ /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 %} - {{ account.name }} - ({{ number }}) - {% end %} - -{% elif account %} - - {{ account.name }} - ({{ number }}) - -{% elif number == "900" %} - {{ _("Conference Service") }} - -{% elif number in ("980", "981", "982", "983", "984", "985", "986", "987", "988", "989") %} - {{ _("Parked Calls Extension") }} ({{ number }}) - -{% elif number == "992" %} - {{ _("Music") }} - -{% elif name and number %} - {{ name }} ({{ number }}) - -{% elif number %} - {{ number }} - -{% else %} - {{ _("Unknown") }} -{% end %} diff --git a/src/templates/talk/modules/lines.html b/src/templates/talk/modules/lines.html deleted file mode 100644 index 5192b54c..00000000 --- a/src/templates/talk/modules/lines.html +++ /dev/null @@ -1,40 +0,0 @@ -

{{ _("Lines") }}

- - - - - {% if show_account %} - - {% end %} - - - - - - - {% for line in lines %} - - {% if show_account %} - - {% end %} - - - - - - {% end %} - -
{{ _("Account") }}{{ _("Expires") }}{{ _("Location") }}{{ _("User Agent") }}
- {% if line.account %} - {{ line.account.name }} - ({{ line.account.sip_id }}) - - {% else %} - {{ line.username }}@{{ line.domain }} - {% end %} - {{ locale.format_date(line.expires) }} - {% if line.tls_enabled %} - - {% end %} - {{ line.location }} - {{ line.user_agent }}
diff --git a/src/templates/talk/modules/ongoing-calls.html b/src/templates/talk/modules/ongoing-calls.html deleted file mode 100644 index eedeacd2..00000000 --- a/src/templates/talk/modules/ongoing-calls.html +++ /dev/null @@ -1,44 +0,0 @@ -{% if channels %} -

{{ _("Ongoing Calls") }}

- - - - - - - - - - - - - {% for c in channels %} - - - - - - - - - - - - - - {% end %} - -
{{ _("Caller") }}{{ _("Called") }}{{ _("Codec") }}{{ _("Duration") }}
- {% module TalkContact(c.caller, name=c.caller_name) %} - - - - {% module TalkContact(c.callee, application=c.application) %} - - {{ c.format }} - {{ format_time(c.duration) }} - - - -
-{% end %} diff --git a/src/web/__init__.py b/src/web/__init__.py index 8c62f830..1688715a 100644 --- a/src/web/__init__.py +++ b/src/web/__init__.py @@ -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 diff --git a/src/web/ui_modules.py b/src/web/ui_modules.py index bb394b74..6984e21f 100644 --- a/src/web/ui_modules.py +++ b/src/web/ui_modules.py @@ -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)