diff --git a/app/common/tools/PostBlock.php b/app/common/tools/PostBlock.php new file mode 100644 index 0000000..283a2dc --- /dev/null +++ b/app/common/tools/PostBlock.php @@ -0,0 +1,16 @@ + $model_post + ]); + } +} diff --git a/app/common/tools/post_block/copyright.html b/app/common/tools/post_block/copyright.html new file mode 100644 index 0000000..d60fdd8 --- /dev/null +++ b/app/common/tools/post_block/copyright.html @@ -0,0 +1,14 @@ + \ No newline at end of file diff --git a/public/static/css/index.articles.css b/public/static/css/index.articles.css index cb0f0a4..fc1995c 100644 --- a/public/static/css/index.articles.css +++ b/public/static/css/index.articles.css @@ -122,11 +122,10 @@ } .post-item .info .title { - font-size : 20px; + font-size : 24px; line-height : 1.3; margin-bottom : 4px; - font-weight : 700; - max-height : 52px; + /* max-height : 52px; */ display : -webkit-box; -webkit-line-clamp: 2; overflow : hidden; @@ -220,7 +219,7 @@ } a.post-item:visited { - color: #bbb; + color: #333; } /* @@ -296,7 +295,8 @@ a.post-item:visited { } .copyright { - margin-top: 15px; + margin-top : 15px; + padding-top: 20px; } .index-poster { diff --git a/view/admin/post/edit_content.html b/view/admin/post/edit_content.html index 3fa4a11..5d2277d 100644 --- a/view/admin/post/edit_content.html +++ b/view/admin/post/edit_content.html @@ -51,6 +51,10 @@ box-shadow: 0 2px 10px rgb(0 0 0 / 12%); } + #editor-container li { + list-style: inherit; + } + #title-container { padding: 20px 0; border-bottom: 1px solid #e8e8e8; diff --git a/view/admin/post/output.html b/view/admin/post/output.html index c0a0868..caca165 100644 --- a/view/admin/post/output.html +++ b/view/admin/post/output.html @@ -37,6 +37,12 @@ display: block; margin-bottom: 15px; } + + .article-body.show-copyright-inner .copyright-inner { + background-color: #e8e8e8; + color: #333; + font-size: 12px; + } @@ -46,7 +52,11 @@
{$post.desc}
-
{$post->content_html|raw}
+
+ {$post->content_html|raw} + + {:\\app\\common\\tools\\PostBlock::copyright($post)} +
@@ -55,6 +65,8 @@ 选中标题 选中描述 选中内容 + 插入声明 + 显示声明
代码转临时图片
@@ -104,6 +116,30 @@ copyContent($(this).attr('href')) }) + $('.build-copyright').click(function () { + var copyElem = $('.copyright').find('p').last(); + + var html = copyElem.html(); + $('#post-content > p').not('.copyright-inner').each(function (index, elem) { + + if (index > 0 && index % 8 == 0) { + + if (!$(elem).next().hasClass('copyright-inner')) { + $('
' + html + '
').insertAfter(elem).addClass('copyright-inner') + } + } + }) + }) + + $('.show-copyright').click(function () { + if ($('.article-body').hasClass('show-copyright-inner')) { + $('.article-body').removeClass('show-copyright-inner') + } else { + + $('.article-body').addClass('show-copyright-inner') + } + }) + function copyContent(id) { var content = $(id)[0]; @@ -113,7 +149,7 @@ // Range 起始位置在段落2 range.selectNode(content); - console.log(range); + // 获取 selection 对象 const selection = window.getSelection(); selection.removeAllRanges() diff --git a/view/index/post/read.html b/view/index/post/read.html index 349bd6b..0f90c03 100644 --- a/view/index/post/read.html +++ b/view/index/post/read.html @@ -126,67 +126,65 @@
{$post->content_html|raw} + + {:\\app\\common\\tools\\PostBlock::copyright($post)}
- -
- -
- -
- 评论 -
-
- {volist name='$post.comments' id='comment'} -
-
- -
-
-
{$comment.user.nickname|default=$comment.user.account}
-
{$comment.content}
- {if !empty($user_info) && $user_info.uid == $comment.user_uid } -
-
删除
-
- - {/if} -
-
- {/volist} -
-
-
- -
- - -
-
- - {empty name='Request.session.user_uid'} - 点击登录 - {else /} - {$user_info.nickname|default=$user_info.account} - 退出 - {/empty} - - -
-
-
-
-
+ +
+ +
+ 评论 +
+
+ {volist name='$post.comments' id='comment'} +
+
+ +
+
+
{$comment.user.nickname|default=$comment.user.account}
+
{$comment.content}
+ {if !empty($user_info) && $user_info.uid == $comment.user_uid } +
+
删除
+
+ {/if} +
+
+ {/volist} +
+
+
+ +
+ +
+
+ + {empty name='Request.session.user_uid'} + 点击登录 + {else /} + {$user_info.nickname|default=$user_info.account} + 退出 + {/empty} + + +
+
+
+
+
+
+ + {include file='common/_right'/} -