Source

py4u-opensource / pybook / templates / booklist.html

Full commit
{% extends "base.html" %}
{% block content %}
<style type="text/css">
.bookcover{
width: 135px;
}
.book_td{
padding: 20px 0;
}
.reporterror{
margin-left: 15px;
}
</style>
<table id='booklist'>
    {%for book in books%}
        <tr><td class='book_td'>
                <div class='bookcover'>
                    <a href='download?id={{book.id}}'>
                        <img src='/static/pybook_images/{{book.id}}.jpeg' width =100px height=120px />
                    </a>
                </div>
            </td>
            <td class='book_td'>
                <div class='bookinfo'>
                <table>
                    <tr>
                        <td style='width:88px;'>书名:</td>
                        <td style='width:488px;'>
                            <span class='span5'><a href='showbook?id={{book.id}}'>{{book.title}}</a></span>
                            <span class='span1'><a class="btn btn-small {%if book.stared%}btn-warning{%endif%}" href="javascript:void(0)" onclick='star_pybook({{book.id}}, this)'><i class="icon-star"></i></a></span>
                        </td>
                    </tr>
                    <tr>
                        <td>作者:</td>
                        <td><span class='span5'>{{book.author}}</span></td>
                    </tr>
                    {%if book.subtitle%}
                    <tr>
                        <td>副标题:</td>
                        <td>{{book.subtitle}}</td>
                    </tr>
                    {%endif%}
                    <tr>
                        <td>出版日期:</td>
                        <td>{{book.date}}</td>
                    </tr>
                    <tr>
                        <td>出版商:</td>
                        <td>{{book.publisher}}</td>
                    </tr>
                    <tr>
                        <td>页数:</td>
                        <td>{{book.number_of_page}}</td>
                    </tr>
                    <tr>
                        <td>ISBN:</td>
                        <td>{{book.ISBN}}</td>
                    </tr>
                </table>
                </div>
        <td style='border:none'>
            <p><a href='download?id={{book.id}}' class='btn btn-primary btn-large'><i class='icon-download-alt icon-white'></i> Download</a></p>
            <a href='report?id={{book.id}}' class='btn btn-danger btn-small reporterror'>Report Error</a>
        </td>

        </td></tr>
    {%endfor%}
</table>

<div class="pagination pagination-centered">
  <ul>
    {%if currentpage==1%}
        <li  class="disabled"><a>Prev</a></li>
    {%else%}
        <li ><a href='./{{currentpage-1}}'>Prev</a></li>
    {%endif%}

    {%for i in pages%}
        {%if i == currentpage%}
            <li class="active"><a>{{i}}</a></li>
        {%else%}
            <li><a href="./{{i}}">{{i}}</a></li>
        {%endif%}
    {%endfor%}
    {%if currentpage==9%}
         <li class="disabled"><a >Next</a></li>
    {%else%}
         <li><a href="./{{currentpage+1}}">Next</a></li>
    {%endif%}



  </ul>
</div>
{% endblock %}

{% block extra_info %}
<span class='span4 offset3' style='margin-top:10px'>
<a href='' class ='text-warning'>下载文件出错解决办法</a>
</span>

{% endblock %}

{% block script %}
$(document).ready(function(){
     $("#nav_book").addClass("active");
});

{% endblock %}