{% extends "template/template.html" %}
{% block title%}Knowledge Base{% endblock %}
{% block breadcrumbs %}<div class="breadcrumbs"><A HREF="/">Home</A> &rsaquo; <A HREF="/kb/">Knowledge Base</A></div>{% endblock %}
{% block content %}
<ul class="object-tools">
    <LI><A HREF="/admin/kb/kbentry/add/" class="addlink">Add KB Entry</A></LI>
</ul>

<h1>Knowledge Base</h1>
<!--
<FORM>
    <B>Search:</B> 
</FORM>
-->
<STYLE>
#tabs {
    padding: .2em;
}

#tabs-nav {
    border-bottom: 1px solid #FFFFFF;
    cursor: pointer;
    background-color: #999999;
    padding: 4px 0px 0px 4px;
}

.selected-tab {
    background-color: #FFFFFF;
}

.unselected-tab {
    background-color: #999999;
}

.selected-tab A {
    color: #999999;
    padding: 8px;
    font-weight: bold;
}

.unselected-tab A {
    color: #FFFFFF;
    padding: 8px;
    font-weight: bold;
}
</STYLE>

<DIV ID="tabs">
<DIV ID="tabs-nav">
    <SPAN CLASS='{% ifequal tab "bookmarks" %}selected-tab{%else%}unselected-tab{%endifequal%}'><A HREF="/kb/bookmarks/">Bookmarks</A></SPAN>
    <SPAN CLASS='{% ifequal tab "latest" %}selected-tab{%else%}unselected-tab{%endifequal%}'><A HREF="/kb/latest/">Last Changed</A></SPAN>
    <SPAN CLASS='{% ifequal tab "popular" %}selected-tab{%else%}unselected-tab{%endifequal%}'><A HREF="/kb/popular/">Popular Articles</A></SPAN>
    <SPAN CLASS='{% ifequal tab "all" %}selected-tab{%else%}unselected-tab{%endifequal%}'><A HREF="/kb/all/">All Articles</A></SPAN>

</DIV>
<TABLE BORDER="0">
    <TR><TH>#</TH><TH>Subject</TH><TH>Views</TH><TH>Modified</TH><TH>Modified by</TH></TR>
    {% for e in entries %}
    <TR CLASS="{% cycle 'row1' 'row2' %}">
        <TD ALIGN="right"><A HREF="/kb/{{e.id}}/">KB{{e.id}}</A></TD>
        <TD>{{e.subject}}</TD>
        <TD>{{e.preview_count}}</TD>
        <TD>{{e.last_history.timestamp|date}} {{e.last_history.timestamp|time}}</TD>
        <TD>{{e.last_history.user}}</TD>
    </TR>
    {% endfor %}
</TABLE>
</DIV>
{% endblock %}
