You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

110 lines
3.7 KiB

{% extends 'movie/base.html' %}
{% block content %}
<script src="{% static 'layer/layer.js' %}"></script>
<style>
.poster {
float: left;
margin: 3px 12px 0 0;
overflow: hidden;
text-align: center;
}
.info {
margin-top: 15px;
float: left;
word-wrap: break-word;
}
hr {
-moz-border-bottom-colors: none;
-moz-border-image: none;
-moz-border-left-colors: none;
-moz-border-right-colors: none;
-moz-border-top-colors: none;
border-color: #c9302c;
border-style: solid none;
border-width: 1px 0;
margin: 18px 0;
}
</style>
<div class="container">
{% for message in messages %}
{% if message.tags == 'info' %}
<div class="alert alert-success" role="alert">{{ message }}</div>
{% endif %}
{% endfor %}
<div class="alert-success alert" role="alert">评分历史</div>
</div>
{% for rating in ratings %}
<div class="container">
<div class="poster">
<a href="{% url 'movie:detail' rating.movie.pk %}" class="item">
<div class="poster_div">
<img src="/static/movie/poster/{{ rating.movie.imdb_id }}.jpg" alt="">
</div>
</a>
</div>
<div class="info">
<p>
电影名:
{{ rating.movie.name }}
<span> <br>平均得分:
{% for foo in rating.movie.get_score_int_range %}
{% endfor %}
</span>
<strong style="color:#e09015">{{ rating.movie.get_score }}</strong>
</p>
<p>主演:{{ rating.movie.actors }}</p>
<p>
类型:
{% for genre in rating.movie.get_genre %}
<a href="{% url 'movie:tag' %}?genre={{ genre }}">{{ genre }}</a>
{% if not forloop.last %}
<span>|</span>
{% endif %}
{% endfor %}
</p>
<p>时长:{{ rating.movie.time }}</p>
<p>-------------------------------------------------------------------</p>
<p>
我的评分:
<strong style="color:#e09015">{{ rating.score }} </strong><br>
我的评论:
<strong>{{ rating.comment }}</strong>
</p>
<button type="button" class="btn btn-warning"
onclick="confirm_delete('{% url "movie:delete_record" rating.movie.id %}')"><span
class="glyphicon glyphicon-trash"></span> 删除评论
</button>
</div>
</div>
<div class="container">
<hr>
</div>
{% endfor %}
<script>
function confirm_delete(url) {
layer.open({
// 弹窗标题
title: "确认删除",
// 正文
content: "确认删除这条评论吗?",
yes: function (index, layero) {
location.href = url
},
})
}
</script>
<script>
window.onkeyup = function (ev) {
var key = ev.keyCode || ev.which;
if (key == 27) {
layer.closeAll();
}
}
</script>
{% endblock %}