Rewrite templates to handle additional sidebar information
This commit is contained in:
@@ -1,34 +1,3 @@
|
||||
{% load minecraft %}
|
||||
<div class="grid_4">
|
||||
<div id="statbox" class="stat-box">
|
||||
<h2 class="title">World Status</h2>
|
||||
<div class="time">
|
||||
Current time: <span id="time-display"></span>
|
||||
</div>
|
||||
{% for server in minecraft_servers %}
|
||||
<h3>{{server.hostname}}:{{server.port}}</h3>
|
||||
<a href="http://{{server.hostname}}/map/">Live Map</a>
|
||||
<a href="{% url minecraft.views.rules server=server.hostname port=server.port %}">Server Rules</a>
|
||||
<ul>
|
||||
{% if server.online_players %}
|
||||
{% for player in server.online_players%}
|
||||
<li><a href="{{player.user.get_absolute_url}}"><span class="avatar">{% avatar player.user 16 %}</span>{{player}}</a></li>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<li><em>Nobody...</em></li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% block sidebar %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
<div class="stat-box" id="forum-stats">
|
||||
<h2 class="title">Forums</h2>
|
||||
<h3>Latest Posts</h3>
|
||||
<ul>
|
||||
{% for post in latestForumPosts %}
|
||||
<li><a href="{{post.user.get_absolute_url}}">{{post.user}}</a> in <a href="{{post.get_absolute_url}}">{{post.topic}}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -7,5 +7,9 @@
|
||||
{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
{% include '_sidebar.html' %}
|
||||
<div class="grid_4">
|
||||
{%block sidebar_extra %}
|
||||
{% endblock %}
|
||||
{% include "common/default_sidebars.html" %}
|
||||
</div>
|
||||
{% endblock main %}
|
||||
|
@@ -88,6 +88,7 @@ s.parentNode.insertBefore(po, s);
|
||||
<li><a href="{% url user_profile %}">Your Profile</a></li>
|
||||
<li><a href="{% url local.views.invites %}">Invites</a></li>
|
||||
<li><a href="{% url messages.views.inbox %}">Mail: {{ messages_inbox_count }}</a></li>
|
||||
<li><a href="{% url petition.views.index %}">Petitions: {{open_petitions|length}}</a></li>
|
||||
</ul>
|
||||
{% else %}
|
||||
<h2 class="title">Login</h2>
|
||||
|
@@ -10,5 +10,9 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% include '_sidebar.html' %}
|
||||
<div class="grid_4">
|
||||
{% block sidebar_extra %}
|
||||
{% endblock %}
|
||||
{% include "common/default_sidebars.html" %}
|
||||
</div>
|
||||
{% endblock main %}
|
||||
|
@@ -12,6 +12,10 @@
|
||||
{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
{% include '_sidebar.html' %}
|
||||
<div class="grid_4">
|
||||
{% block sidebar_extra %}
|
||||
{% endblock %}
|
||||
{% include 'common/default_sidebars.html' %}
|
||||
</div>
|
||||
{% endblock main %}
|
||||
|
||||
|
2
templates/common/default_sidebars.html
Normal file
2
templates/common/default_sidebars.html
Normal file
@@ -0,0 +1,2 @@
|
||||
{% include "common/sidebars/world_status.html" %}
|
||||
{% include "common/sidebars/forums.html" %}
|
10
templates/common/sidebars/forums.html
Normal file
10
templates/common/sidebars/forums.html
Normal file
@@ -0,0 +1,10 @@
|
||||
<div class="stat-box" id="forum-stats">
|
||||
<h2 class="title">Forums</h2>
|
||||
<h3>Latest Posts</h3>
|
||||
<ul>
|
||||
{% for post in latestForumPosts %}
|
||||
<li><a href="{{post.user.get_absolute_url}}">{{post.user}}</a> in <a href="{{post.get_absolute_url}}">{{post.topic}}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
|
22
templates/common/sidebars/world_status.html
Normal file
22
templates/common/sidebars/world_status.html
Normal file
@@ -0,0 +1,22 @@
|
||||
{% load minecraft %}
|
||||
<div id="statbox" class="stat-box">
|
||||
<h2 class="title">World Status</h2>
|
||||
<div class="time">
|
||||
Current time: <span id="time-display"></span>
|
||||
</div>
|
||||
{% for server in minecraft_servers %}
|
||||
<h3>{{server.hostname}}:{{server.port}}</h3>
|
||||
<a href="http://{{server.hostname}}/map/">Live Map</a>
|
||||
<a href="{% url minecraft.views.rules server=server.hostname port=server.port %}">Server Rules</a>
|
||||
<ul>
|
||||
{% if server.online_players %}
|
||||
{% for player in server.online_players%}
|
||||
<li><a href="{{player.user.get_absolute_url}}"><span class="avatar">{% avatar player.user 16 %}</span>{{player}}</a></li>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<li><em>Nobody...</em></li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user