diff --git a/htdocs/grafs/bg.jpg b/htdocs/grafs/bg.jpg new file mode 100644 index 0000000..655f54a Binary files /dev/null and b/htdocs/grafs/bg.jpg differ diff --git a/htdocs/grafs/feue3.jpg b/htdocs/grafs/feue3.jpg new file mode 100644 index 0000000..837e56f Binary files /dev/null and b/htdocs/grafs/feue3.jpg differ diff --git a/htdocs/grafs/lin1.jpg b/htdocs/grafs/lin1.jpg new file mode 100644 index 0000000..84152d0 Binary files /dev/null and b/htdocs/grafs/lin1.jpg differ diff --git a/htdocs/grafs/lin10.jpg b/htdocs/grafs/lin10.jpg new file mode 100644 index 0000000..b81b58f Binary files /dev/null and b/htdocs/grafs/lin10.jpg differ diff --git a/htdocs/grafs/lin11.jpg b/htdocs/grafs/lin11.jpg new file mode 100644 index 0000000..1503722 Binary files /dev/null and b/htdocs/grafs/lin11.jpg differ diff --git a/htdocs/grafs/lin2.jpg b/htdocs/grafs/lin2.jpg new file mode 100644 index 0000000..d48361b Binary files /dev/null and b/htdocs/grafs/lin2.jpg differ diff --git a/htdocs/grafs/lin3.jpg b/htdocs/grafs/lin3.jpg new file mode 100644 index 0000000..cf1ffae Binary files /dev/null and b/htdocs/grafs/lin3.jpg differ diff --git a/htdocs/grafs/lin4.jpg b/htdocs/grafs/lin4.jpg new file mode 100644 index 0000000..6bf7eeb Binary files /dev/null and b/htdocs/grafs/lin4.jpg differ diff --git a/htdocs/grafs/lin5.jpg b/htdocs/grafs/lin5.jpg new file mode 100644 index 0000000..79c2341 Binary files /dev/null and b/htdocs/grafs/lin5.jpg differ diff --git a/htdocs/grafs/lin6.jpg b/htdocs/grafs/lin6.jpg new file mode 100644 index 0000000..37c61c7 Binary files /dev/null and b/htdocs/grafs/lin6.jpg differ diff --git a/htdocs/grafs/lin7.jpg b/htdocs/grafs/lin7.jpg new file mode 100644 index 0000000..37c61c7 Binary files /dev/null and b/htdocs/grafs/lin7.jpg differ diff --git a/htdocs/grafs/lin8.jpg b/htdocs/grafs/lin8.jpg new file mode 100644 index 0000000..d487b7d Binary files /dev/null and b/htdocs/grafs/lin8.jpg differ diff --git a/htdocs/grafs/lin9.jpg b/htdocs/grafs/lin9.jpg new file mode 100644 index 0000000..2d4a212 Binary files /dev/null and b/htdocs/grafs/lin9.jpg differ diff --git a/htdocs/grafs/shadow.png b/htdocs/grafs/shadow.png new file mode 100644 index 0000000..904dda9 Binary files /dev/null and b/htdocs/grafs/shadow.png differ diff --git a/htdocs/grafs/srs.gif b/htdocs/grafs/srs.gif new file mode 100644 index 0000000..27a9cc7 Binary files /dev/null and b/htdocs/grafs/srs.gif differ diff --git a/htdocs/layout.css b/htdocs/layout.css new file mode 100644 index 0000000..8f3d81c --- /dev/null +++ b/htdocs/layout.css @@ -0,0 +1,119 @@ +body { + font-family: "Trebuchet MS, Verdana, Arial"; + font-size: 9pt; + background-image: url(/static/grafs/bg.jpg); + margin: 0px; + background-attachment: fixed; + background-position: 0px 0px; + } + +#mm { + background: url(/static/grafs/lin10.jpg); + background-repeat: repeat-y; + /* Im naechsten stand mal Center, FireFox verpeilt dann aber die Linien... */ + background-position: left top; + text-align: left; + margin: 0px auto auto; + width: 444px; + } + +#cont { + background-image: url(/static/grafs/lin10.jpg); + background-repeat: repeat-y; + background-position: left top; + min-height: 60%; + width: 444px; + color: #FFFFFF; + text-align: left; + } + +.conx { + position: relative; + width: 430px; + left: 7px; + text-align: justify; + } + +h1 { + font-size: 14pt; + color: #C60307; + } + +img { + border-style: none; + } + +a.navi:link, a.navi:visited, a.navi:active, a.navi:hover { + font-weight: bold; + font-family: "Trebuchet MS"; + font-size: 9pt; + color: #283E53; + text-decoration: none; + } + +a:link, a:visited, a:hover, a:active { + font-weight: normal; + font-family: "Trebuchet MS"; + font-size: 9pt; + color: #FFFFFF; + text-decoration: underline; + } + +a.navi:hover, a:hover { + color: #A31313; + } + +.navibg { + background:url(/static/grafs/lin5.jpg); + width:444px; + height:22px; + } + +.navipos { + font-weight: bold; + color: #283E53; + width: 430px; + position: relative; + height: 18px; + top: 3px; + text-align: right; + left: 9px; + } + +.footerbg { + background:url(/static/grafs/lin11.jpg); + width:444px; + height:14px; + text-align:center + } + +.footer { + font-size: 7pt; + color: #283E53; + } + +/* shamelessly stolen from http://jquery.bassistance.de/tooltip/demo/ */ +#tooltip.pretty { + font-family: Arial; + border: none; + width: 210px; + padding:20px; + height: 135px; + opacity: 0.8; + background: url('/static/grafs/shadow.png'); + } +#tooltip.pretty h3 { + margin-bottom: 0.75em; + font-size: 12pt; + width: 220px; + text-align: center; + } + +#tooltip.pretty div { + width: 220px; + text-align: left; + } + +#tooltip.pretty a { + color: darkblue; + } diff --git a/mumble-django.wsgi b/mumble-django.wsgi new file mode 100644 index 0000000..d5d903c --- /dev/null +++ b/mumble-django.wsgi @@ -0,0 +1,9 @@ +import os, sys + +sys.path.append( '/usr/share/mumble-django' ) +sys.path.append( '/usr/share/mumble-django/pyweb' ) +os.environ['DJANGO_SETTINGS_MODULE'] = 'pyweb.settings' + +import django.core.handlers.wsgi +application = django.core.handlers.wsgi.WSGIHandler() + diff --git a/pyweb/__init__.py b/pyweb/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyweb/manage.py b/pyweb/manage.py new file mode 100755 index 0000000..bcdd55e --- /dev/null +++ b/pyweb/manage.py @@ -0,0 +1,11 @@ +#!/usr/bin/python +from django.core.management import execute_manager +try: + import settings # Assumed to be in the same directory. +except ImportError: + import sys + sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__) + sys.exit(1) + +if __name__ == "__main__": + execute_manager(settings) diff --git a/pyweb/mumble/templatetags/__init__.pyc b/pyweb/mumble/templatetags/__init__.pyc deleted file mode 100644 index 446d5b0..0000000 Binary files a/pyweb/mumble/templatetags/__init__.pyc and /dev/null differ diff --git a/pyweb/mumble/templatetags/mumble_extras.pyc b/pyweb/mumble/templatetags/mumble_extras.pyc deleted file mode 100644 index cd8437e..0000000 Binary files a/pyweb/mumble/templatetags/mumble_extras.pyc and /dev/null differ diff --git a/pyweb/mumble/urls.py b/pyweb/mumble/urls.py index ca002c2..aafb373 100644 --- a/pyweb/mumble/urls.py +++ b/pyweb/mumble/urls.py @@ -5,4 +5,5 @@ urlpatterns = patterns( ( r'savereg', 'mumble.views.savereg' ), ( r'reg/(?P\d+)', 'mumble.views.register' ), ( r'(?P\d+)', 'mumble.views.show' ), + ( r'$', 'mumble.views.mumbles' ), ) diff --git a/pyweb/mumble/views.py b/pyweb/mumble/views.py index 93c36ea..a041c3f 100644 --- a/pyweb/mumble/views.py +++ b/pyweb/mumble/views.py @@ -44,6 +44,14 @@ class Storage( object ): r = None; +def mumbles( request ): + "Displays a list of all configured Mumble servers." + return render_to_response( + 'mumble/list.htm', + { 'MumbleObjects': get_list_or_404( Mumble ) }, + context_instance = RequestContext(request) + ); + def show( request, server ): "Displays the channel list for the given Server ID." srv, o = createChannelList( server ); diff --git a/pyweb/settings.py b/pyweb/settings.py new file mode 100644 index 0000000..dcd9fc3 --- /dev/null +++ b/pyweb/settings.py @@ -0,0 +1,83 @@ +# Django settings for mumble_django project. + +DEBUG = True +TEMPLATE_DEBUG = DEBUG + +ADMINS = ( + # ('Your Name', 'your_email@domain.com'), +) + +MANAGERS = ADMINS + +DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. +DATABASE_NAME = '/tmp/mumble-django.db3' # Or path to database file if using sqlite3. +DATABASE_USER = '' # Not used with sqlite3. +DATABASE_PASSWORD = '' # Not used with sqlite3. +DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3. +DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3. + +# Local time zone for this installation. Choices can be found here: +# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name +# although not all choices may be available on all operating systems. +# If running in a Windows environment this must be set to the same as your +# system time zone. +TIME_ZONE = 'Europe/Berlin' + +# Language code for this installation. All choices can be found here: +# http://www.i18nguy.com/unicode/language-identifiers.html +LANGUAGE_CODE = 'en-us' + +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 + +# Absolute path to the directory that holds media. +# Example: "/home/media/media.lawrence.com/" +MEDIA_ROOT = '/usr/share/mumble-django/htdocs' + +# URL that handles the media served from MEDIA_ROOT. Make sure to use a +# trailing slash if there is a path component (optional in other cases). +# Examples: "http://media.lawrence.com", "http://example.com/media/" +MEDIA_URL = '' + +# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a +# trailing slash. +# Examples: "http://foo.com/media/", "/media/". +ADMIN_MEDIA_PREFIX = '/media/' + +# Make this unique, and don't share it with anybody. +SECRET_KEY = 'u-mp185msk#z4%s(do2^5405)y5d!9adbn92)apu_p^qvqh10v' + +# List of callables that know how to import templates from various sources. +TEMPLATE_LOADERS = ( + 'django.template.loaders.filesystem.load_template_source', + 'django.template.loaders.app_directories.load_template_source', +# 'django.template.loaders.eggs.load_template_source', +) + +MIDDLEWARE_CLASSES = ( + 'django.middleware.common.CommonMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', +) + +ROOT_URLCONF = 'pyweb.urls' + +TEMPLATE_DIRS = ( + # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". + # Always use forward slashes, even on Windows. + # Don't forget to use absolute paths, not relative paths. + '/home/mistagee/mumble-django/hgrep/template', +) + +INSTALLED_APPS = ( + 'django.contrib.auth', + 'django.contrib.admin', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.sites', + 'registration', + 'mumble', +) diff --git a/pyweb/urls.py b/pyweb/urls.py new file mode 100644 index 0000000..5b0b3b6 --- /dev/null +++ b/pyweb/urls.py @@ -0,0 +1,31 @@ +from django.conf.urls.defaults import * + +# Uncomment the next two lines to enable the admin: +from django.contrib import admin +admin.autodiscover() + +import settings + +urlpatterns = patterns('', + # Example: + # (r'^mumble_django/', include('mumble_django.foo.urls')), + + # Uncomment the admin/doc line below and add 'django.contrib.admindocs' + # to INSTALLED_APPS to enable admin documentation: + # (r'^admin/doc/', include('django.contrib.admindocs.urls')), + + (r'^accounts/profile/', 'views.profile' ), + (r'^accounts/', include('registration.urls')), + + (r'^mumble/', include('mumble.urls')), + + # Uncomment the next line to enable the admin: + (r'^admin/(.*)', admin.site.root), +) + +# Development stuff +if settings.DEBUG: + urlpatterns += patterns('', + (r'^static/(?P.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT, 'show_indexes': True}), + ) + diff --git a/pyweb/views.py b/pyweb/views.py new file mode 100644 index 0000000..cd3005d --- /dev/null +++ b/pyweb/views.py @@ -0,0 +1,26 @@ +from django.shortcuts import render_to_response, get_object_or_404, get_list_or_404 +from django.template import RequestContext +from django.http import HttpResponseRedirect +from django.core.urlresolvers import reverse +from django.contrib.auth.decorators import login_required +from django.contrib.auth.models import User + +from mumble.models import Mumble, MumbleUser +#from guestbook.models import Entry, Comment +#from forum.models import Post + +@login_required +def profile( request ): + userdata = { + "mumbleaccs": MumbleUser.objects.filter( owner = request.user ), +# "gbposts": Entry.objects.filter( author = request.user ).count(), +# "gbcomments": Comment.objects.filter( author = request.user ).count(), +# "forumposts": Post.objects.filter( author = request.user ).count(), + }; + + return render_to_response( + 'registration/profile.html', + userdata, + context_instance = RequestContext(request) + ); + diff --git a/template/base.htm b/template/base.htm new file mode 100644 index 0000000..92b9e29 --- /dev/null +++ b/template/base.htm @@ -0,0 +1,34 @@ + + + + {% block title %}Dingenskirchen{% endblock %} + + + + {% block headtags %}{% endblock %} + + +
+ +
+
+ {% block content %} +

No content found :(

+ {% endblock %} +
+
+
+ +
+
+ + diff --git a/template/mumble/content.htm b/template/mumble/content.htm index 405ded8..d65aea3 100644 --- a/template/mumble/content.htm +++ b/template/mumble/content.htm @@ -57,16 +57,3 @@

Mumble-Account verwalten

- diff --git a/template/mumble/list.htm b/template/mumble/list.htm new file mode 100644 index 0000000..ecfd059 --- /dev/null +++ b/template/mumble/list.htm @@ -0,0 +1,12 @@ +{% extends "base.htm" %} +{% load mumble_extras %} +{% block content %} +
+

Configured Mumble Servers

+ +
+{% endblock %} \ No newline at end of file diff --git a/template/mumble/reg.htm b/template/mumble/reg.htm index 99207d4..efd1430 100644 --- a/template/mumble/reg.htm +++ b/template/mumble/reg.htm @@ -1,8 +1,8 @@ {% extends "base.htm" %} {% block content %} {% if user.is_authenticated %} -

Mumble-Benutzerdaten festlegen

-

Diese Logindaten musst du angeben, um als authentifizierter Benutzer zu Mumble zu verbinden. Gib hier bitte deinen gewünschten Benutzernamen und dein gewünschtes Passwort an.

+

Set credentials for Mumble

+

Here you can set the credentials that you want to use to login to Mumble.

@@ -11,11 +11,11 @@ - + - + @@ -24,6 +24,6 @@
{{Mumble.name}}
Benutzername/LoginUsername/Login
PasswortPassword
{% else %} -

Dieses Privileg steht nur den Mitgliedern des Hohen Rates zu.

+

Only registered users can use this feature.

{% endif %} {% endblock %} diff --git a/template/registration/activate.html b/template/registration/activate.html new file mode 100644 index 0000000..890e85f --- /dev/null +++ b/template/registration/activate.html @@ -0,0 +1,20 @@ +{% extends "base.htm" %} +{% load i18n %} + +{% block title %}{% endblock %} + +{% block content %} +

Account successfully activated

+ +{% if account %} +

{% with account.username as username %} + Thank you for registering!
+ From now on, you can login with your username ({{ username }}). + {% endwith %} +

+{% else %} +

Either the link was invalid, or you didn't activate your account within {{ expiration_days }} days after the registration. Please register again.

+{% endif %} + +{% endblock %} + diff --git a/template/registration/activation_email.txt b/template/registration/activation_email.txt new file mode 100644 index 0000000..0c9d5f2 --- /dev/null +++ b/template/registration/activation_email.txt @@ -0,0 +1,11 @@ +{% load i18n %} +Hello, + +someone registered to {{ site }} and specified this EMail address. If this is correct, please follow this link to activate the account: + +http://{{ site|slice:":-1" }}{% url registration_activate activation_key=activation_key %} + +In case you didn't register, please ignore this Mail. The account will be deleted in {{ expiration_days }} days and you will not receive any more mail from us. + +Regards, +someone running a mumble-django Site. diff --git a/template/registration/activation_email_subject.txt b/template/registration/activation_email_subject.txt new file mode 100644 index 0000000..5af014e --- /dev/null +++ b/template/registration/activation_email_subject.txt @@ -0,0 +1 @@ +Account verification diff --git a/template/registration/login.html b/template/registration/login.html new file mode 100644 index 0000000..178705d --- /dev/null +++ b/template/registration/login.html @@ -0,0 +1,28 @@ +{% extends "base.htm" %} +{% load i18n %} + +{% block title %}Login{% endblock %} + +{% block content %} + +

Login

+ +{% if form.errors %} +

Username or password don't exist or are not correct. Please try again.

+{% endif %} + +
+ + + +
{{ form.username.label_tag }}{{ form.username }}
{{ form.password.label_tag }}{{ form.password }}
+ + + +
+ +{% endblock %} + diff --git a/template/registration/logout.html b/template/registration/logout.html new file mode 100644 index 0000000..67671a8 --- /dev/null +++ b/template/registration/logout.html @@ -0,0 +1,10 @@ +{% extends "base.htm" %} +{% load i18n %} + +{% block title %}You have been logged out{% endblock %} + +{% block content %} +

You have been logged out.

+

Thank you for visiting. +

+{% endblock %} diff --git a/template/registration/profile.html b/template/registration/profile.html new file mode 100644 index 0000000..d886e81 --- /dev/null +++ b/template/registration/profile.html @@ -0,0 +1,38 @@ +{% extends "base.htm" %} +{% load i18n %} + +{% block title %}Profil{% endblock %} + +{% block content %} +

Profil von {{user|capfirst}}

+
+

Statistics

+
    + {% if mumbleaccs %} +
  • Mumble Accounts: + +
  • + {% endif %} +
+
+
+

Account

+
    +
  • Full Name: {{ user.first_name }} {{ user.last_name }}
  • +
  • E-Mail Adress: {{ user.email }}
  • +
  • Staff: {% if user.is_staff %} yes (admin area) {% else %} no {% endif %}
  • +
  • Sign-up date: {{ user.date_joined }}
  • +
  • Last login: {{ user.last_login }}
  • +
  • Change Password
  • +
  • Logout
  • +
+
+{% endblock %} + diff --git a/template/registration/registration_complete.html b/template/registration/registration_complete.html new file mode 100644 index 0000000..d1a2212 --- /dev/null +++ b/template/registration/registration_complete.html @@ -0,0 +1,14 @@ +{% extends "base.htm" %} +{% load i18n %} + +{% block title %}Activate account{% endblock %} + +{% block content %} +

Activate your account

+

Thank you for registering. +{% if verify %} +In order to prohibit misuse, you need to activate your account before you can use it. We sent an EMail with further instructions to the address you specified, please follow the link in that email to activate your account. +{% endif %} +

+{% endblock %} + diff --git a/template/registration/registration_form.html b/template/registration/registration_form.html new file mode 100644 index 0000000..22623a7 --- /dev/null +++ b/template/registration/registration_form.html @@ -0,0 +1,51 @@ +{% extends "base.htm" %} +{% load i18n %} + +{% block title %}Create Account{% endblock %} + +{% block content %} +

Create Account

+

Please fill in the following form.

+ +
+ {% if form.non_field_errors %} +
+

Error:

+ {{ form.non_field_errors }} +
+ {% endif %} + +
+
{{ form.username.label_tag }}*
+
{{ form.username }}
+ {% if form.username.help_text %}
{{ form.username.help_text }}
{% endif %} + {% if form.username.errors %}
{{ form.username.errors }}
{% endif %} + +
{{ form.email.label_tag }}*
+
{{ form.email }}
+ {% if form.email.help_text %}
{{ form.email.help_text }}
{% endif %} + {% if form.email.errors %}
{{ form.email.errors }}
{% endif %} + +
{{ form.first_name.label_tag }}*
+
{{ form.first_name }}
+ {% if form.first_name.help_text %}
{{ form.first_name.help_text }}
{% endif %} + {% if form.first_name.errors %}
{{ form.first_name.errors }}
{% endif %} + +
{{ form.last_name.label_tag }}*
+
{{ form.last_name }}
+ {% if form.last_name.help_text %}
{{ form.last_name.help_text }}
{% endif %} + {% if form.last_name.errors %}
{{ form.last_name.errors }}
{% endif %} + +
{{ form.password1.label_tag }}*
+
{{ form.password1 }}
+ {% if form.password1.help_text %}
{{ form.password1.help_text }}
{% endif %} + {% if form.password1.errors %}
{{ form.password1.errors }}
{% endif %} + +
{{ form.password2.label_tag }}*
+
{{ form.password2 }}
+ {% if form.password2.help_text %}
{{ form.password2.help_text }}
{% endif %} + {% if form.password2.errors %}
{{ form.password2.errors }}
{% endif %} +
+ +
+{% endblock %}