打包发布最新功能
This commit is contained in:
@ -125,7 +125,7 @@ func (c Note) Index(noteId string) revel.Result {
|
|||||||
c.RenderArgs["globalConfigs"] = configService.GetGlobalConfigForUser()
|
c.RenderArgs["globalConfigs"] = configService.GetGlobalConfigForUser()
|
||||||
|
|
||||||
|
|
||||||
return c.RenderTemplate("note/note.html")
|
// return c.RenderTemplate("note/note.html")
|
||||||
|
|
||||||
if isDev, _ := revel.Config.Bool("mode.dev"); isDev {
|
if isDev, _ := revel.Config.Bool("mode.dev"); isDev {
|
||||||
return c.RenderTemplate("note/note-dev.html")
|
return c.RenderTemplate("note/note-dev.html")
|
||||||
|
@ -44,7 +44,7 @@ func (c AdminUser) Register(email, pwd string) revel.Result {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 注册
|
// 注册
|
||||||
re.Ok, re.Msg = authService.Register(email, pwd)
|
re.Ok, re.Msg = authService.Register(email, pwd, "")
|
||||||
|
|
||||||
return c.RenderRe(re)
|
return c.RenderRe(re)
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,7 @@ type User struct {
|
|||||||
ImageSize int `bson:"ImageSize" json:"-"` // 图片大小
|
ImageSize int `bson:"ImageSize" json:"-"` // 图片大小
|
||||||
AttachNum int `bson:"AttachNum" json:"-"` // 附件数量
|
AttachNum int `bson:"AttachNum" json:"-"` // 附件数量
|
||||||
AttachSize int `bson:"AttachSize" json:"-"` // 附件大小
|
AttachSize int `bson:"AttachSize" json:"-"` // 附件大小
|
||||||
PerAttachSize int `bson:"PerAttachSize" json:"-"` // 单个附件大小
|
FromUserId bson.ObjectId `FromUserId,omitempty` // 邀请的用户
|
||||||
|
|
||||||
AccountType string `bson:"AccountType" json:"-"` // normal(为空), premium
|
AccountType string `bson:"AccountType" json:"-"` // normal(为空), premium
|
||||||
AccountStartTime time.Time `bson:"AccountStartTime" json:"-"` // 开始日期
|
AccountStartTime time.Time `bson:"AccountStartTime" json:"-"` // 开始日期
|
||||||
|
58
app/init.go
58
app/init.go
@ -111,6 +111,7 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// tags
|
// tags
|
||||||
|
// 2014/12/30 标签添加链接
|
||||||
revel.TemplateFuncs["blogTags"] = func(renderArgs map[string]interface{}, tags []string) template.HTML {
|
revel.TemplateFuncs["blogTags"] = func(renderArgs map[string]interface{}, tags []string) template.HTML {
|
||||||
if tags == nil || len(tags) == 0 {
|
if tags == nil || len(tags) == 0 {
|
||||||
return ""
|
return ""
|
||||||
@ -118,18 +119,68 @@ func init() {
|
|||||||
locale, _ := renderArgs[revel.CurrentLocaleRenderArg].(string)
|
locale, _ := renderArgs[revel.CurrentLocaleRenderArg].(string)
|
||||||
tagStr := ""
|
tagStr := ""
|
||||||
lenTags := len(tags)
|
lenTags := len(tags)
|
||||||
|
|
||||||
|
tagPostUrl, _ := renderArgs["tagPostsUrl"].(string)
|
||||||
|
|
||||||
for i, tag := range tags {
|
for i, tag := range tags {
|
||||||
str := revel.Message(locale, tag)
|
str := revel.Message(locale, tag)
|
||||||
|
var classes = "label"
|
||||||
if strings.HasPrefix(str, "???") {
|
if strings.HasPrefix(str, "???") {
|
||||||
str = tag
|
str = tag
|
||||||
}
|
}
|
||||||
tagStr += str
|
if InArray([]string{"red", "blue", "yellow", "green"}, tag) {
|
||||||
|
classes += " label-" + tag
|
||||||
|
} else {
|
||||||
|
classes += " label-default"
|
||||||
|
}
|
||||||
|
|
||||||
|
classes += " label-post"
|
||||||
|
var url = tagPostUrl + "/" + url.QueryEscape(tag)
|
||||||
|
tagStr += "<a class=\"" + classes + "\" href=\"" + url + "\">" + str + "</a>";
|
||||||
if i != lenTags - 1 {
|
if i != lenTags - 1 {
|
||||||
tagStr += ","
|
tagStr += " "
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return template.HTML(tagStr)
|
return template.HTML(tagStr)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// lea++
|
||||||
|
revel.TemplateFuncs["blogTagsLea"] = func(renderArgs map[string]interface{}, tags []string, isRecommend bool) template.HTML {
|
||||||
|
if tags == nil || len(tags) == 0 {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
locale, _ := renderArgs[revel.CurrentLocaleRenderArg].(string)
|
||||||
|
tagStr := ""
|
||||||
|
lenTags := len(tags)
|
||||||
|
|
||||||
|
tagPostUrl := "http://lea.leanote.com/"
|
||||||
|
if isRecommend {
|
||||||
|
tagPostUrl += "?tag=";
|
||||||
|
} else {
|
||||||
|
tagPostUrl += "latest?tag=";
|
||||||
|
}
|
||||||
|
|
||||||
|
for i, tag := range tags {
|
||||||
|
str := revel.Message(locale, tag)
|
||||||
|
var classes = "label"
|
||||||
|
if strings.HasPrefix(str, "???") {
|
||||||
|
str = tag
|
||||||
|
}
|
||||||
|
if InArray([]string{"red", "blue", "yellow", "green"}, tag) {
|
||||||
|
classes += " label-" + tag
|
||||||
|
} else {
|
||||||
|
classes += " label-default"
|
||||||
|
}
|
||||||
|
classes += " label-post"
|
||||||
|
var url = tagPostUrl + url.QueryEscape(tag)
|
||||||
|
tagStr += "<a class=\"" + classes + "\" href=\"" + url + "\">" + str + "</a>";
|
||||||
|
if i != lenTags - 1 {
|
||||||
|
tagStr += " "
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return template.HTML(tagStr)
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
revel.TemplateFuncs["blogTags"] = func(tags []string) template.HTML {
|
revel.TemplateFuncs["blogTags"] = func(tags []string) template.HTML {
|
||||||
if tags == nil || len(tags) == 0 {
|
if tags == nil || len(tags) == 0 {
|
||||||
@ -311,7 +362,7 @@ func init() {
|
|||||||
// init Email
|
// init Email
|
||||||
revel.OnAppStart(func() {
|
revel.OnAppStart(func() {
|
||||||
// 数据库
|
// 数据库
|
||||||
db.Init()
|
db.Init("", "")
|
||||||
// email配置
|
// email配置
|
||||||
InitEmail()
|
InitEmail()
|
||||||
InitVd()
|
InitVd()
|
||||||
@ -323,4 +374,5 @@ func init() {
|
|||||||
member.InitService()
|
member.InitService()
|
||||||
service.ConfigS.InitGlobalConfigs()
|
service.ConfigS.InitGlobalConfigs()
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -32,10 +32,10 @@ import (
|
|||||||
//var jss = []string{"js/jquery-cookie", "js/bootstrap"}
|
//var jss = []string{"js/jquery-cookie", "js/bootstrap"}
|
||||||
var jss = []string{"js/jquery-cookie", "js/bootstrap",
|
var jss = []string{"js/jquery-cookie", "js/bootstrap",
|
||||||
"js/common", "js/app/note", "js/app/tag", "js/app/notebook", "js/app/share",
|
"js/common", "js/app/note", "js/app/tag", "js/app/notebook", "js/app/share",
|
||||||
"js/object_id", "js/ZeroClipboard/ZeroClipboard"}
|
"js/object_id"}
|
||||||
|
|
||||||
var base1 = "/Users/life/Documents/Go/package1/src/github.com/leanote/leanote/"
|
var base1 = "/Users/life/Documents/Go/package2/src/github.com/leanote/leanote/"
|
||||||
var base = "/Users/life/Documents/Go/package1/src/github.com/leanote/leanote/public/"
|
var base = "/Users/life/Documents/Go/package2/src/github.com/leanote/leanote/public/"
|
||||||
var cmdPath = "/usr/local/bin/uglifyjs"
|
var cmdPath = "/usr/local/bin/uglifyjs"
|
||||||
|
|
||||||
func cmdError(err error) {
|
func cmdError(err error) {
|
||||||
|
@ -15,16 +15,16 @@ type AttachService struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// add attach
|
// add attach
|
||||||
func (this *AttachService) AddAttach(attach info.Attach) bool {
|
func (this *AttachService) AddAttach(attach info.Attach) (ok bool, msg string) {
|
||||||
attach.CreatedTime = time.Now()
|
attach.CreatedTime = time.Now()
|
||||||
ok := db.Insert(db.Attachs, attach)
|
ok = db.Insert(db.Attachs, attach)
|
||||||
|
|
||||||
if ok {
|
if ok {
|
||||||
// 更新笔记的attachs num
|
// 更新笔记的attachs num
|
||||||
this.updateNoteAttachNum(attach.NoteId, 1)
|
this.updateNoteAttachNum(attach.NoteId, 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
return ok
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// 更新笔记的附件个数
|
// 更新笔记的附件个数
|
||||||
|
@ -17,7 +17,7 @@ type FileService struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// add Image
|
// add Image
|
||||||
func (this *FileService) AddImage(image info.File, albumId, userId string) bool {
|
func (this *FileService) AddImage(image info.File, albumId, userId string, needCheckSize bool) (ok bool, msg string) {
|
||||||
image.CreatedTime = time.Now()
|
image.CreatedTime = time.Now()
|
||||||
if albumId != "" {
|
if albumId != "" {
|
||||||
image.AlbumId = bson.ObjectIdHex(albumId)
|
image.AlbumId = bson.ObjectIdHex(albumId)
|
||||||
@ -27,7 +27,8 @@ func (this *FileService) AddImage(image info.File, albumId, userId string) bool
|
|||||||
}
|
}
|
||||||
image.UserId = bson.ObjectIdHex(userId)
|
image.UserId = bson.ObjectIdHex(userId)
|
||||||
|
|
||||||
return db.Insert(db.Files, image)
|
ok = db.Insert(db.Files, image)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// list images
|
// list images
|
||||||
@ -232,7 +233,7 @@ func (this *FileService) CopyImage(userId, fileId, toUserId string) (bool, strin
|
|||||||
id := bson.NewObjectId();
|
id := bson.NewObjectId();
|
||||||
fileInfo.FileId = id
|
fileInfo.FileId = id
|
||||||
fileId = id.Hex()
|
fileId = id.Hex()
|
||||||
Ok := this.AddImage(fileInfo, "", toUserId)
|
Ok, _ := this.AddImage(fileInfo, "", toUserId, false)
|
||||||
|
|
||||||
if Ok {
|
if Ok {
|
||||||
return Ok, id.Hex()
|
return Ok, id.Hex()
|
||||||
|
@ -13,12 +13,11 @@
|
|||||||
<link href="/css/bootstrap.css" rel="stylesheet" />
|
<link href="/css/bootstrap.css" rel="stylesheet" />
|
||||||
<!-- 先加载, 没有样式, 宽度不定 -->
|
<!-- 先加载, 没有样式, 宽度不定 -->
|
||||||
<link rel="stylesheet" href="/tinymce/skins/custom/skin.min.css" rel="stylesheet"/>
|
<link rel="stylesheet" href="/tinymce/skins/custom/skin.min.css" rel="stylesheet"/>
|
||||||
|
|
||||||
<!-- leanote css -->
|
<!-- leanote css -->
|
||||||
<link href="/css/font-awesome-4.2.0/css/font-awesome.css" rel="stylesheet" />
|
<link href="/css/font-awesome-4.2.0/css/font-awesome.css" rel="stylesheet" />
|
||||||
<link href="/css/zTreeStyle/zTreeStyle.css" rel="stylesheet" />
|
<link href="/css/zTreeStyle/zTreeStyle.css" rel="stylesheet" />
|
||||||
|
<!-- mdeditor -->
|
||||||
<link href="/public/res-min/themes/default.css" rel="stylesheet" />
|
<link href="/public/dist/themes/default.css" rel="stylesheet" />
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
var hash = location.hash;
|
var hash = location.hash;
|
||||||
@ -899,7 +898,7 @@ var GlobalConfigs = {{.globalConfigs|jsonJs}}; // 2014/11/9 beta2
|
|||||||
|
|
||||||
<!-- 渲染view -->
|
<!-- 渲染view -->
|
||||||
<script src="/tinymce/tinymce.min.js"></script>
|
<script src="/tinymce/tinymce.min.js"></script>
|
||||||
<script src="/js/ace/ace.js"></script>
|
<script src="/public/libs/ace/ace.js"></script>
|
||||||
<script src="/js/app/page-min.js"></script>
|
<script src="/js/app/page-min.js"></script>
|
||||||
<script src="/js/jQuery-slimScroll-1.3.0/jquery.slimscroll-min.js"></script>
|
<script src="/js/jQuery-slimScroll-1.3.0/jquery.slimscroll-min.js"></script>
|
||||||
<script src="/js/contextmenu/jquery.contextmenu-min.js"></script>
|
<script src="/js/contextmenu/jquery.contextmenu-min.js"></script>
|
||||||
@ -915,8 +914,10 @@ initPage();
|
|||||||
|
|
||||||
<!-- context-menu -->
|
<!-- context-menu -->
|
||||||
<link rel="stylesheet" href="/js/contextmenu/css/contextmenu.css" type="text/css" />
|
<link rel="stylesheet" href="/js/contextmenu/css/contextmenu.css" type="text/css" />
|
||||||
|
|
||||||
|
<!-- v2 use require.js, mdeditor -->
|
||||||
<script>
|
<script>
|
||||||
window.baseDir = '/public/res-min';
|
window.baseDir = '/public/dist';
|
||||||
window.require = {
|
window.require = {
|
||||||
baseUrl: window.baseDir,
|
baseUrl: window.baseDir,
|
||||||
deps: ['main']
|
deps: ['main']
|
||||||
|
File diff suppressed because one or more lines are too long
@ -117,4 +117,4 @@
|
|||||||
writeScripts();
|
writeScripts();
|
||||||
})(this);
|
})(this);
|
||||||
|
|
||||||
// $hash: eead586884e827fb28480c335ab9d3fc
|
// $hash: 190286403c2f41db4f7f5e13ca9a2158
|
@ -114,4 +114,4 @@
|
|||||||
writeScripts();
|
writeScripts();
|
||||||
})(this);
|
})(this);
|
||||||
|
|
||||||
// $hash: 69eeaf44413967796526c27a57f9e5c3
|
// $hash: 0dea0ce031907f908bd45feb13483a36
|
File diff suppressed because one or more lines are too long
@ -116,4 +116,4 @@
|
|||||||
writeScripts();
|
writeScripts();
|
||||||
})(this);
|
})(this);
|
||||||
|
|
||||||
// $hash: cc4206b9f467adfd42760ee5a6c3606f
|
// $hash: 03d011b56beb69dc9e64484e888e2704
|
@ -1831,7 +1831,7 @@ define("tinymce/tableplugin/Plugin", [
|
|||||||
function insertTable(cols, rows) {
|
function insertTable(cols, rows) {
|
||||||
var y, x, html;
|
var y, x, html;
|
||||||
|
|
||||||
html = '<table style="width: 100%"><tbody>';
|
html = '<table><tbody>';
|
||||||
|
|
||||||
for (y = 0; y < rows; y++) {
|
for (y = 0; y < rows; y++) {
|
||||||
html += '<tr>';
|
html += '<tr>';
|
||||||
|
2
public/tinymce/plugins/table/plugin.min.js
vendored
2
public/tinymce/plugins/table/plugin.min.js
vendored
File diff suppressed because one or more lines are too long
@ -210,4 +210,4 @@
|
|||||||
writeScripts();
|
writeScripts();
|
||||||
})(this);
|
})(this);
|
||||||
|
|
||||||
// $hash: 11a55fa37d4eb591eeccc37e9f5b9d00
|
// $hash: 130cd5accbf13f2c03f8ce625aec1f19
|
@ -209,4 +209,4 @@
|
|||||||
writeScripts();
|
writeScripts();
|
||||||
})(this);
|
})(this);
|
||||||
|
|
||||||
// $hash: c7c1f3d9261e2b8bbf291b977dfec921
|
// $hash: 7ac9215dd1d6bfa06c35a80c1eebfc6b
|
Reference in New Issue
Block a user