Browse Source

add view for an iframe embeddable channel viewer page

Natenom/support-murmur-13-1446181288462
Michael Ziegler 14 years ago
parent
commit
032d7cc686
  1. 29
      pyweb/mumble/templates/mumble/embed.html
  2. 2
      pyweb/mumble/urls.py
  3. 10
      pyweb/mumble/views.py

29
pyweb/mumble/templates/mumble/embed.html

@ -0,0 +1,29 @@
{% extends "index.html" %}
{% comment %}
<!-- kate: space-indent on; indent-width 4; replace-tabs on; -->
{% endcomment %}
{% load mumble_extras %}
{% load i18n %}
{% block body %}
{% endblock %}
{% block PageTitle %}Mumble :: {{ MumbleServer.name }}{% endblock %}
{% block HeadTag %}
<script type="text/javascript" src="{% url django.views.i18n.javascript_catalog %}"></script>
<script type="text/javascript" src="{{ MUMBLE_MEDIA_PREFIX }}js/channelviewer.js"></script>
<script type="text/javascript" src="{{ MUMBLE_MEDIA_PREFIX }}js/channelviewerplugins.js"></script>
<script type="text/javascript">
Ext.onReady( function(){
Ext.QuickTips.init();
mainpanel = new Ext.ux.MumbleChannelViewer({
renderTo: Ext.getBody(),
source_url: "{% url mumble.views.cvp_json MumbleServer.id %}",
imageurl: '{{MUMBLE_MEDIA_PREFIX}}/img',
});
} );
</script>
<style type="text/css">
body {
padding: 20px 20px 0 20px;
}
</style>
{% endblock %}

2
pyweb/mumble/urls.py

@ -37,6 +37,8 @@ urlpatterns = patterns(
( r'mobile/(?P<server>\d+)/?$', 'mobile_show' ),
( r'mobile/?$', 'mobile_mumbles' ),
( r'embed/(?P<server>\d+)/?$', 'embed' ),
( r'(?P<server>\d+).json', 'cvp_json' ),
( r'(?P<server>\d+).xml', 'cvp_xml' ),

10
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) )

Loading…
Cancel
Save