diff --git a/article/__pycache__/views.cpython-36.pyc b/article/__pycache__/views.cpython-36.pyc index 5a54e08..1ebde1b 100644 Binary files a/article/__pycache__/views.cpython-36.pyc and b/article/__pycache__/views.cpython-36.pyc differ diff --git a/article/templates/article/.detail.html.swp b/article/templates/article/.detail.html.swp new file mode 100644 index 0000000..187803b Binary files /dev/null and b/article/templates/article/.detail.html.swp differ diff --git a/article/templates/article/detail.html b/article/templates/article/detail.html index d016227..bef1be3 100644 --- a/article/templates/article/detail.html +++ b/article/templates/article/detail.html @@ -16,29 +16,31 @@

{% if art %}{{art.title}}{% endif %}

{% block content %} -
+
作者: {{art.author}}           发表于:{{art.publish_time}} - - {{art.detail|safe}} +

广告位

+ {{art.detail|safe|escape }}
+

评论

{% for i in comments %}
-
-

{{i.user.username}}

+
+ {{i.user}}
-

- {{i.comment|safe}} -  {{i.publish_time}} +  {{i.comment_time}} + # {{forloop.counter}} -   #{{forloop.counter}} + Reply +

+ {{i.comment|safe|escape}}
@@ -48,7 +50,7 @@

{% if art %}{{art.title}}{% endif %}

{% csrf_token %} - {{ comment_form.as_p }} + {{ comment_form.comment }}
diff --git a/article/views.py b/article/views.py index 5f5bef9..b53ec54 100644 --- a/article/views.py +++ b/article/views.py @@ -25,7 +25,9 @@ def detail(request, article_id): else: comment_form = CommentForm(instance=None) - return render(request,'article/detail.html',{'art':art,'comments':comments,'comment_form':comment_form}) + secs = Section.objects.all() + + return render(request,'article/detail.html',{'art':art,'comments':comments,'comment_form':comment_form,'secs':secs}) #return HttpResponse("You're looking at article %s." % article_id) diff --git a/db.sqlite3 b/db.sqlite3 index 0877efc..0074135 100644 Binary files a/db.sqlite3 and b/db.sqlite3 differ diff --git a/static/bootstrap/css/style.css b/static/bootstrap/css/style.css index bd0110e..caacc99 100755 --- a/static/bootstrap/css/style.css +++ b/static/bootstrap/css/style.css @@ -106,6 +106,10 @@ div.container-fluid { height:130px; } +.pull-right { + padding:0 10px 0 10px; +} + .fad { color:gray; } @@ -116,6 +120,61 @@ div.container-fluid { border-bottom:1px solid #e2e2e2; } +.article-content { + padding-bottom:30px; +} + +.card .comment { +} + +.card .comment div { + display: inline-block; + margin:10px; + float:left; +} + +.card .comment .comment-avatar { + margin:10px 0 0 20px; + width:80px; + height:100px; + text-align:center; +} + +.card .comment .comment-info { + width:80%; + float:right; + padding-right:20px; +} + +span.floor { + background-color:#f6f8fa; +} + +.ad1 { + height:100px; + background-color:gray; + text-align:center; + padding-top:15px; + color: white; + margin:10px 0 20px 0; +} + +.ad2 { + height:250px; + background-color:gray; + text-align:center; + padding-top:100px; + color: white; +} + + + + + + + + + diff --git a/static/image/reply.png b/static/image/reply.png new file mode 100644 index 0000000..7ba4ef6 Binary files /dev/null and b/static/image/reply.png differ diff --git a/templates/base.html b/templates/base.html index 1789a70..3ca6408 100644 --- a/templates/base.html +++ b/templates/base.html @@ -94,7 +94,7 @@

{% if title %}{{title}}{% endif %}

diff --git a/templates/index.html b/templates/index.html index 24dbf36..df169cf 100644 --- a/templates/index.html +++ b/templates/index.html @@ -19,7 +19,8 @@

{% if title %}{{title}}{% endif %}

{{i.title}}

-

{{i.detail|truncatewords:"30"|striptags}}

+

{{i.detail|striptags|truncatechars:140|safe}}

+

 {{i.publish_time}}      {{i.author}} @@ -34,15 +35,3 @@

{{i.title}}

{% endblock %} -{% block sidebar %} - -
-

分类

- - {% for i in secs %} -

{{i.name}}

- - {% endfor %} -
- -{% endblock %}