]> git.ipfire.org Git - ipfire.org.git/commitdiff
Move talk.ipfire.org -> people.ipfire.org
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 15 Oct 2018 11:28:42 +0000 (12:28 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 15 Oct 2018 11:28:42 +0000 (12:28 +0100)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
15 files changed:
Makefile.am
src/templates/people/base.html [moved from src/templates/talk/base.html with 96% similarity]
src/templates/people/index.html [moved from src/templates/talk/index.html with 100% similarity]
src/templates/people/modules/accounts-list.html [moved from src/templates/talk/modules/accounts-list.html with 100% similarity]
src/templates/people/modules/cdr.html [moved from src/templates/talk/modules/cdr.html with 100% similarity]
src/templates/people/modules/channels.html [moved from src/templates/talk/modules/channels.html with 100% similarity]
src/templates/people/modules/registrations.html [moved from src/templates/talk/modules/registrations.html with 100% similarity]
src/templates/people/registrations.html [moved from src/templates/talk/registrations.html with 100% similarity]
src/templates/people/search.html [moved from src/templates/talk/search.html with 100% similarity]
src/templates/people/user.html [moved from src/templates/talk/user.html with 100% similarity]
src/templates/people/users.html [moved from src/templates/talk/users.html with 100% similarity]
src/web/__init__.py
src/web/handlers_talk.py [deleted file]
src/web/people.py
src/web/talk.py [deleted file]

index 92326b1ec06c978e970aec34d770734373490c70..a0e3b52df64b516562c3d8e8b9e1d8c612ddb8d8 100644 (file)
@@ -84,10 +84,8 @@ web_PYTHON = \
        src/web/handlers_iuse.py \
        src/web/handlers_mirrors.py \
        src/web/handlers_nopaste.py \
-       src/web/handlers_talk.py \
        src/web/location.py \
        src/web/people.py \
-       src/web/talk.py \
        src/web/ui_modules.py
 
 webdir = $(backenddir)/web
@@ -148,6 +146,24 @@ templates_modules_DATA = \
 
 templates_modulesdir = $(templatesdir)/modules
 
+templates_people_DATA = \
+       src/templates/people/base.html \
+       src/templates/people/index.html \
+       src/templates/people/registrations.html \
+       src/templates/people/search.html \
+       src/templates/people/user.html \
+       src/templates/people/users.html
+
+templates_peopledir = $(templatesdir)/people
+
+templates_people_modules_DATA = \
+       src/templates/people/modules/accounts-list.html \
+       src/templates/people/modules/cdr.html \
+       src/templates/people/modules/channels.html \
+       src/templates/people/modules/registrations.html
+
+templates_people_modulesdir = $(templates_peopledir)/modules
+
 templates_static_DATA = \
        src/templates/static/features.html \
        src/templates/static/get-involved.html \
@@ -158,24 +174,6 @@ templates_static_DATA = \
 
 templates_staticdir = $(templatesdir)/static
 
-templates_talk_DATA = \
-       src/templates/talk/base.html \
-       src/templates/talk/index.html \
-       src/templates/talk/registrations.html \
-       src/templates/talk/search.html \
-       src/templates/talk/user.html \
-       src/templates/talk/users.html
-
-templates_talkdir = $(templatesdir)/talk
-
-templates_talk_modules_DATA = \
-       src/templates/talk/modules/accounts-list.html \
-       src/templates/talk/modules/cdr.html \
-       src/templates/talk/modules/channels.html \
-       src/templates/talk/modules/registrations.html
-
-templates_talk_modulesdir = $(templates_talkdir)/modules
-
 # ------------------------------------------------------------------------------
 
 SCSS_FILES = \
similarity index 96%
rename from src/templates/talk/base.html
rename to src/templates/people/base.html
index 1afa1a33fc3e9ef567f5de47115711396edbd868..d92db680f915913da2b06efec0302b2c81596742 100644 (file)
@@ -1,6 +1,6 @@
 {% extends "../base.html" %}
 
-{% block subtitle %}{{ _("Talk") }}{% end block %}
+{% block subtitle %}{{ _("People") }}{% end block %}
 
 {% block menu %}
        {% if current_user %}
index 91fb4eb84cbeaf2d61ffb53419233f731e2ea186..88fcd270b038920ff5b42172ed424a1767a5f191 100644 (file)
@@ -16,7 +16,6 @@ from . import blog
 from . import download
 from . import location
 from . import people
-from . import talk
 from . import ui_modules
 
 class Application(tornado.web.Application):
@@ -56,10 +55,10 @@ class Application(tornado.web.Application):
                                "Map"                  : ui_modules.MapModule,
 
                                # Talk
-                               "TalkAccountsList"     : talk.AccountsListModule,
-                               "TalkCDR"              : talk.CDRModule,
-                               "TalkChannels"         : talk.ChannelsModule,
-                               "TalkRegistrations"    : talk.RegistrationsModule,
+                               "TalkAccountsList"     : people.AccountsListModule,
+                               "TalkCDR"              : people.CDRModule,
+                               "TalkChannels"         : people.ChannelsModule,
+                               "TalkRegistrations"    : people.RegistrationsModule,
 
                                # Old modules
                                "LanguageName"         : ui_modules.LanguageNameModule,
@@ -240,23 +239,18 @@ class Application(tornado.web.Application):
 
                # talk.ipfire.org
                self.add_handlers(r"talk(\.dev)?\.ipfire\.org", [
-                       (r"/", talk.IndexHandler),
-                       (r"/search", talk.SearchHandler),
-                       (r"/users", talk.UsersHandler),
-                       (r"/users/(\w+)", talk.UserHandler),
-                       (r"/users/(\w+)/registrations", talk.RegistrationsHandler),
-                       (r"/conferences", TalkConferencesHandler),
-                       (r"/diagnosis", TalkDiagnosisHandler),
-                       (r"/hangup/(.*)", TalkHangupChannelHandler),
-                       (r"/phonebook/(\w+)", TalkPhonebookAccountHandler),
-                       (r"/phonebook", TalkPhonebookHandler),
-                       (r"/profile", TalkProfileHandler),
-               ] + authentication_handlers)
+                       (r"/", tornado.web.RedirectHandler, { "url" : "https://people.ipfire.org/" }),
+               ])
 
                # people.ipfire.org
                self.add_handlers(r"people(\.dev)?\.ipfire\.org", [
+                       (r"/", people.IndexHandler),
+                       (r"/search", people.SearchHandler),
+                       (r"/users", people.UsersHandler),
+                       (r"/users/(\w+)", people.UserHandler),
                        (r"/users/(\w+)\.jpg", people.AvatarHandler),
-               ])
+                       (r"/users/(\w+)/registrations", people.RegistrationsHandler),
+               ]  + authentication_handlers)
 
                # ipfire.org
                self.add_handlers(r"ipfire\.org", [
diff --git a/src/web/handlers_talk.py b/src/web/handlers_talk.py
deleted file mode 100644 (file)
index a4230f5..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-#!/usr/bin/python
-
-import tornado.web
-
-from .handlers_base import *
-
-class TalkIndexHandler(BaseHandler):
-       @tornado.web.authenticated
-       def get(self):
-               self.render("talk/index.html")
-
-
-class TalkPhonebookHandler(BaseHandler):
-       @tornado.web.authenticated
-       def get(self):
-               phonebook = self.talk.get_phonebook(self.current_user)
-
-               self.render("talk/phonebook.html", phonebook=phonebook)
-
-
-class TalkPhonebookAccountHandler(BaseHandler):
-       @tornado.web.authenticated
-       def get(self, uid):
-               account = self.accounts.find(uid)
-               if not account:
-                       raise tornado.web.HTTPError(404, "Account not found: %s" % uid)
-
-               self.render("talk/phonebook-contact.html", account=account)
-
-
-class TalkDiagnosisHandler(BaseHandler):
-       @tornado.web.authenticated
-       def get(self):
-               # Access only allowed for admins
-               if not self.current_user.is_admin():
-                       raise tornado.web.HTTPError(403)
-
-               return self.render("talk/diagnosis.html")
-
-
-class TalkHangupChannelHandler(BaseHandler):
-       def _get_channel(self, channel_id):
-               account = None if self.current_user.is_admin() else self.current_user
-
-               channel = self.talk.get_channel(channel_id, account=account)
-               if not channel:
-                       raise tornado.web.HTTPError(404)
-
-               return channel
-
-       @tornado.web.authenticated
-       def get(self, channel_id):
-               channel = self._get_channel(channel_id)
-
-               self.render("talk/confirm-hangup.html", channel=channel)
-
-       @tornado.web.authenticated
-       def post(self, channel_id):
-               channel = self._get_channel(channel_id)
-
-               # Hangup
-               channel.hangup()
-
-               self.redirect("/")
-
-
-class TalkConferencesHandler(BaseHandler):
-       @tornado.web.authenticated
-       def get(self):
-               return self.render("talk/conferences.html",
-                       conferences=self.talk.conferences)
-
-
-class TalkProfileHandler(BaseHandler):
-       @tornado.web.authenticated
-       def get(self):
-               return self.redirect("/phonebook/%s" % self.current_user.uid)
index de2ac8bd97cddd983f45d520c08c9689bb4f5958..face462cf202ba0a533512488cd2f13bf55557e0 100644 (file)
@@ -4,6 +4,13 @@ import logging
 import tornado.web
 
 from . import handlers_base as base
+from . import ui_modules
+
+class IndexHandler(base.BaseHandler):
+       @tornado.web.authenticated
+       def get(self):
+               self.render("people/index.html")
+
 
 class AvatarHandler(base.BaseHandler):
        def get(self, uid):
@@ -40,3 +47,82 @@ class AvatarHandler(base.BaseHandler):
 
                # Deliver payload
                self.finish(avatar)
+
+
+class RegistrationsHandler(base.BaseHandler):
+       @tornado.web.authenticated
+       def get(self, uid):
+               # Get own account
+               if self.current_user.uid == uid:
+                       account = self.current_user
+
+               # Admins can access all other users, too
+               elif self.current_user.is_admin():
+                       account = self.backend.accounts.get_by_uid(uid)
+                       if not account:
+                               raise tornado.web.HTTPError(404, "Could not find account %s" % uid)
+
+               # Otherwise, no access is permitted
+               else:
+                       raise tornado.web.HTTPError(403)
+
+               self.render("people/registrations.html", account=account)
+
+
+class SearchHandler(base.BaseHandler):
+       @tornado.web.authenticated
+       def get(self):
+               q = self.get_argument("q")
+
+               # Perform the search
+               accounts = self.backend.talk.search(q)
+
+               # Redirect when only one result was found
+               if len(accounts) == 1:
+                       self.redirect("/users/%s" % accounts[0].uid)
+                       return
+
+               self.render("people/search.html", q=q, accounts=accounts)
+
+
+class UsersHandler(base.BaseHandler):
+       @tornado.web.authenticated
+       def get(self):
+               self.render("people/users.html")
+
+
+class UserHandler(base.BaseHandler):
+       @tornado.web.authenticated
+       def get(self, uid):
+               account = self.backend.accounts.get_by_uid(uid)
+               if not account:
+                       raise tornado.web.HTTPError(404, "Could not find account %s" % uid)
+
+               self.render("people/user.html", account=account)
+
+
+class AccountsListModule(ui_modules.UIModule):
+       def render(self, accounts=None):
+               if accounts is None:
+                       accounts = self.backend.talk.accounts
+
+               return self.render_string("people/modules/accounts-list.html", accounts=accounts)
+
+
+class CDRModule(ui_modules.UIModule):
+       def render(self, account, limit=None):
+               cdr = account.get_cdr(limit=limit)
+
+               return self.render_string("people/modules/cdr.html", account=account, cdr=cdr)
+
+
+class ChannelsModule(ui_modules.UIModule):
+       def render(self, account):
+               channels = self.backend.talk.freeswitch.get_sip_channels(account)
+
+               return self.render_string("people/modules/channels.html", account=account, channels=channels)
+
+
+class RegistrationsModule(ui_modules.UIModule):
+       def render(self, account):
+               return self.render_string("people/modules/registrations.html", account=account)
diff --git a/src/web/talk.py b/src/web/talk.py
deleted file mode 100644 (file)
index 8ce8e6c..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-#!/usr/bin/python
-
-import tornado.web
-
-from . import handlers_base as base
-from . import ui_modules
-
-class IndexHandler(base.BaseHandler):
-       @tornado.web.authenticated
-       def get(self):
-               self.render("talk/index.html")
-
-
-class RegistrationsHandler(base.BaseHandler):
-       @tornado.web.authenticated
-       def get(self, uid):
-               # Get own account
-               if self.current_user.uid == uid:
-                       account = self.current_user
-
-               # Admins can access all other users, too
-               elif self.current_user.is_admin():
-                       account = self.backend.accounts.get_by_uid(uid)
-                       if not account:
-                               raise tornado.web.HTTPError(404, "Could not find account %s" % uid)
-
-               # Otherwise, no access is permitted
-               else:
-                       raise tornado.web.HTTPError(403)
-
-               self.render("talk/registrations.html", account=account)
-
-
-class SearchHandler(base.BaseHandler):
-       @tornado.web.authenticated
-       def get(self):
-               q = self.get_argument("q")
-
-               # Perform the search
-               accounts = self.backend.talk.search(q)
-
-               # Redirect when only one result was found
-               if len(accounts) == 1:
-                       self.redirect("/users/%s" % accounts[0].uid)
-                       return
-
-               self.render("talk/search.html", q=q, accounts=accounts)
-
-
-class UsersHandler(base.BaseHandler):
-       @tornado.web.authenticated
-       def get(self):
-               self.render("talk/users.html")
-
-
-class UserHandler(base.BaseHandler):
-       @tornado.web.authenticated
-       def get(self, uid):
-               account = self.backend.accounts.get_by_uid(uid)
-               if not account:
-                       raise tornado.web.HTTPError(404, "Could not find account %s" % uid)
-
-               self.render("talk/user.html", account=account)
-
-
-class AccountsListModule(ui_modules.UIModule):
-       def render(self, accounts=None):
-               if accounts is None:
-                       accounts = self.backend.talk.accounts
-
-               return self.render_string("talk/modules/accounts-list.html", accounts=accounts)
-
-
-class CDRModule(ui_modules.UIModule):
-       def render(self, account, limit=None):
-               cdr = account.get_cdr(limit=limit)
-
-               return self.render_string("talk/modules/cdr.html", account=account, cdr=cdr)
-
-
-class ChannelsModule(ui_modules.UIModule):
-       def render(self, account):
-               channels = self.backend.talk.freeswitch.get_sip_channels(account)
-
-               return self.render_string("talk/modules/channels.html", account=account, channels=channels)
-
-
-class RegistrationsModule(ui_modules.UIModule):
-       def render(self, account):
-               return self.render_string("talk/modules/registrations.html", account=account)