删除每个页面上单独查询公告的逻辑,改为使用 templatetag 实现。

This commit is contained in:
virusdefender
2015-09-11 23:10:54 +08:00
parent c1e0c7cd3a
commit d6499c71aa
6 changed files with 19 additions and 21 deletions

View File

@@ -1,3 +1,4 @@
{% load announcement_list %}
<div class="panel panel-info">
<div class="panel-heading">
<h3 class="panel-title">
@@ -5,8 +6,9 @@
公告
</h3></div>
<div class="panel-body">
{% public_announcement_list as announcements %}
{% if announcements %}
{% for item in announcements %}
{% for item in announcements%}
<p>{{ forloop.counter }}.&nbsp;&nbsp;<a href="/announcement/{{ item.id }}/" target="_blank">{{ item.title }}</a>
</p>
{% endfor %}

View File

@@ -3,7 +3,7 @@
{% block body %}
{% load submission %}
<div class="container main">
<div class="col-md-9 col-lg-9">
<div class="col-md-12 col-lg-12">
<table class="table table-striped">
<thead>
<tr>
@@ -92,8 +92,6 @@
<p>你还没有提交记录!</p>
{% endif %}
</div>
<div class="col-md-3 col-lg-3">
{% include "oj/announcement/_announcement_panel.html" %}
</div>
</div>
{% endblock %}