From 7aee4b8d0ddaacc21d12e325814cb682e227a9a4 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Wed, 10 Oct 2018 12:46:13 +0100 Subject: [PATCH] talk: Add new base template Signed-off-by: Michael Tremer --- Makefile.am | 6 ++++ src/backend/accounts.py | 2 +- src/templates/talk/base.html | 32 ++++++++++++++++++++ src/templates/talk/index.html | 56 +++-------------------------------- src/web/handlers_talk.py | 6 +--- 5 files changed, 44 insertions(+), 58 deletions(-) create mode 100644 src/templates/talk/base.html diff --git a/Makefile.am b/Makefile.am index 678cdff2..5d44acd8 100644 --- a/Makefile.am +++ b/Makefile.am @@ -159,6 +159,12 @@ templates_static_DATA = \ templates_staticdir = $(templatesdir)/static +templates_talk_DATA = \ + src/templates/talk/base.html \ + src/templates/talk/index.html + +templates_talkdir = $(templatesdir)/talk + # ------------------------------------------------------------------------------ SCSS_FILES = \ diff --git a/src/backend/accounts.py b/src/backend/accounts.py index 26210053..d6a31eba 100644 --- a/src/backend/accounts.py +++ b/src/backend/accounts.py @@ -249,7 +249,7 @@ class Account(Object): name = name.replace("ü", "ue") for mail in self.attributes.get("mail", []): - if mail.startswith("%s@ipfire.org" % name): + if mail.decode().startswith("%s@ipfire.org" % name): return mail # If everything else fails, we will go with the UID diff --git a/src/templates/talk/base.html b/src/templates/talk/base.html new file mode 100644 index 00000000..f0ec67f2 --- /dev/null +++ b/src/templates/talk/base.html @@ -0,0 +1,32 @@ +{% extends "../base.html" %} + +{% block subtitle %}{{ _("Talk") }}{% end block %} + +{% block menu %} +
+ +
+ + +{% end block %} + +{% block content %} +
+
+ {% block main %}{% end block %} +
+ +
+ {{ current_user }} + +

{{ current_user.name }}

+ + Email +
+
+{% end block %} diff --git a/src/templates/talk/index.html b/src/templates/talk/index.html index 30c8c85f..669cb857 100644 --- a/src/templates/talk/index.html +++ b/src/templates/talk/index.html @@ -1,55 +1,7 @@ -{% extends "../base.html" %} +{% extends "base.html" %} -{% block title %}{{ _("Index") }}{% end block %} +{% block title %}{{ _("Home") }}{% end block %} -{% block body %} -
-
-
-
-

{{ _("Hello, %s!") % current_user.first_name or current_user.name }}

-
-
- - {% if favourite_contacts %} -
- {% for contact in favourite_contacts %} -
-
-
- -
-
- {% if contact.called_account %} -

- - {{ contact.called_account.name }} - -

- {% else %} -

{{ contact.called }}

- {% end %} -

- -

-
-
-
-
-
- {% end %} -
- {% end %} - - {% module TalkOngoingCalls(current_user) %} - - {% module TalkCallLog(current_user) %} -
-
+{% block main %} + XXX {% end block %} diff --git a/src/web/handlers_talk.py b/src/web/handlers_talk.py index 32a63ea7..a4230f51 100644 --- a/src/web/handlers_talk.py +++ b/src/web/handlers_talk.py @@ -7,11 +7,7 @@ from .handlers_base import * class TalkIndexHandler(BaseHandler): @tornado.web.authenticated def get(self): - call_log = self.talk.get_call_log(self.current_user, limit=6) - favourite_contacts = self.talk.get_favourite_contacts(self.current_user) - - self.render("talk/index.html", call_log=call_log, - favourite_contacts=favourite_contacts) + self.render("talk/index.html") class TalkPhonebookHandler(BaseHandler): -- 2.47.3