mirror of
https://github.com/mindoc-org/mindoc.git
synced 2025-07-19 10:31:01 +08:00
perf: 创建项目时增加选择编辑器功能
This commit is contained in:
parent
2b1be9a751
commit
58bac86d1f
@ -122,7 +122,7 @@ func (c *BookController) Setting() {
|
|||||||
if book.PrivateToken != "" {
|
if book.PrivateToken != "" {
|
||||||
book.PrivateToken = conf.URLFor("DocumentController.Index", ":key", book.Identify, "token", book.PrivateToken)
|
book.PrivateToken = conf.URLFor("DocumentController.Index", ":key", book.Identify, "token", book.PrivateToken)
|
||||||
}
|
}
|
||||||
fmt.Println("book.PrintState", book.PrintState)
|
|
||||||
c.Data["Model"] = book
|
c.Data["Model"] = book
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -463,6 +463,7 @@ func (c *BookController) Create() {
|
|||||||
description := strings.TrimSpace(c.GetString("description", ""))
|
description := strings.TrimSpace(c.GetString("description", ""))
|
||||||
privatelyOwned, _ := strconv.Atoi(c.GetString("privately_owned"))
|
privatelyOwned, _ := strconv.Atoi(c.GetString("privately_owned"))
|
||||||
commentStatus := c.GetString("comment_status")
|
commentStatus := c.GetString("comment_status")
|
||||||
|
editor := c.GetString("editor")
|
||||||
itemId, _ := c.GetInt("itemId")
|
itemId, _ := c.GetInt("itemId")
|
||||||
|
|
||||||
if bookName == "" {
|
if bookName == "" {
|
||||||
@ -529,6 +530,7 @@ func (c *BookController) Create() {
|
|||||||
book.CommentCount = 0
|
book.CommentCount = 0
|
||||||
book.PrivatelyOwned = privatelyOwned
|
book.PrivatelyOwned = privatelyOwned
|
||||||
book.CommentStatus = commentStatus
|
book.CommentStatus = commentStatus
|
||||||
|
|
||||||
book.Identify = identify
|
book.Identify = identify
|
||||||
book.DocCount = 0
|
book.DocCount = 0
|
||||||
book.MemberId = c.Member.MemberId
|
book.MemberId = c.Member.MemberId
|
||||||
@ -538,8 +540,7 @@ func (c *BookController) Create() {
|
|||||||
book.IsDownload = 1
|
book.IsDownload = 1
|
||||||
book.AutoRelease = 0
|
book.AutoRelease = 0
|
||||||
book.ItemId = itemId
|
book.ItemId = itemId
|
||||||
|
book.Editor = editor
|
||||||
book.Editor = "markdown"
|
|
||||||
book.Theme = "default"
|
book.Theme = "default"
|
||||||
|
|
||||||
if err := book.Insert(c.Lang); err != nil {
|
if err := book.Insert(c.Lang); err != nil {
|
||||||
|
@ -180,6 +180,25 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
</div>
|
</div>
|
||||||
|
<!--选择编辑器模式-->
|
||||||
|
<div class="form-group">
|
||||||
|
<label>{{i18n $.Lang "blog.text_editor"}}</label>
|
||||||
|
<div class="col-lg-20">
|
||||||
|
<label class="radio-inline">
|
||||||
|
<input type="radio" name="editor" value="markdown"> Markdown
|
||||||
|
</label>
|
||||||
|
<label class="radio-inline">
|
||||||
|
<input type="radio" name="editor" checked value="cherry_markdown"> Markdown (cherry)
|
||||||
|
</label>
|
||||||
|
<label class="radio-inline">
|
||||||
|
<input type="radio" name="editor" value="new_html"> Html (Quill)
|
||||||
|
</label>
|
||||||
|
<label class="radio-inline">
|
||||||
|
<input type="radio" name="editor" value="html"> Html (wangEditor)
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div class="clearfix"></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="pull-right text-center" style="width: 235px;">
|
<div class="pull-right text-center" style="width: 235px;">
|
||||||
<canvas id="bookCover" height="230px" width="170px"><img src="{{cdnimg "/static/images/book.jpg"}}"> </canvas>
|
<canvas id="bookCover" height="230px" width="170px"><img src="{{cdnimg "/static/images/book.jpg"}}"> </canvas>
|
||||||
|
Loading…
Reference in New Issue
Block a user