parent
1ab05b90f4
commit
8d4d7669f4
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,114 +0,0 @@
|
||||
{% extends 'movie/base.html' %}
|
||||
{% block content %}
|
||||
<style>
|
||||
.item_ {
|
||||
display: block;
|
||||
float: left;
|
||||
font-size: 15px;
|
||||
text-align: center;
|
||||
margin: 0 25px 10px 0;
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
.item_ .poster_div {
|
||||
height: 320px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.li_ li {
|
||||
height: 45px;
|
||||
width: 115px;
|
||||
}
|
||||
|
||||
.{{ genre }} {
|
||||
}
|
||||
</style>
|
||||
<div class="container">
|
||||
<ul class="nav nav-pills li_">
|
||||
<li role="presentation" class="active"><a href="#">类型</a></li>
|
||||
<li role="presentation" class="Musical"><a href="{% url 'movie:tag' %}?genre=Musical">Musical</a></li>
|
||||
<li role="presentation" class="War"><a href="{% url 'movie:tag' %}?genre=War">War</a></li>
|
||||
<li role="presentation" class="Crime"><a href="{% url 'movie:tag' %}?genre=Crime">Crime</a></li>
|
||||
<li role="presentation" class="Romance"><a href="{% url 'movie:tag' %}?genre=Romance">Romance</a></li>
|
||||
<li role="presentation" class="Fantasy"><a href="{% url 'movie:tag' %}?genre=Fantasy">Fantasy</a></li>
|
||||
<li role="presentation" class="Drama"><a href="{% url 'movie:tag' %}?genre=Drama">Drama</a></li>
|
||||
<li role="presentation" class="Music"><a href="{% url 'movie:tag' %}?genre=Music">Music</a></li>
|
||||
<li role="presentation" class="Sci-Fi"><a href="{% url 'movie:tag' %}?genre=Sci-Fi">Sci-Fi</a></li>
|
||||
<li role="presentation" class="Action"><a href="{% url 'movie:tag' %}?genre=Action">Action</a></li>
|
||||
<li role="presentation" class="Comedy"><a href="{% url 'movie:tag' %}?genre=Comedy">Comedy</a></li>
|
||||
<li role="presentation" class="Biography"><a href="{% url 'movie:tag' %}?genre=Biography">Biography</a></li>
|
||||
<li role="presentation" class="Musical"><a href="{% url 'movie:tag' %}?genre=Family">Family</a></li>
|
||||
<li role="presentation" class="Horror"><a href="{% url 'movie:tag' %}?genre=Horror">Horror</a></li>
|
||||
<li role="presentation" class="Short"><a href="{% url 'movie:tag' %}?genre=Short">Short</a></li>
|
||||
<li role="presentation" class="Documentary"><a
|
||||
href="{% url 'movie:tag' %}?genre=Documentary">Documentary</a>
|
||||
</li>
|
||||
<li role="presentation" class="Film-Noir"><a href="{% url 'movie:tag' %}?genre=Film-Noir">Film-Noir</a></li>
|
||||
<li role="presentation" class="Animation"><a href="{% url 'movie:tag' %}?genre=Animation">Animation</a></li>
|
||||
<li role="presentation" class="Adventure"><a href="{% url 'movie:tag' %}?genre=Adventure">Adventure</a></li>
|
||||
<li role="presentation" class="Mystery"><a href="{% url 'movie:tag' %}?genre=Mystery">Mystery</a></li>
|
||||
<li role="presentation" class="News"><a href="{% url 'movie:tag' %}?genre=News">News</a></li>
|
||||
<li role="presentation" class="Sport"><a href="{% url 'movie:tag' %}?genre=Sport">Sport</a></li>
|
||||
<li role="presentation" class="History"><a href="{% url 'movie:tag' %}?genre=History">History</a></li>
|
||||
<li role="presentation" class="Thriller"><a href="{% url 'movie:tag' %}?genre=Thriller">Thriller</a></li>
|
||||
<li role="presentation" class="Western"><a href="{% url 'movie:tag' %}?genre=Western">Western</a></li>
|
||||
</ul>
|
||||
{% if genre %}
|
||||
<div class="alert alert-info" role="alert">{{ genre }} 类型的电影:</div>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
<!--展示电影图片用-->
|
||||
<div class="container">
|
||||
{% for movie in movies %}
|
||||
<a href="{% url 'movie:detail' movie.pk %}" class="item_">
|
||||
<div class="poster_div">
|
||||
<img src="/static/movie/poster/{{ movie.imdb_id }}.jpg" alt="">
|
||||
<p>{{ movie.name }}
|
||||
<strong style="color:#e09015">{{ movie.get_score }}</strong>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<nav style="text-align: center;">
|
||||
<ul class="pagination">
|
||||
{#previous page#}
|
||||
{% if page_obj.has_previous %}
|
||||
<li><a href="{% url 'movie:tag' %}?genre={{ genre }}&p={{ page_obj.previous_page_number }}">上一页</a></li>
|
||||
{% else %}
|
||||
<li class="disabled"><a href="javascript:void(0);">上一页</a></li>
|
||||
{% endif %}
|
||||
|
||||
{% if left_has_more %}
|
||||
<li><a href="{% url 'movie:tag' %}?genre={{ genre }}&p=1">1</a></li>
|
||||
<li><a href="javascript:void(0)">...</a></li>
|
||||
{% endif %}
|
||||
|
||||
{# 左边的page#}
|
||||
{% for left_page in left_pages %}
|
||||
<li><a href="{% url 'movie:tag' %}?genre={{ genre }}&p={{ left_page }}">{{ left_page }}</a></li>
|
||||
{% endfor %}
|
||||
|
||||
{# 当前的page#}
|
||||
<li class="active"><a href="javascript:void(0);">{{ current_page }}</a></li>
|
||||
|
||||
{# 右边的page#}
|
||||
{% for right_page in right_pages %}
|
||||
<li><a href="{% url 'movie:tag' %}?genre={{ genre }}&p={{ right_page }}">{{ right_page }}</a></li>
|
||||
{% endfor %}
|
||||
{% if right_has_more %}
|
||||
<li><a href="javascript:void(0)">...</a></li>
|
||||
<li><a href="{% url 'movie:tag' %}?genre={{ genre }}&p={{ paginator.num_pages }}">{{ paginator.num_pages }}</a></li>
|
||||
{% endif %}
|
||||
{#next page#}
|
||||
{% if page_obj.has_next %}
|
||||
<li><a href="{% url 'movie:tag' %}?genre={{ genre }}&p={{ page_obj.next_page_number }}">下一页</a></li>
|
||||
{% else %}
|
||||
<li class="disabled"><a href="javascript:void(0);">上一页</a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</nav>
|
||||
{% endblock %}
|
Loading…
Reference in new issue