whitespace and remove unused last_user variable on forum homepage

This commit is contained in:
Glen Chiacchieri 2013-04-04 22:07:15 +00:00
parent dd60f43182
commit 3c591af3ff
2 changed files with 53 additions and 54 deletions

View file

@ -8,64 +8,64 @@
{% block extra_meta %}
<script type="text/javascript">
function set_collapser(cat_id) {
category_body_id = "category_body_" + cat_id;
if($.cookie(category_body_id)){
item_id = "#" + category_body_id;
head_id = item_id.replace("body", "head");
$(head_id).addClass("collapsed");
$(item_id).hide()
}
}
$(document).ready(function(){
$("a.toggle").click(function(){
header_id = $(this).parent().attr('id');
body_id = header_id.replace("head", "body");
item_id = '#' + body_id
if ($(this).parent().attr('class')==''){
$(this).parent().addClass("collapsed");
$.cookie(body_id, 'collapsed');
} else {
$(this).parent().removeClass("collapsed");
$.cookie(body_id, '');
}
$(item_id).slideToggle("slow");
});
{% for iter in cats %}
set_collapser({{ iter.id }})
{% endfor %}
});
function set_collapser(cat_id) {
category_body_id = "category_body_" + cat_id;
if($.cookie(category_body_id)){
item_id = "#" + category_body_id;
head_id = item_id.replace("body", "head");
$(head_id).addClass("collapsed");
$(item_id).hide()
}
}
$(document).ready(function(){
$("a.toggle").click(function(){
header_id = $(this).parent().attr('id');
body_id = header_id.replace("head", "body");
item_id = '#' + body_id
if ($(this).parent().attr('class')==''){
$(this).parent().addClass("collapsed");
$.cookie(body_id, 'collapsed');
} else {
$(this).parent().removeClass("collapsed");
$.cookie(body_id, '');
}
$(item_id).slideToggle("slow");
});
{% for iter in cats %}
set_collapser({{ iter.id }})
{% endfor %}
});
</script>
{% endblock %}
{% block content %}
<div id="idx1" class="blocktable">
{% for iter in cats %}
<div class="box" id="category_body_{{ iter.id }}">
<div class="box-head">
<h4 id="category_head_{{ iter.id }}">
<a class="toggle" href="#">Toggle shoutbox</a>
{{ iter.cat }}
</h4>
</div>
<div class="box-content">
<table cellspacing="0">
<thead>
<tr>
<th class="tcl" scope="col">{% trans "Forum" %}</th>
<th class="tc2" scope="col">{% trans "Topics" %}</th>
<th class="tc3" scope="col">{% trans "Posts" %}</th>
<th class="tcr" scope="col">{% trans "Last Post" %}</th>
</tr>
</thead>
<tbody>
{% for forum in iter.forums %}
{% include 'djangobb_forum/forum_row.html' %}
{% endfor %}
</tbody>
</table>
</div>
</div>
<div class="box" id="category_body_{{ iter.id }}">
<div class="box-head">
<h4 id="category_head_{{ iter.id }}">
<a class="toggle" href="#">Toggle shoutbox</a>
{{ iter.cat }}
</h4>
</div>
<div class="box-content">
<table cellspacing="0">
<thead>
<tr>
<th class="tcl" scope="col">{% trans "Forum" %}</th>
<th class="tc2" scope="col">{% trans "Topics" %}</th>
<th class="tc3" scope="col">{% trans "Posts" %}</th>
<th class="tcr" scope="col">{% trans "Last Post" %}</th>
</tr>
</thead>
<tbody>
{% for forum in iter.forums %}
{% include 'djangobb_forum/forum_row.html' %}
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endfor %}
</div>
{% endblock %}
@ -91,7 +91,7 @@
<dd>{{ online|profile_link }}{% if not forloop.last %},{% endif %}</dd>
{% endfor %}
{% if online_truncated %}
<dd>{% trans "…and more." %}</dd>
<dd>{% trans "…and more." %}</dd>
{% endif %}
</dl>
{% endblock %}

View file

@ -73,7 +73,6 @@ def index(request, full=True):
'online_count': users_count,
'online_truncated': online_truncated,
'guest_count': guest_count,
'last_user': User.objects.latest('date_joined')
}
if full:
return render(request, 'djangobb_forum/index.html', to_return)