Rewrite templates to handle additional sidebar information

This commit is contained in:
Trever Fischer
2012-06-07 16:55:37 -04:00
parent 7f710bd049
commit a5858ce11c
8 changed files with 50 additions and 34 deletions

View File

@@ -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>

View File

@@ -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 %}

View File

@@ -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>

View File

@@ -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 %}

View File

@@ -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 %}

View File

@@ -0,0 +1,2 @@
{% include "common/sidebars/world_status.html" %}
{% include "common/sidebars/forums.html" %}

View 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>

View 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>