From: Michael Tremer Date: Tue, 30 Oct 2018 08:19:43 +0000 (+0000) Subject: people: Show better message when no calls are available to show X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=89e4729963f166e15bbf00210a6d455a6507874b;p=ipfire.org.git people: Show better message when no calls are available to show Signed-off-by: Michael Tremer --- diff --git a/src/templates/people/modules/cdr.html b/src/templates/people/modules/cdr.html index a2ad0a2b..456f8f2f 100644 --- a/src/templates/people/modules/cdr.html +++ b/src/templates/people/modules/cdr.html @@ -1,52 +1,58 @@ - - - - - - - - - - {% for c in cdr %} +{% if cdr %} +
{{ _("Duration") }}
+ - + + + - - {% if c.callee %} - {{ c.callee }} - {% else %} - {{ format_phone_number(c.callee_number) }} - {% end %} - - {% elif c.direction == "outbound" %} - + + {% for c in cdr %} + + +
- - {% if c.time_answered %} - {{ format_time(c.duration) }} - {% else %} - {{ _("Not Answered") }} - {% end %} - - - {% end %} - -
- {% if c.direction == "inbound" %} - + {{ _("Duration") }}
+ {% if c.direction == "inbound" %} + - - {% if c.caller %} - {{ c.caller }} - {% else %} - {{ format_phone_number(c.caller_number) }} - {% end %} - - {% end %} + + {% if c.callee %} + {{ c.callee }} + {% else %} + {{ format_phone_number(c.callee_number) }} + {% end %} + + {% elif c.direction == "outbound" %} + -
+ + {% if c.caller %} + {{ c.caller }} + {% else %} + {{ format_phone_number(c.caller_number) }} + {% end %} + + {% end %} - {% module MOS(c) %} -
- {{ locale.format_date(c.time_start, relative=False) }}
+ {% module MOS(c) %} +
+ + {{ locale.format_date(c.time_start, relative=False) }}
+ + {% if c.time_answered %} + {{ format_time(c.duration) }} + {% else %} + {{ _("Not Answered") }} + {% end %} + + + {% end %} + + +{% else %} +

+ {{ _("There are no calls") }} +

+{% end %} diff --git a/src/web/people.py b/src/web/people.py index 7eb2d062..c5f18f5b 100644 --- a/src/web/people.py +++ b/src/web/people.py @@ -356,7 +356,8 @@ class CDRModule(ui_modules.UIModule): def render(self, account, date=None, limit=None): cdr = account.get_cdr(date=date, limit=limit) - return self.render_string("people/modules/cdr.html", account=account, cdr=cdr) + return self.render_string("people/modules/cdr.html", + account=account, cdr=list(cdr)) class ChannelsModule(ui_modules.UIModule):