{{extend "forums_layout.html"}}

{{block content_main}}
<div id="forum-body">
    {{if count > 0:}}
    <table border=0 width="100%">
        <tbody>
            {{for c in categories:}}
                <tr>
                    <th align="left">{{=c.name}}</th>
                    <th>主题</th>
                    <th>文章</th>
                    <th>最新文章</th>
                </tr>
                {{from uliweb.utils.timesince import timesince
                for f in c.forums.all().order_by('ordering'):}}
                    <tr>
                        <td width="*"><div class="title"><h3><a href="/forum/{{=f.id}}">{{=f.name}}</a></h3><p>{{=f.description}}</p></div></td>
                        <td align="center" width="60">{{=f.num_topics}}</td>
                        <td align="center" width="60">{{=f.num_posts}}</td>
                        <td align="center" width="200"><cite>{{=f.get_display_value('last_post_user', f.last_post_user)}}</cite><em>{{=timesince(f.last_reply_on)}}</em></td>
                    </tr>
                {{pass}}
            {{pass}}
        </tbody>
    </table>
    {{else:}}
        {{include "inc_message.html"}}
        {{message('还没有创建任何论坛，请由系统管理员来创建')}}
    {{pass}}
</div>
{{end}}