mirror of
https://github.com/mindoc-org/mindoc.git
synced 2025-10-20 19:07:25 +08:00
实现分享开关
This commit is contained in:
@@ -51,6 +51,8 @@ type Book struct {
|
||||
CreateTime time.Time `orm:"type(datetime);column(create_time);auto_now_add" json:"create_time"`
|
||||
//每个文档保存的历史记录数量,0 为不限制
|
||||
HistoryCount int `orm:"column(history_count);type(int);default(0)" json:"history_count"`
|
||||
//是否启用分享,0启用/1不启用
|
||||
IsEnableShare int `orm:"column(is_enable_share);type(int);default(0)" json:"is_enable_share"`
|
||||
MemberId int `orm:"column(member_id);size(100)" json:"member_id"`
|
||||
ModifyTime time.Time `orm:"type(datetime);column(modify_time);null;auto_now" json:"modify_time"`
|
||||
Version int64 `orm:"type(bigint);column(version)" json:"version"`
|
||||
|
@@ -48,7 +48,8 @@ type BookResult struct {
|
||||
RelationshipId int `json:"relationship_id"`
|
||||
RoleId int `json:"role_id"`
|
||||
RoleName string `json:"role_name"`
|
||||
Status int
|
||||
Status int `json:"status"`
|
||||
IsEnableShare bool `json:"is_enable_share"`
|
||||
|
||||
LastModifyText string `json:"last_modify_text"`
|
||||
IsDisplayComment bool `json:"is_display_comment"`
|
||||
@@ -174,6 +175,7 @@ func (m *BookResult) ToBookResult(book Book) *BookResult {
|
||||
m.Editor = book.Editor
|
||||
m.Theme = book.Theme
|
||||
m.AutoRelease = book.AutoRelease == 1
|
||||
m.IsEnableShare = book.IsEnableShare == 0
|
||||
m.Publisher = book.Publisher
|
||||
m.HistoryCount = book.HistoryCount
|
||||
m.IsDownload = book.IsDownload == 0
|
||||
|
@@ -2,11 +2,12 @@ package models
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"github.com/astaxie/beego/orm"
|
||||
"html/template"
|
||||
"math"
|
||||
"strconv"
|
||||
"github.com/lifei6671/mindoc/utils"
|
||||
|
||||
"github.com/astaxie/beego/orm"
|
||||
"github.com/lifei6671/mindoc/conf"
|
||||
)
|
||||
|
||||
type DocumentTree struct {
|
||||
@@ -116,10 +117,10 @@ func getDocumentTree(array []*DocumentTree, parent_id int, selected_id int, sele
|
||||
buf.WriteString(selected_li)
|
||||
buf.WriteString("><a href=\"")
|
||||
if item.Identify != "" {
|
||||
uri := utils.URLFor("DocumentController.Read", ":key", item.BookIdentify, ":id", item.Identify)
|
||||
uri := conf.URLFor("DocumentController.Read", ":key", item.BookIdentify, ":id", item.Identify)
|
||||
buf.WriteString(uri)
|
||||
} else {
|
||||
uri := utils.URLFor("DocumentController.Read", ":key", item.BookIdentify, ":id", item.DocumentId)
|
||||
uri := conf.URLFor("DocumentController.Read", ":key", item.BookIdentify, ":id", item.DocumentId)
|
||||
buf.WriteString(uri)
|
||||
}
|
||||
buf.WriteString("\" title=\"")
|
||||
|
Reference in New Issue
Block a user