def planet(self):
return self.handler.planet
+ @property
+ def talk(self):
+ return self.handler.talk
+
@property
def wishlist(self):
return self.handler.wishlist
class TalkCallLogModule(UIModule):
- def render(self, calls):
- return self.render_string("talk/modules/call-log.html", calls=calls)
+ def render(self, account=None, viewer=None):
+ if (account is None or not self.current_user == account) \
+ and not self.current_user.is_admin():
+ raise RuntimeException("Insufficient permissions")
+
+ if viewer is None:
+ viewer = self.current_user
+
+ calls = self.talk.get_call_log(account)
+
+ return self.render_string("talk/modules/call-log.html",
+ calls=calls, viewer=viewer)
+
+
+class TalkLinesModule(UIModule):
+ def render(self, account=None, show_account=False):
+ if (account is None or not self.current_user == account) \
+ and not self.current_user.is_admin():
+ raise RuntimeException("Insufficient permissions")
+
+ lines = self.talk.get_lines(account)
+
+ return self.render_string("talk/modules/lines.html",
+ show_account=show_account, lines=lines)
class TalkOngoingCallsModule(UIModule):
- def render(self, calls):
- return self.render_string("talk/modules/ongoing-calls.html", calls=calls)
+ def render(self, account=None):
+ if (account is None or not self.current_user == account) \
+ and not self.current_user.is_admin():
+ raise RuntimeException("Insufficient permissions")
+
+ calls = self.talk.get_ongoing_calls(account)
+
+ if calls:
+ return self.render_string("talk/modules/ongoing-calls.html",
+ calls=calls)
+
+ return ""
class TrackerPeerListModule(UIModule):