mirror of https://github.com/halo-dev/halo
🍎 发布文章可选文章是否可评论
parent
bfdc736a94
commit
f82c699641
|
@ -125,4 +125,9 @@ public class Post implements Serializable {
|
|||
* 文章访问量
|
||||
*/
|
||||
private Long postViews = 0L;
|
||||
|
||||
/**
|
||||
* 是否允许评论
|
||||
*/
|
||||
private Integer allowComment = 0;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
package cc.ryanc.halo.model.enums;
|
||||
|
||||
/**
|
||||
* @author : RYAN0UP
|
||||
* @date : 2018/7/9
|
||||
*/
|
||||
public enum AllowComment {
|
||||
/**
|
||||
* 允许评论
|
||||
*/
|
||||
ALLOW(1),
|
||||
|
||||
/**
|
||||
* 不允许评论
|
||||
*/
|
||||
DISALLOW(0);
|
||||
|
||||
private Integer code;
|
||||
|
||||
AllowComment(Integer code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
}
|
|
@ -76,8 +76,11 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<div>
|
||||
</div>
|
||||
<label for="allowComment" class="control-label">开启评论:</label>
|
||||
<select class="form-control" id="allowComment" name="allowComment">
|
||||
<option value="1" <#if post?? && post.allowComment?default(1)==1>selected</#if>>是</option>
|
||||
<option value="0" <#if post?? && post.allowComment?default(1)==0>selected</#if>>否</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<button onclick="push(1)" class="btn btn-default btn-sm ">保存草稿</button>
|
||||
|
@ -324,7 +327,8 @@
|
|||
'postContent': editor.getHTML(),
|
||||
'postThumbnail': $('#selectImg')[0].src,
|
||||
'cateList' : cateList.toString(),
|
||||
'tagList' : $('#tagList').tagEditor('getTags')[0].tags.toString()
|
||||
'tagList' : $('#tagList').tagEditor('getTags')[0].tags.toString(),
|
||||
'allowComment' : $('#allowComment').val()
|
||||
},
|
||||
success: function (data) {
|
||||
if(data.code==1){
|
||||
|
|
|
@ -1,17 +1,19 @@
|
|||
<#switch options.comment_system>
|
||||
<#case "native">
|
||||
<#include "../../../common/comment/_native_comment.ftl">
|
||||
<#break >
|
||||
<#case "valine">
|
||||
<#include "../../../common/comment/_valine_comment.ftl">
|
||||
<#break >
|
||||
<#case "disqus">
|
||||
<#include "../../../common/comment/_disqus_comment.ftl">
|
||||
<#break >
|
||||
<#case "livere">
|
||||
<#include "../../../common/comment/_livere_comment.ftl">
|
||||
<#break >
|
||||
<#case "changyan">
|
||||
<#include "../../../common/comment/_changyan_comment.ftl">
|
||||
<#break >
|
||||
</#switch>
|
||||
<#if post.allowComment?default(1)==1>
|
||||
<#switch options.comment_system>
|
||||
<#case "native">
|
||||
<#include "../../../common/comment/_native_comment.ftl">
|
||||
<#break >
|
||||
<#case "valine">
|
||||
<#include "../../../common/comment/_valine_comment.ftl">
|
||||
<#break >
|
||||
<#case "disqus">
|
||||
<#include "../../../common/comment/_disqus_comment.ftl">
|
||||
<#break >
|
||||
<#case "livere">
|
||||
<#include "../../../common/comment/_livere_comment.ftl">
|
||||
<#break >
|
||||
<#case "changyan">
|
||||
<#include "../../../common/comment/_changyan_comment.ftl">
|
||||
<#break >
|
||||
</#switch>
|
||||
</#if>
|
||||
|
|
|
@ -1,17 +1,19 @@
|
|||
<#switch options.comment_system>
|
||||
<#case "native">
|
||||
<#include "../../../common/comment/_native_comment.ftl">
|
||||
<#break >
|
||||
<#case "valine">
|
||||
<#include "../../../common/comment/_valine_comment.ftl">
|
||||
<#break >
|
||||
<#case "disqus">
|
||||
<#include "../../../common/comment/_disqus_comment.ftl">
|
||||
<#break >
|
||||
<#case "livere">
|
||||
<#include "../../../common/comment/_livere_comment.ftl">
|
||||
<#break >
|
||||
<#case "changyan">
|
||||
<#include "../../../common/comment/_changyan_comment.ftl">
|
||||
<#break >
|
||||
</#switch>
|
||||
<#if post.allowComment?default(1)==1>
|
||||
<#switch options.comment_system>
|
||||
<#case "native">
|
||||
<#include "../../../common/comment/_native_comment.ftl">
|
||||
<#break >
|
||||
<#case "valine">
|
||||
<#include "../../../common/comment/_valine_comment.ftl">
|
||||
<#break >
|
||||
<#case "disqus">
|
||||
<#include "../../../common/comment/_disqus_comment.ftl">
|
||||
<#break >
|
||||
<#case "livere">
|
||||
<#include "../../../common/comment/_livere_comment.ftl">
|
||||
<#break >
|
||||
<#case "changyan">
|
||||
<#include "../../../common/comment/_changyan_comment.ftl">
|
||||
<#break >
|
||||
</#switch>
|
||||
</#if>
|
||||
|
|
Loading…
Reference in New Issue