Browse Source

fix url tags for Django 1.5, remove MUMBLE_MEDIA_PREFIX in favor of django.contrib.staticfiles

Natenom/support-murmur-13-1446181288462
Michael Ziegler 12 years ago
parent
commit
f0fd785794
  1. 9
      pyweb/mumble/templates/mumble/channel.html
  2. 11
      pyweb/mumble/templates/mumble/embed.html
  3. 7
      pyweb/mumble/templates/mumble/list.html
  4. 2
      pyweb/mumble/templates/mumble/mobile_list.html
  5. 25
      pyweb/mumble/templates/mumble/mumble.html
  6. 23
      pyweb/mumble/templates/mumble/player.html
  7. 3
      pyweb/mumble/templates/mumble/server.html
  8. 6
      pyweb/mumble/templatetags/mumble_extras.py
  9. 3
      pyweb/processors.py
  10. 21
      pyweb/settings.py
  11. 21
      pyweb/templates/index.html
  12. 13
      pyweb/templates/mobile_index.html

9
pyweb/mumble/templates/mumble/channel.html

@ -1,13 +1,14 @@
{% comment %}
<!-- kate: space-indent on; indent-width 2; replace-tabs on; -->
{% endcomment %}
{% load staticfiles %}
{% load mumble_extras %}
<div class="mumble" style="background-image: url( {{MUMBLE_MEDIA_PREFIX}}/img/linie_v.png )">
<img src="{{MUMBLE_MEDIA_PREFIX}}/img/knoten_v.png" alt="" />
<div class="mumble" style="background-image: url( {% static 'mumble/img/linie_v.png' %} )">
<img src="{% static 'mumble/img/knoten_v.png' %}" alt="" />
{% if Channel.linked %}
<img src="{{MUMBLE_MEDIA_PREFIX}}/img/channel_linked.png" alt="linked channel" />
<img src="{% static 'mumble/img/channel_linked.png' %}" alt="linked channel" />
{% else %}
<img src="{{MUMBLE_MEDIA_PREFIX}}/img/channel.png" alt="channel" />
<img src="{% static 'mumble/img/channel.png' %}" alt="channel" />
{% endif %}
{% if Channel.server.netloc %}
<a href="{{ Channel|chanurl:MumbleAccount }}" class="mumble" id="link_{{ Channel.id }}" title="{{ Channel.name }}">

11
pyweb/mumble/templates/mumble/embed.html

@ -1,4 +1,5 @@
{% extends "index.html" %}
{% load staticfiles %}
{% comment %}
<!-- kate: space-indent on; indent-width 4; replace-tabs on; -->
{% endcomment %}
@ -8,9 +9,9 @@
{% 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" src="{% url 'django.views.i18n.javascript_catalog' %}"></script>
<script type="text/javascript" src="{% static 'mumble/js/channelviewer.js' %}"></script>
<script type="text/javascript" src="{% static 'mumble/js/channelviewerplugins.js' %}"></script>
<script type="text/javascript">
Ext.onReady( function(){
Ext.QuickTips.init();
@ -20,8 +21,8 @@
{% if UsersAboveChannels %}
usersAboveChannels: true,
{% endif %}
source_url: "{% url mumble.views.cvp_json MumbleServer.id %}",
imageurl: '{{MUMBLE_MEDIA_PREFIX}}/img',
source_url: "{% url 'mumble.views.cvp_json' MumbleServer.id %}",
imageurl: '{% static "mumble/img" %}',
tbar: [],
});
function updateLayout(){

7
pyweb/mumble/templates/mumble/list.html

@ -3,15 +3,16 @@
<!-- kate: space-indent on; indent-width 4; replace-tabs on; -->
{% endcomment %}
{% load mumble_extras %}
{% load staticfiles %}
{% load i18n %}
{% block body %}
{% endblock %}
{% block HeadTag %}
<script type="text/javascript" src="{% url django.views.i18n.javascript_catalog %}"></script>
<script type="text/javascript" src="{{ MUMBLE_DJANGO_URL }}mumble/api/api.js"></script>
<script type="text/javascript" src="{{ MUMBLE_MEDIA_PREFIX }}js/rendermumbleserver.js"></script>
<script type="text/javascript" src="{{ MUMBLE_MEDIA_PREFIX }}js/buttoniframewindow.js"></script>
<script type="text/javascript" src="{{ MUMBLE_MEDIA_PREFIX }}js/loginout_buttons.js"></script>
<script type="text/javascript" src="{% static 'mumble/js/rendermumbleserver.js' %}"></script>
<script type="text/javascript" src="{% static 'mumble/js/buttoniframewindow.js' %}"></script>
<script type="text/javascript" src="{% static 'mumble/js/loginout_buttons.js' %}"></script>
<script type="text/javascript">
Ext.onReady( function(){
Ext.QuickTips.init();

2
pyweb/mumble/templates/mumble/mobile_list.html

@ -11,7 +11,7 @@ Configured Mumble Servers
<ul>
{% for mumble in MumbleObjects %}
{% if mumble.booted %}
<li><a href="{% url mumble.views.mobile_show mumble.id %}">{{ mumble.name }}</a></li>
<li><a href="{% url 'mumble.views.mobile_show' mumble.id %}">{{ mumble.name }}</a></li>
{% else %}
<li>{{ mumble.name }} (offline)</li>
{% endif %}

25
pyweb/mumble/templates/mumble/mumble.html

@ -1,4 +1,5 @@
{% extends "index.html" %}
{% load staticfiles %}
{% comment %}
<!-- kate: space-indent on; indent-width 4; replace-tabs on; -->
{% endcomment %}
@ -8,10 +9,10 @@
{% endblock %}
{% block PageTitle %}Mumble :: {{ MumbleServer.name }}{% endblock %}
{% block HeadTag %}
<link rel="stylesheet" type="text/css" href="{{ MUMBLE_MEDIA_PREFIX }}css/tab-scroller-menu.css" />
<link rel="stylesheet" type="text/css" href="{% static 'mumble/css/tab-scroller-menu.css' %}" />
<style type="text/css">
.x-tab-tabmenu-right {
background: transparent url({{ MUMBLE_MEDIA_PREFIX }}img/tab-scroller-menu.gif) no-repeat 0 0;
background: transparent url({% static 'mumble/img/tab-scroller-menu.gif' %}) no-repeat 0 0;
}
</style>
<script src="{% url 'django.views.i18n.javascript_catalog' %}"></script>
@ -20,15 +21,15 @@
<script src="{{ MUMBLE_DJANGO_URL }}mumble/forms/choicescombo.js"></script>
<script src="{{ MUMBLE_DJANGO_URL }}mumble/forms/{{ RegForm|lower }}.js"></script>
<script src="{{ MUMBLE_DJANGO_URL }}mumble/forms/mumbleform.js"></script>
<script src="{{ MUMBLE_MEDIA_PREFIX }}js/TabScrollerMenu.js"></script>
<script src="{{ MUMBLE_MEDIA_PREFIX }}js/channelviewer.js"></script>
<script src="{{ MUMBLE_MEDIA_PREFIX }}js/channelviewerplugins.js"></script>
<script src="{{ MUMBLE_MEDIA_PREFIX }}js/rendermumbleserver.js"></script>
<script src="{{ MUMBLE_MEDIA_PREFIX }}js/usereditor.js"></script>
<script src="{{ MUMBLE_MEDIA_PREFIX }}js/logviewer.js"></script>
<script src="{{ MUMBLE_MEDIA_PREFIX }}js/banviewer.js"></script>
<script src="{{ MUMBLE_MEDIA_PREFIX }}js/buttoniframewindow.js"></script>
<script src="{{ MUMBLE_MEDIA_PREFIX }}js/loginout_buttons.js"></script>
<script src="{% static 'mumble/js/TabScrollerMenu.js' %}"></script>
<script src="{% static 'mumble/js/channelviewer.js' %}"></script>
<script src="{% static 'mumble/js/channelviewerplugins.js' %}"></script>
<script src="{% static 'mumble/js/rendermumbleserver.js' %}"></script>
<script src="{% static 'mumble/js/usereditor.js' %}"></script>
<script src="{% static 'mumble/js/logviewer.js' %}"></script>
<script src="{% static 'mumble/js/banviewer.js' %}"></script>
<script src="{% static 'mumble/js/buttoniframewindow.js' %}"></script>
<script src="{% static 'mumble/js/loginout_buttons.js' %}"></script>
<script type="text/javascript">
Ext.onReady( function(){
Ext.QuickTips.init();
@ -91,7 +92,7 @@
})
],
source_url: "{% url 'mumble.views.cvp_json' MumbleServer.id %}",
imageurl: '{{MUMBLE_MEDIA_PREFIX}}/img',
imageurl: '{% static "mumble/img" %}',
listeners: {
moveUser: function( tree, userdata, chandata ){
Mumble.moveUser( {{MumbleServer.id}}, userdata.session, chandata.id );

23
pyweb/mumble/templates/mumble/player.html

@ -2,37 +2,38 @@
<!-- kate: space-indent on; indent-width 2; replace-tabs on; -->
{% endcomment %}
{% load mumble_extras %}
{% load staticfiles %}
{% load i18n %}
<div class="mumble" style="background-image: url( {{MUMBLE_MEDIA_PREFIX}}/img/linie_v.png )">
<div class="mumble" style="background-image: url( {% static 'mumble/img/linie_v.png' %} )">
<span class="mumble">
{% if Player.isAuthed %}
<img src="{{MUMBLE_MEDIA_PREFIX}}/img/authenticated.png" alt="authed" title="{% trans "Authenticated" %}" />
<img src="{% static 'mumble/img/authenticated.png' %}" alt="authed" title="{% trans "Authenticated" %}" />
{% endif %}
{% if Player.mute %}
<img src="{{MUMBLE_MEDIA_PREFIX}}/img/muted_server.png" alt="muted" title="{% trans "Muted" %}" />
<img src="{% static 'mumble/img/muted_server.png' %}" alt="muted" title="{% trans "Muted" %}" />
{% endif %}
{% if Player.suppress %}
<img src="{{MUMBLE_MEDIA_PREFIX}}/img/muted_suppressed.png" alt="muted" title="{% trans "Suppressed" %}" />
<img src="{% static 'mumble/img/muted_suppressed.png' %}" alt="muted" title="{% trans "Suppressed" %}" />
{% endif %}
{% if Player.deaf %}
<img src="{{MUMBLE_MEDIA_PREFIX}}/img/deafened_server.png" alt="deafened" title="{% trans "Deafened" %}" />
<img src="{% static 'mumble/img/deafened_server.png' %}" alt="deafened" title="{% trans "Deafened" %}" />
{% endif %}
{% if Player.selfMute %}
<img src="{{MUMBLE_MEDIA_PREFIX}}/img/muted_self.png" alt="self-muted" title="{% trans "Muted by self" %}" />
<img src="{% static 'mumble/img/muted_self.png' %}" alt="self-muted" title="{% trans "Muted by self" %}" />
{% endif %}
{% if Player.selfDeaf %}
<img src="{{MUMBLE_MEDIA_PREFIX}}/img/deafened_self.png" alt="self-deafened" title="{% trans "Deafened by self" %}" />
<img src="{% static 'mumble/img/deafened_self.png' %}" alt="self-deafened" title="{% trans "Deafened by self" %}" />
{% endif %}
{% if Player.hasComment %}
<img src="{{MUMBLE_MEDIA_PREFIX}}/img/comment.png" alt="has comment" title="{% trans "has a User Comment set" %}" />
<img src="{% static 'mumble/img/comment.png' %}" alt="has comment" title="{% trans "has a User Comment set" %}" />
{% endif %}
</span>
<span>
<img src="{{MUMBLE_MEDIA_PREFIX}}/img/knoten_v.png" alt="" />
<img src="{% static 'mumble/img/knoten_v.png' %}" alt="" />
{% if Player.isTalking %}
<img src="{{MUMBLE_MEDIA_PREFIX}}/img/talking_on.png" alt="Player" />
<img src="{% static 'mumble/img/talking_on.png' %}" alt="Player" />
{% else %}
<img src="{{MUMBLE_MEDIA_PREFIX}}/img/talking_off.png" alt="Player" />
<img src="{% static 'mumble/img/talking_off.png' %}" alt="Player" />
{% endif %}
<a id="link_{{ Player.id }}" class="mumble" href="#" title="{{ Player.name }}">{{ Player.name|trunc:30 }}</a>
</span>

3
pyweb/mumble/templates/mumble/server.html

@ -2,8 +2,9 @@
<!-- kate: space-indent on; indent-width 2; replace-tabs on; -->
{% endcomment %}
{% load mumble_extras %}
{% load staticfiles %}
<div style="margin-left: 20px;">
<img src="{{MUMBLE_MEDIA_PREFIX}}/img/mumble.16x16.png" alt="server" />
<img src="{% static 'mumble/img/mumble.16x16.png' %}" alt="server" />
<a class="mumble" id="link_server" href="{{ Server|chanurl:MumbleAccount }}">{{ Server.name|trunc:30 }}</a>
</div>
{% for sub in Server.rootchan.subchans %}

6
pyweb/mumble/templatetags/mumble_extras.py

@ -38,22 +38,16 @@ def chanview( obj, user = None ):
return render_to_string( 'mumble/server.html', {
'Server': obj,
'MumbleAccount': user,
'MEDIA_URL': settings.MEDIA_URL,
'MUMBLE_MEDIA_PREFIX': settings.MUMBLE_MEDIA_PREFIX,
} )
elif obj.is_channel:
return render_to_string( 'mumble/channel.html', {
'Channel': obj,
'MumbleAccount': user,
'MEDIA_URL': settings.MEDIA_URL,
'MUMBLE_MEDIA_PREFIX': settings.MUMBLE_MEDIA_PREFIX,
} )
elif obj.is_player:
return render_to_string( 'mumble/player.html', {
'Player': obj,
'MumbleAccount': user,
'MEDIA_URL': settings.MEDIA_URL,
'MUMBLE_MEDIA_PREFIX': settings.MUMBLE_MEDIA_PREFIX,
} )

3
pyweb/processors.py

@ -25,8 +25,7 @@ def mumble_version(request):
def mumble_media_prefix(request):
from django.conf import settings
return { 'MUMBLE_MEDIA_PREFIX': settings.MUMBLE_MEDIA_PREFIX,
'MUMBLE_DJANGO_URL': settings.MUMBLE_DJANGO_URL}
return { 'MUMBLE_DJANGO_URL': settings.MUMBLE_DJANGO_URL}
def theme_url(request):
from django.conf import settings

21
pyweb/settings.py

@ -189,22 +189,19 @@ SITE_ID = 1
# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True
USE_L10N = True
# Absolute path to the directory that holds media.
MEDIA_ROOT = join( MUMBLE_DJANGO_ROOT, 'htdocs' )
STATIC_URL = MUMBLE_DJANGO_URL + 'static/'
# URL that handles the media served from MEDIA_ROOT.
MEDIA_URL = MUMBLE_DJANGO_URL + 'static/'
STATIC_URL = MEDIA_URL
STATIC_ROOT = MEDIA_ROOT
STATICFILES_DIRS = (
join( MUMBLE_DJANGO_ROOT, 'htdocs' ),
)
## URL to static files of the currently active theme
THEME_URL = '%sstatic/themes/%s/' % ( MUMBLE_DJANGO_URL, THEME )
# URL prefix for admin media -- CSS, JavaScript and images.
ADMIN_MEDIA_PREFIX = MUMBLE_DJANGO_URL + 'media/'
MUMBLE_MEDIA_PREFIX = MUMBLE_DJANGO_URL + 'mumble/media/'
ADMIN_MEDIA_PREFIX = MUMBLE_DJANGO_URL + 'static/admin/'
# URL to the login view
LOGIN_URL = MUMBLE_DJANGO_URL + 'accounts/login'
@ -282,7 +279,11 @@ CONVERSIONSQL_ROOT = join( MUMBLE_DJANGO_ROOT, "pyweb", "mumble", "conversionsql
INSTALLED_APPS = [
'django.contrib.auth',
'django.contrib.admin',
'django.contrib.admindocs',
'django.contrib.contenttypes',
'django.contrib.messages',
'django.contrib.markup',
'django.contrib.staticfiles',
'django.contrib.sessions',
'django.contrib.sites',
'mumble',
@ -305,4 +306,4 @@ modprobe( "rosetta" )
# Check if django_extensions is available.
modprobe( "django_extensions" )
modprobe( 'registration' )
#modprobe( 'registration' )

21
pyweb/templates/index.html

@ -1,24 +1,25 @@
{% load i18n %}
{% load staticfiles %}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{% block PageTitle %}Mumble Administration{% endblock %}</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}/ext-3.2.0/resources/css/ext-all.css" />
<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}/style.css" />
<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}/templatestyle.css" />
<link rel="stylesheet" type="text/css" href="{{ MUMBLE_MEDIA_PREFIX }}css/style.css" />
<link rel="shortcut icon" type="image/png" href="{{ MUMBLE_MEDIA_PREFIX }}img/mumble.16x16.png" />
<link rel="stylesheet" type="text/css" href="{% static 'ext-3.2.0/resources/css/ext-all.css' %}" />
<link rel="stylesheet" type="text/css" href="{% static 'style.css' %}" />
<link rel="stylesheet" type="text/css" href="{% static 'templatestyle.css' %}" />
<link rel="stylesheet" type="text/css" href="{% static 'mumble/css/style.css' %}" />
<link rel="shortcut icon" type="image/png" href="{% static 'mumble/img/mumble.16x16.png' %}" />
{% if debug %}
<script type="text/javascript" src="{{ MEDIA_URL }}/ext-3.2.0/adapter/ext/ext-base-debug.js"></script>
<script type="text/javascript" src="{{ MEDIA_URL }}/ext-3.2.0/ext-all-debug.js"></script>
<script type="text/javascript" src="{% static 'ext-3.2.0/adapter/ext/ext-base-debug.js' %}"></script>
<script type="text/javascript" src="{% static 'ext-3.2.0/ext-all-debug.js' %}"></script>
{% else %}
<script type="text/javascript" src="{{ MEDIA_URL }}/ext-3.2.0/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="{{ MEDIA_URL }}/ext-3.2.0/ext-all.js"></script>
<script type="text/javascript" src="{% static 'ext-3.2.0/adapter/ext/ext-base.js' %}"></script>
<script type="text/javascript" src="{% static 'ext-3.2.0/ext-all.js' %}"></script>
{% endif %}
<script type="text/javascript" src="{{ MEDIA_URL }}/checkcolumn.js"></script>
<script type="text/javascript" src="{% static 'checkcolumn.js' %}"></script>
{% block HeadTag %}
{% endblock %}

13
pyweb/templates/mobile_index.html

@ -1,3 +1,4 @@
{% load staticfiles %}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
@ -7,12 +8,12 @@
<!-- for iphone/ipod -->
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<link rel="apple-touch-icon" href="{{MUMBLE_MEDIA_PREFIX}}/img/mumble.64x64.png" />
<link rel="apple-touch-icon" href="{% static 'mumble/img/mumble.64x64.png' %}" />
<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}/style.css" />
<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}/templatestyle.css" />
<link rel="stylesheet" type="text/css" href="{{MUMBLE_MEDIA_PREFIX}}/css/style.css" />
<link rel="shortcut icon" type="image/png" href="{{MUMBLE_MEDIA_PREFIX}}/img/mumble.16x16.png" />
<link rel="stylesheet" type="text/css" href="{% static 'style.css' %}" />
<link rel="stylesheet" type="text/css" href="{% static 'templatestyle.css' %}" />
<link rel="stylesheet" type="text/css" href="{% static 'mumble/css/style.css' %}" />
<link rel="shortcut icon" type="image/png" href="{% static '/img/mumble.16x16.png' %}" />
{% block HeadTag %}
{% endblock %}
@ -25,7 +26,7 @@
<!-- footer -->
<div id="footerpanel" style="color:white">
<ul>
<li><a href="{% url mumble.views.redir %}" style="color:white">Home</a></li>
<li><a href="{% url 'mumble.views.redir' %}" style="color:white">Home</a></li>
<li><a href="http://bitbucket.org/Svedrin/mumble-django" style="color:white" target="_blank">Mumble-Django {{ CURRENTVERSION }}</a></li>
</ul>
</div>

Loading…
Cancel
Save