parent
b75ddee03b
commit
60806362bc
|
@ -25,7 +25,7 @@
|
|||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
{% template_settings 'DASHBOARD_TITLE' as DASHBOARD_TITLE %}
|
||||
<a class="navbar-brand">{% if DASHBOARD_TITLE %}{{ DASHBOARD_TITLE }}{% else %}Minecraft Manager{% endif %}</a>
|
||||
<a class="navbar-brand" style="color:inherit;cursor:default;">{% if DASHBOARD_TITLE %}{{ DASHBOARD_TITLE }}{% else %}Minecraft Manager{% endif %}</a>
|
||||
</div>
|
||||
<div id="navbar" class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
|
@ -54,6 +54,7 @@
|
|||
</li>
|
||||
</ul>
|
||||
<form method="GET" action="{% url 'player' %}" class="navbar-form navbar-right">
|
||||
<span><i class="glyphicon glyphicon-search"> </i></span>
|
||||
<input type="text" class="form-control" name="search" placeholder="Player Search..." value="{% if 'search' in request.GET %}{{ request.GET.search }}{% endif %}">
|
||||
<button class="btn btn-default" type="submit">Search</button>
|
||||
</form>
|
||||
|
|
|
@ -15,55 +15,24 @@ def get_sidebar(current_app, request):
|
|||
if len(unseen_alerts) > 0:
|
||||
unseen_html = " <span class='badge badge-light'>" + str(len(unseen_alerts)) + "</span>"
|
||||
|
||||
|
||||
ret = ""
|
||||
if current_app == 'overview':
|
||||
ret += "<li class=\"active\"><a href=\"" + reverse('overview') + "\">Overview</a></li>"
|
||||
else:
|
||||
ret += "<li><a href=\"" + reverse('overview') + "\">Overview</a></li>"
|
||||
if current_app == 'ban':
|
||||
ret += "<li class=\"active\"><a href=\"" + reverse('ban') + "\">Bans</a></li>"
|
||||
else:
|
||||
ret += "<li><a href=\"" + reverse('ban') + "\">Bans</a></li>"
|
||||
if current_app == 'alert':
|
||||
ret += "<li class=\"active\"><a href=\"" + reverse('alert') + "\">Alerts{0}</a></li>".format(unseen_html)
|
||||
else:
|
||||
ret += "<li><a href=\"" + reverse('alert') + "\">Alerts{0}</a></li>".format(unseen_html)
|
||||
ret = '<li {}><a href="{}"><span class="glyphicon glyphicon-home"></span> Overview</a></li>'.format('class="active"' if current_app == 'overview' else "", reverse('overview'))
|
||||
ret += '<li {}><a href="{}"><span class="glyphicon glyphicon-ban-circle"></span> Bans</a></li>'.format('class="active"' if current_app == 'ban' else '', reverse('ban'))
|
||||
ret += '<li {}><a href="{}"><span class="glyphicon glyphicon-inbox"></span> Alerts{}</a></li>'.format('class="active"' if current_app == 'alert' else '', reverse('alert'), unseen_html)
|
||||
|
||||
# Models
|
||||
if current_app == 'application':
|
||||
ret += "<li class=\"active\"><a href=\"" + reverse('application') + "\">Applications</a></li>"
|
||||
else:
|
||||
ret += "<li><a href=\"" + reverse('application') + "\">Applications</a></li>"
|
||||
if current_app == 'player':
|
||||
ret += "<li class=\"active\"><a href=\"" + reverse('player') + "\">Players</a></li>"
|
||||
else:
|
||||
ret += "<li><a href=\"" + reverse('player') + "\">Players</a></li>"
|
||||
if current_app == 'ticket':
|
||||
ret += "<li class=\"active\"><a href=\"" + reverse('ticket') + "\">Tickets</a></li>"
|
||||
else:
|
||||
ret += "<li><a href=\"" + reverse('ticket') + "\">Tickets</a></li>"
|
||||
if current_app == 'warning':
|
||||
ret += "<li class=\"active\"><a href=\"" + reverse('warning') + "\">Warnings</a></li>"
|
||||
else:
|
||||
ret += "<li><a href=\"" + reverse('warning') + "\">Warnings</a></li>"
|
||||
ret += '<li {}><a href="{}"><span class="glyphicon glyphicon-file"></span> Applications</a></li>'.format('class="active"' if current_app == 'application' else '', reverse('application'))
|
||||
ret += '<li {}><a href="{}"><span class="glyphicon glyphicon-user"></span> Players</a></li>'.format('class="active"' if current_app == 'player' else '', reverse('player'))
|
||||
ret += '<li {}><a href="{}"><span class="glyphicon glyphicon-tags"></span> Tickets</a></li>'.format('class="active"' if current_app == 'ticket' else '', reverse('ticket'))
|
||||
ret += '<li {}><a href="{}"><span class="glyphicon glyphicon-warning-sign"></span> Warnings</a></li>'.format('class="active"' if current_app == 'warning' else '', reverse('warning'))
|
||||
|
||||
# Split up MCM and "other"
|
||||
ret += "<hr/>"
|
||||
|
||||
if current_app == 'report':
|
||||
ret += "<li class=\"active\"><a href=\"" + reverse("report") + "\">Report</a></li>"
|
||||
else:
|
||||
ret += "<li><a href=\"" + reverse("report") + "\">Report</a></li>"
|
||||
ret += '<li {}><a href="{}"><span class="glyphicon glyphicon-wrench"></span> Report</a></li>'.format('class="active"' if current_app == 'report' else '', reverse('report'))
|
||||
|
||||
show_chat = True if getattr(settings, 'GLOBAL_LOG', None) is not None else False
|
||||
if show_chat and request.user.has_perm('auth.chat'):
|
||||
if current_app == 'chat':
|
||||
ret += "<li class=\"active\"><a href=\"" + reverse("chat") + "\">Chat</a></li>"
|
||||
else:
|
||||
ret += "<li><a href=\"" + reverse("chat") + "\">Chat</a></li>"
|
||||
ret += '<li {}><a href="{}"><span class="glyphicon glyphicon-comment"></span> Chat</a></li>'.format('class="active"' if current_app == 'chat' else '', reverse('chat'))
|
||||
if request.user.has_perm('auth.bots'):
|
||||
if current_app == 'bots':
|
||||
ret += "<li class=\"active\"><a href=\"" + reverse("bots") + "\">Bots</a></li>"
|
||||
else:
|
||||
ret += "<li><a href=\"" + reverse("bots") + "\">Bots</a></li>"
|
||||
ret += '<li {}><a href="{}"><span class="glyphicon glyphicon-flash"></span> Bots</a></li>'.format('class="active"' if current_app == 'bots' else '', reverse('bots'))
|
||||
return ret
|
||||
|
|
Loading…
Reference in New Issue