From ae0600ba5109f30266bc9ebad66b17ddce1e93a0 Mon Sep 17 00:00:00 2001 From: crossdark Date: Fri, 20 Sep 2024 20:27:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86article=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=BA=93,=E6=88=90=E5=8A=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SinkDark/article/models.py | 2 +- SinkDark/publicStatic/css/base.css | 4 ++-- SinkDark/templates/article.html | 4 ++-- SinkDark/templates/detail.html | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/SinkDark/article/models.py b/SinkDark/article/models.py index 51b826d..74dae34 100644 --- a/SinkDark/article/models.py +++ b/SinkDark/article/models.py @@ -21,7 +21,7 @@ class ArticleInfo(models.Model): author = models.ForeignKey(MyUser, on_delete=models.CASCADE, verbose_name='用户') title = models.CharField('标题', max_length=200) content = RichTextUploadingField(verbose_name='内容') - rendered = RichTextUploadingField(verbose_name='最终内容') + rendered = RichTextUploadingField(verbose_name='最终内容', default='

默认内容

') articlephoto = models.ImageField('文章图片', blank=True, upload_to='images/article/') reading = models.IntegerField('阅读量', default=0) liking = models.IntegerField('点赞量', default=0) diff --git a/SinkDark/publicStatic/css/base.css b/SinkDark/publicStatic/css/base.css index b38ca05..5181f09 100644 --- a/SinkDark/publicStatic/css/base.css +++ b/SinkDark/publicStatic/css/base.css @@ -47,12 +47,12 @@ article { position: relative; z-index: 1 } -.r_box { +.m_box { /* 主体CSS样式规则 */ float: center; /* 让这个aside元素向右浮动 */ width: 60%; /* 设置宽度为父容器的20% */ background-color: #f0f0f0; /* 设置背景颜色为浅灰色 */ - margin-left: 100px; /* 设置右边距为20px */ + margin-left: 1000px; /* 设置右边距为20px */ overflow: hidden; display: block; position: relative; diff --git a/SinkDark/templates/article.html b/SinkDark/templates/article.html index 58e2e87..28c430e 100644 --- a/SinkDark/templates/article.html +++ b/SinkDark/templates/article.html @@ -2,7 +2,7 @@ {% load static %} {% block content %} -
+
{% for list in pageInfo.object_list %}
  • @@ -15,7 +15,7 @@

    {{ list.title }}

    -

    {{ list.content|safe }}

    +

    {{ list.rendered|safe }}

  • {% endfor %} diff --git a/SinkDark/templates/detail.html b/SinkDark/templates/detail.html index 3b67385..fa1468c 100644 --- a/SinkDark/templates/detail.html +++ b/SinkDark/templates/detail.html @@ -20,7 +20,7 @@
    - {{ ats.content|safe }} + {{ ats.rendered|safe }}