Browse Source

check for an existing texture when building the page, and display a message when none is set. fixes #43

Natenom/support-murmur-13-1446181288462
Michael Ziegler 15 years ago
parent
commit
ebf1f59b5c
  1. BIN
      pyweb/mumble/locale/de/LC_MESSAGES/django.mo
  2. 12
      pyweb/mumble/locale/de/LC_MESSAGES/django.po
  3. 8
      pyweb/mumble/models.py
  4. 12
      template/mumble/mumble.htm

BIN
pyweb/mumble/locale/de/LC_MESSAGES/django.mo

12
pyweb/mumble/locale/de/LC_MESSAGES/django.po

@ -267,16 +267,20 @@ msgstr "Benutzertextur"
msgid "" msgid ""
"\n" "\n"
" You can upload an image that you would like to use as your user texture here.<br />\n"
" Your current texture is:<br />\n"
" You can upload an image that you would like to use as your user texture here.\n"
" " " "
msgstr "" msgstr ""
"\n" "\n"
" Du kannst hier ein Bild hochladen, das als deine Benutzertextur " " Du kannst hier ein Bild hochladen, das als deine Benutzertextur "
"angezeigt werden soll.<br />\n"
" Deine momentane Textur ist diese:<br />\n"
"angezeigt werden soll.\n"
" " " "
msgid "Your current texture is"
msgstr "Deine momentane Textur ist diese"
msgid "You don't currently have a texture set"
msgstr "Du hast momentan keine Textur gesetzt"
msgid "\n" msgid "\n"
" Hint: The texture image <b>needs</b> to be 600x60 in size. If " " Hint: The texture image <b>needs</b> to be 600x60 in size. If "
"you upload an image with\n" "you upload an image with\n"

8
pyweb/mumble/models.py

@ -427,6 +427,14 @@ class MumbleUser( models.Model ):
"""Read an image from the infile and install it as the user's texture.""" """Read an image from the infile and install it as the user's texture."""
self.server.ctl.setTexture(self.server.srvid, self.mumbleid, infile) self.server.ctl.setTexture(self.server.srvid, self.mumbleid, infile)
def hasTexture( self ):
try:
self.getTexture();
except ValueError:
return False;
else:
return True;
# Deletion handler # Deletion handler
@staticmethod @staticmethod

12
template/mumble/mumble.htm

@ -59,10 +59,16 @@
<h2>{% trans "User Texture" %}</h2> <h2>{% trans "User Texture" %}</h2>
<p> <p>
{% blocktrans with DBaseObject.id as serverid %} {% blocktrans with DBaseObject.id as serverid %}
You can upload an image that you would like to use as your user texture here.<br />
Your current texture is:<br />
{% endblocktrans %}
You can upload an image that you would like to use as your user texture here.
{% endblocktrans %}<br />
<br />
{% if MumbleAccount.hasTexture %}
{% trans "Your current texture is" %}:<br />
<img src="{% url mumble.views.showTexture DBaseObject.id MumbleAccount.id %}" alt="user texture" /><br /> <img src="{% url mumble.views.showTexture DBaseObject.id MumbleAccount.id %}" alt="user texture" /><br />
{% else %}
{% trans "You don't currently have a texture set" %}.<br />
{% endif %}
<br />
{% blocktrans with DBaseObject.id as serverid %} {% blocktrans with DBaseObject.id as serverid %}
Hint: The texture image <b>needs</b> to be 600x60 in size. If you upload an image with Hint: The texture image <b>needs</b> to be 600x60 in size. If you upload an image with
a different size, it will be resized accordingly.<br /> a different size, it will be resized accordingly.<br />

Loading…
Cancel
Save