]> git.ipfire.org Git - ipfire.org.git/commitdiff
talk: Add new base template
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 10 Oct 2018 11:46:13 +0000 (12:46 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 10 Oct 2018 11:46:13 +0000 (12:46 +0100)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Makefile.am
src/backend/accounts.py
src/templates/talk/base.html [new file with mode: 0644]
src/templates/talk/index.html
src/web/handlers_talk.py

index 678cdff2c7311d6ca73cc4cf960f461554915146..5d44acd87e952612d158cbd1479d80c394ea073f 100644 (file)
@@ -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 = \
index 26210053b20025df2f81f65647c75755d24e59cd..d6a31eba1d7b4117acdd1060ddbea5509bd422af 100644 (file)
@@ -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 (file)
index 0000000..f0ec67f
--- /dev/null
@@ -0,0 +1,32 @@
+{% extends "../base.html" %}
+
+{% block subtitle %}{{ _("Talk") }}{% end block %}
+
+{% block menu %}
+       <form class="form-inline ml-auto my-2 my-lg-0" action="/search" method="GET">
+               <input class="form-control form-control-sm mr-sm-2" type="search" name="q"
+                       placeholder="{{ _("Search") }}" aria-label="{{ _("Search") }}" value="{% try %}{{ q }}{% except %}{% end %}">
+       </form>
+
+       <ul class="navbar-nav">
+               <li class="nav-item">
+                       <a class="nav-link" href="https://www.ipfire.org/">IPFire.org</a>
+               </li>
+       </ul>
+{% end block %}
+
+{% block content %}
+       <div class="row">
+               <div class="col">
+                       {% block main %}{% end block %}
+               </div>
+
+               <div class="col-md-3 text-center">
+                       <img class="img-fluid rounded-circle mb-4" src="{{ current_user.gravatar_icon(160) }}" alt="{{ current_user }}" />
+               
+                       <p>{{ current_user.name }}</p>
+               
+                       <a href="mailto:{{ current_user.email }}">Email</a>
+               </div>
+       </div>
+{% end block %}
index 30c8c85fe7e8846f677396cc185e738cda3303ad..669cb85794c0ad56ca3901ed7ffa9b9dbaf67cf2 100644 (file)
@@ -1,55 +1,7 @@
-{% extends "../base.html" %}
+{% extends "base.html" %}
 
-{% block title %}{{ _("Index") }}{% end block %}
+{% block title %}{{ _("Home") }}{% end block %}
 
-{% block body %}
-<div class="container">
-       <section class="features-content col-12">
-               <div class="row">
-                       <div class="col-12">
-                               <h3>{{ _("Hello, %s!") % current_user.first_name or current_user.name }}</h3>
-                       </div>
-               </div>
-       
-               {% if favourite_contacts %}
-               <div class="row">
-                       {% for contact in favourite_contacts %}
-                               <div class="col-md-4">
-                                       <div class="thumbnail">
-                                               <div class="row">
-                                                       <div class="col-md-4 hidden-sm hidden-xs">
-                                                               {% if contact.called_account %}
-                                                                       <img src="{{ contact.called_account.gravatar_icon(106) }}" alt="{{ contact.called_account.name }}">
-                                                               {% end %}
-                                                       </div>
-                                                       <div class="col-md-8">
-                                                               <div class="caption">
-                                                               {% if contact.called_account %}
-                                                                       <h4>
-                                                                               <a href="/phonebook/{{ contact.called_account.uid }}">
-                                                                                       {{ contact.called_account.name }}
-                                                                               </a>
-                                                                       </h4>
-                                                               {% else %}
-                                                                       <h4>{{ contact.called }}</h4>
-                                                               {% end %}
-                                                                       <p>
-                                                                               <a href="/call/{{ contact.called }}" class="btn btn-sm {% if contact.called_account and contact.called_account.sip_is_online() %}btn-success{% else %}btn-danger disabled{% end %}" role="button">
-                                                                                       <span class="glyphicon glyphicon-earphone"></span> {{ _("Call") }}
-                                                                               </a>
-                                                                       </p>
-                                                               </div>
-                                                       </div>
-                                               </div>
-                                       </div>
-                               </div>
-                       {% end %}
-               </div>
-               {% end %}
-
-       {% module TalkOngoingCalls(current_user) %}
-
-       {% module TalkCallLog(current_user) %}
-       </section>
-</div>
+{% block main %}
+       XXX
 {% end block %}
index 32a63ea77d51f4ec54e3610b9b5d50c81adcb317..a4230f51093079f5d1cc281faf75def53913acd9 100644 (file)
@@ -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):