SinkDark/myblog/templates/detail.html
2024-09-17 17:30:58 +08:00

80 lines
2.2 KiB
HTML

{% extends "base.html" %}
{% load static %}
{% block content %}
<main>
<div class="infosbox">
<div class="newsview">
<h3 class="news_title">{{ ats.title }}</h3>
<div class="bloginfo">
<ul>
<li class="author">作者:<a href="javascript:;">{{ user.name }}</a></li>
<li class="timer">时间:{{ ats.created|date:"Y-m-d" }}</li>
<li class="view">阅读量:{{ ats.reading }}</li>
</ul>
</div>
<div class="tags">
{% for t in atags %}
<a href="javascript:;">{{ t }}</a>
{% endfor %}
</div>
<div class="news_con">
{{ ats.content|safe }}
</div>
</div>
<div class="news_pl">
<h2>文章评论</h2>
<div class="gbko">
{% for c in cms %}
<div class="fb">
<ul style="background: url({% static "images/user.jpg" %}) no-repeat top 20px left 10px;">
<p class="fbtime">
<span>{{ c.created|date:"Y-m-d" }}</span>
{{ c.commentator }}</p>
<p class="fbinfo">{{ c.content }}</p>
</ul>
</div>
{% endfor %}
<form action="" method="post" name="saypl" onsubmit="return CheckPl(document.saypl)">
<div id="plpost">
{% csrf_token %}
<p class="saying">
<span><a href="javascript:;">共有{{ cms|length }}条评论</a></span>
来说两句吧...</p>
<p class="yname"><span>名称:</span>
<input name="name" id="name" type="text" class="inputText" size="16">
</p>
<textarea name="content" rows="6" id="saytext"></textarea>
<input name="submit" type="submit" value="提交">
</div>
</form>
</div>
</div>
</div>
</main>
{% endblock %}
<!--模版重写-->
{% block script %}
<script>
function CheckPl(obj)
{
if(obj.saytext.value=="")
{
alert("请写下您想说的话!");
obj.saytext.focus();
return false;
}
if(obj.name.value=="")
{
alert("请写下您的名字!");
obj.name.focus();
return false;
}
return true;
}
</script>
{% endblock %}