From ebf1f59b5ca063182f0c84f126eafd7eb8f51b07 Mon Sep 17 00:00:00 2001 From: Michael Ziegler Date: Thu, 29 Oct 2009 11:28:34 +0100 Subject: [PATCH] check for an existing texture when building the page, and display a message when none is set. fixes #43 --- pyweb/mumble/locale/de/LC_MESSAGES/django.mo | Bin 7705 -> 7768 bytes pyweb/mumble/locale/de/LC_MESSAGES/django.po | 12 ++++++++---- pyweb/mumble/models.py | 8 ++++++++ template/mumble/mumble.htm | 12 +++++++++--- 4 files changed, 25 insertions(+), 7 deletions(-) diff --git a/pyweb/mumble/locale/de/LC_MESSAGES/django.mo b/pyweb/mumble/locale/de/LC_MESSAGES/django.mo index c74df78ca64dbf372198b9c3c6971d2d32b27629..ad229e92653a827a742975b66664728801452750 100644 GIT binary patch delta 1454 zcmXZcTS!zv9LMqh+Nx<+)3kd>D@zS2LoKQ3Mv)O|m?cTHwuiFKU07GiBDccskJ~;N zMMXW857s_N5ZPM=y%a_EU_l{45J5>`5cU1pSw_yPminQ4~eGaJIw)W1$Nn}VS%GY#p&nHa~pn8d000GH!a zRGe=(jc%5mZ8nL9IarFt$lO+sT-L-*0fLx|QJjJ2QT=*xI^M=2e25G1EfT;+u?zhK zIe^_rY#YWH@$Cx*t+08r*-8wd>Nk+F)`to(fNStMF2poer5zR_O}5^12i8#Eha}As zn1k1FH}+u#{?&8hTLsY+U=3=bTGYz-qIP%~xh%p>EAK|uY!^MRqWa(R>iwu!@YrjA zjhg=xDuX|f%QBUJ14LhhDns6kvN5$6vl8i_Rb<0rciXH>v396u!FN#>*4m!NjM z3ia;Sp?)Q`sD69AdJr{V1U2p)YGDbl{m%dPxILnvl|4fp!jHHKf1q|)$-hMqo3I6+ zpfXcPel>9^D)4HrzRj!eL9%T@RR5ExSKWg;8_97ObNDFeoeg3cj(GJP{zV+>)e928 z{f)j|iTd;lzPiNw^j*HiiIR+J--J{kW2Y}QoVhG(X;Y-b2}Z(8W6q(DXw(hIj&(Ul z0-dfCaANN9SVz=#+TEBX1~Us%{+x|zsZ+Vvvx~QM(5XG9iK4dWx6 O!!AQkFsL!t@!3Cw$fRQc delta 1397 zcmZwHPe@cz6vy#1>dd6&pV87ZHT$D9X@!DHW@eGl5GqLwBpIerfwr)s$f!v|ESZU7 zkPwl`Tqp@ev#4-UZY&6NSrPPy1Q+F^O<}m``@>hOhVgywJ>GZEJ?A}rS3OuA`k0k>;XV!sB30(M$dCVqo9B*ULYvyyA&EqxZi!02Mu{+VsjW=)&-okY_iYfRK zOK=vIX9-iyLYAFmwvvD!w_-W6x3wZ)JIzH2&S3`jU^)(<){S8rKE{nWh50y#B(Qik zzl0fh3?oQx`;OsZHFA2F^hS-<7HIkQDhGr z#zKr?9==Ca_zQc`%gyb06V;Igyoau}X4!Z@#2~<65|!9ZR28M57UXiNzzW=iXHXU1 zLA7)OmGBw1;%ijP{VdYKOR*LMco_Rp_kBVY5c9)^(`A ziYC&I@_b9Cy$aAMJAYxh%TqZsZ#9 zRJu0DdOY=!`cj7S8BR F`U3@PkTU=P diff --git a/pyweb/mumble/locale/de/LC_MESSAGES/django.po b/pyweb/mumble/locale/de/LC_MESSAGES/django.po index b808bfc..86e7156 100644 --- a/pyweb/mumble/locale/de/LC_MESSAGES/django.po +++ b/pyweb/mumble/locale/de/LC_MESSAGES/django.po @@ -267,16 +267,20 @@ msgstr "Benutzertextur" msgid "" "\n" -" You can upload an image that you would like to use as your user texture here.
\n" -" Your current texture is:
\n" +" You can upload an image that you would like to use as your user texture here.\n" " " msgstr "" "\n" " Du kannst hier ein Bild hochladen, das als deine Benutzertextur " -"angezeigt werden soll.
\n" -" Deine momentane Textur ist diese:
\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" " Hint: The texture image needs to be 600x60 in size. If " "you upload an image with\n" diff --git a/pyweb/mumble/models.py b/pyweb/mumble/models.py index a8e64e6..b55c71f 100644 --- a/pyweb/mumble/models.py +++ b/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.""" 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 @staticmethod diff --git a/template/mumble/mumble.htm b/template/mumble/mumble.htm index d33a83d..6913f25 100644 --- a/template/mumble/mumble.htm +++ b/template/mumble/mumble.htm @@ -59,10 +59,16 @@

{% trans "User Texture" %}

{% blocktrans with DBaseObject.id as serverid %} - You can upload an image that you would like to use as your user texture here.
- Your current texture is:
- {% endblocktrans %} + You can upload an image that you would like to use as your user texture here. + {% endblocktrans %}
+
+ {% if MumbleAccount.hasTexture %} + {% trans "Your current texture is" %}:
user texture
+ {% else %} + {% trans "You don't currently have a texture set" %}.
+ {% endif %} +
{% blocktrans with DBaseObject.id as serverid %} Hint: The texture image needs to be 600x60 in size. If you upload an image with a different size, it will be resized accordingly.