Browse Source

order servers by name, and display a helpful message when none have been entered into the db

Natenom/support-murmur-13-1446181288462
Michael Ziegler 15 years ago
parent
commit
a71c0704e1
  1. 3
      pyweb/mumble/templates/mumble/list.html
  2. 2
      pyweb/mumble/views.py

3
pyweb/mumble/templates/mumble/list.html

@ -2,6 +2,7 @@
{% comment %} {% comment %}
<!-- kate: space-indent on; indent-width 2; replace-tabs on; --> <!-- kate: space-indent on; indent-width 2; replace-tabs on; -->
{% endcomment %} {% endcomment %}
{% load i18n %}
{% load mumble_extras %} {% load mumble_extras %}
{% block Headline %} {% block Headline %}
Configured Mumble Servers Configured Mumble Servers
@ -15,6 +16,8 @@ Configured Mumble Servers
{% else %} {% else %}
<li>{{ mumble.name }} (offline)</li> <li>{{ mumble.name }} (offline)</li>
{% endif %} {% endif %}
{% empty %}
{% trans "No server instances have been configured yet." %}
{% endfor %} {% endfor %}
</ul> </ul>
</div> </div>

2
pyweb/mumble/views.py

@ -64,7 +64,7 @@ def mobile_mumbles( request ):
def mumbles( request, mobile=False ): def mumbles( request, mobile=False ):
""" Display a list of all configured Mumble servers, or redirect if only one configured. """ """ Display a list of all configured Mumble servers, or redirect if only one configured. """
mms = get_list_or_404( Mumble );
mms = Mumble.objects.all().order_by( "name" );
if len(mms) == 1: if len(mms) == 1:
return HttpResponseRedirect( reverse( return HttpResponseRedirect( reverse(

Loading…
Cancel
Save