From 032d7cc68644ab2617e653ac919b66212ad77206 Mon Sep 17 00:00:00 2001 From: Michael Ziegler Date: Fri, 22 Oct 2010 21:32:57 +0200 Subject: [PATCH] add view for an iframe embeddable channel viewer page --- pyweb/mumble/templates/mumble/embed.html | 29 ++++++++++++++++++++++++ pyweb/mumble/urls.py | 2 ++ pyweb/mumble/views.py | 10 ++++++++ 3 files changed, 41 insertions(+) create mode 100644 pyweb/mumble/templates/mumble/embed.html diff --git a/pyweb/mumble/templates/mumble/embed.html b/pyweb/mumble/templates/mumble/embed.html new file mode 100644 index 0000000..f19e983 --- /dev/null +++ b/pyweb/mumble/templates/mumble/embed.html @@ -0,0 +1,29 @@ +{% extends "index.html" %} +{% comment %} + +{% endcomment %} +{% load mumble_extras %} +{% load i18n %} +{% block body %} +{% endblock %} +{% block PageTitle %}Mumble :: {{ MumbleServer.name }}{% endblock %} +{% block HeadTag %} + + + + + +{% endblock %} diff --git a/pyweb/mumble/urls.py b/pyweb/mumble/urls.py index 8f227a6..b86828e 100644 --- a/pyweb/mumble/urls.py +++ b/pyweb/mumble/urls.py @@ -37,6 +37,8 @@ urlpatterns = patterns( ( r'mobile/(?P\d+)/?$', 'mobile_show' ), ( r'mobile/?$', 'mobile_mumbles' ), + ( r'embed/(?P\d+)/?$', 'embed' ), + ( r'(?P\d+).json', 'cvp_json' ), ( r'(?P\d+).xml', 'cvp_xml' ), diff --git a/pyweb/mumble/views.py b/pyweb/mumble/views.py index 434e4f9..bf5ed51 100644 --- a/pyweb/mumble/views.py +++ b/pyweb/mumble/views.py @@ -195,6 +195,16 @@ def mobile_show( request, server ): 'MumbleAccount':user, }, context_instance = RequestContext(request) ) +def embed( request, server ): + """ Display the channel viewer for the given Server ID. """ + + srv = get_object_or_404( Mumble, id=server ) + + return render_to_response( 'mumble/embed.html', { + 'MumbleServer': srv, + 'MumbleActive': True, + }, context_instance = RequestContext(request) ) + @EXT_DIRECT_PROVIDER.register_method( "Mumble" ) def hasTexture( request, server, userid ): srv = get_object_or_404( Mumble, id=int(server) )