]>
git.ipfire.org Git - ipfire.org.git/blob - webapp/handlers_talk.py
5 from handlers_base
import *
7 class TalkIndexHandler(BaseHandler
):
8 @tornado.web
.authenticated
10 call_log
= self
.talk
.get_call_log(self
.current_user
, limit
=6)
11 favourite_contacts
= self
.talk
.get_favourite_contacts(self
.current_user
)
13 self
.render("talk/index.html", call_log
=call_log
,
14 favourite_contacts
=favourite_contacts
)
17 class TalkPhonebookHandler(BaseHandler
):
18 @tornado.web
.authenticated
20 phonebook
= self
.talk
.get_phonebook(self
.current_user
)
22 self
.render("talk/phonebook.html", phonebook
=phonebook
)
25 class TalkPhonebookAccountHandler(BaseHandler
):
26 @tornado.web
.authenticated
28 account
= self
.accounts
.find(uid
)
30 raise tornado
.web
.HTTPError(404, "Account not found: %s" % uid
)
32 self
.render("talk/phonebook-contact.html", account
=account
)
35 class TalkDiagnosisHandler(BaseHandler
):
36 @tornado.web
.authenticated
38 # Access only allowed for admins
39 if not self
.current_user
.is_admin():
40 raise tornado
.web
.HTTPError(403)
42 return self
.render("talk/diagnosis.html")
45 class TalkHangupChannelHandler(BaseHandler
):
46 def _get_channel(self
, channel_id
):
47 account
= None if self
.current_user
.is_admin() else self
.current_user
49 channel
= self
.talk
.get_channel(channel_id
, account
=account
)
51 raise tornado
.web
.HTTPError(404)
55 @tornado.web
.authenticated
56 def get(self
, channel_id
):
57 channel
= self
._get
_channel
(channel_id
)
59 self
.render("talk/confirm-hangup.html", channel
=channel
)
61 @tornado.web
.authenticated
62 def post(self
, channel_id
):
63 channel
= self
._get
_channel
(channel_id
)
71 class TalkConferencesHandler(BaseHandler
):
72 @tornado.web
.authenticated
74 return self
.render("talk/conferences.html",
75 conferences
=self
.talk
.conferences
)
78 class TalkProfileHandler(BaseHandler
):
79 @tornado.web
.authenticated
81 return self
.redirect("/phonebook/%s" % self
.current_user
.uid
)