Browse Source

only display connect URLs if a sensible address is known

Natenom/support-murmur-13-1446181288462
Michael Ziegler 15 years ago
parent
commit
97baf5cc60
  1. 2
      pyweb/mumble/models.py
  2. 12
      pyweb/mumble/templates/mumble/channel.html
  3. 4
      pyweb/mumble/templates/mumble/mumble.html

2
pyweb/mumble/models.py

@ -414,6 +414,8 @@ class Mumble( models.Model ):
def getURL( self, forUser = None ):
""" Create an URL of the form mumble://username@host:port/ for this server. """
if not self.netloc:
return None
from urlparse import urlunsplit
versionstr = "version=%d.%d.%d" % tuple(self.version[:3]);
if forUser is not None:

12
pyweb/mumble/templates/mumble/channel.html

@ -6,9 +6,15 @@
{% else %}
<img src="{{ MEDIA_URL }}/mumble/channel.png" alt="channel" />
{% endif %}
<a href="{{ Channel|chanurl:MumbleAccount }}" class="mumble" id="link_{{ Channel.id }}" title="{{ Channel.name }}">
{{ Channel.name|trunc:30 }}
</a>
{% if Channel.server.netloc %}
<a href="{{ Channel|chanurl:MumbleAccount }}" class="mumble" id="link_{{ Channel.id }}" title="{{ Channel.name }}">
{{ Channel.name|trunc:30 }}
</a>
{% else %}
<a class="mumble" id="link_{{ Channel.id }}" title="{{ Channel.name }}">
{{ Channel.name|trunc:30 }}
</a>
{% endif %}
{% for sub in Channel.subchans %}
{% if sub.show %}
{{ sub|chanview:MumbleAccount }}

4
pyweb/mumble/templates/mumble/mumble.html

@ -21,7 +21,9 @@
<div id="mumble_ext_container"></div>
<div id="mumble_motd" class="mumble-ext x-hide-display">
<ul>
<li>{% trans "Server Address" %}: <a href="{{ DBaseObject.connecturl }}">{{ DBaseObject.connecturl }}</a></li>
{% if DBaseObject.connecturl %}
<li>{% trans "Server Address" %}: <a href="{{ DBaseObject.connecturl }}">{{ DBaseObject.connecturl }}</a></li>
{% endif %}
{% if DBaseObject.url %}
<li>{% trans "Website" %}: {{ DBaseObject.url|urlize }}</li>
{% endif %}

Loading…
Cancel
Save