diff --git a/app/controllers/BlogController.go b/app/controllers/BlogController.go index 1ccf16f..fc5a662 100644 --- a/app/controllers/BlogController.go +++ b/app/controllers/BlogController.go @@ -481,7 +481,7 @@ func (c Blog) Cate(userIdOrEmail string, notebookId string) (re revel.Result) { return c.e404(userBlog.ThemePath) // 404 TODO 使用用户的404 } if !notebook.IsBlog { - return c.e404("") + panic("") } // 分页的话, 需要分页信息, totalPage, curPage diff --git a/app/service/NotebookService.go b/app/service/NotebookService.go index 686f82a..3ec77ea 100644 --- a/app/service/NotebookService.go +++ b/app/service/NotebookService.go @@ -185,6 +185,10 @@ func (this *NotebookService) UpdateNotebook(userId, notebookId string, needUpdat // ToBlog or Not func (this *NotebookService) ToBlog(userId, notebookId string, isBlog bool) (bool) { + // 笔记本 + db.UpdateByIdAndUserIdMap(db.Notebooks, notebookId, userId, bson.M{"IsBlog": isBlog}) + + // 更新笔记 q := bson.M{"UserId": bson.ObjectIdHex(userId), "NotebookId": bson.ObjectIdHex(notebookId)} data := bson.M{"IsBlog": isBlog} @@ -194,7 +198,7 @@ func (this *NotebookService) ToBlog(userId, notebookId string, isBlog bool) (boo data["HasSelfDefined"] = false } db.UpdateByQMap(db.Notes, q, data) - + // noteContents也更新, 这个就麻烦了, noteContents表没有NotebookId // 先查该notebook下所有notes, 得到id notes := []info.Note{} diff --git a/app/views/member/blog/update_theme.html b/app/views/member/blog/update_theme.html index 9495550..d49b089 100644 --- a/app/views/member/blog/update_theme.html +++ b/app/views/member/blog/update_theme.html @@ -39,7 +39,7 @@ }
-
+
模板, 样式, 脚本: @@ -62,7 +62,7 @@
-
+
当前文件: header.html @@ -118,7 +118,7 @@ var theme = { saveBtnO: $("#saveBtn"), newFileO: $("#newFile"), curTpl: "", - tplInfos: {"header.html": "头部", "footer.html": "底部", "index.html": "首页", "cate.html": "分类页", "search.html": "搜索页", "single.html": "单页", "archive.html": "归档页", "view.html": "详情页", "tags.html": "标签页", "tag_posts.html": "标签博客", "comment.html": "分享评论", "404.html":"404", "theme.json": "主题配置"}, + tplInfos: {"header.html": "头部", "footer.html": "底部", "index.html": "首页", "cate.html": "分类页", "search.html": "搜索页", "single.html": "单页", "archive.html": "归档页", "post.html": "文章页", "tags.html": "标签页", "tag_posts.html": "标签文章页", "share_comment.html": "分享评论", "404.html":"404", "theme.json": "主题配置", "paging.html": "分页", "highlight.html": "高亮"}, init: function() { var self = this; self.showTplInfo(); @@ -150,15 +150,15 @@ var theme = { var file = $a.data('file'); art.confirm("Are you sure to delete " + file + " ?", function() { ajaxPost("/member/blog/deleteTpl", {themeId: themeId, filename: file}, function(re) { - if(reIsOk(re)) { + // if(reIsOk(re)) { art.tips("Success"); $a.remove(); if(self.curTpl == file) { $(".file-list a").eq(0).trigger("click"); } - } else { - art.alert(re.Msg); - } + //} else { + // art.alert(re.Msg); + //} }) }); }); diff --git a/mongodb_backup/leanote_install_data/configs.bson b/mongodb_backup/leanote_install_data/configs.bson index 888b245..5c068d2 100644 Binary files a/mongodb_backup/leanote_install_data/configs.bson and b/mongodb_backup/leanote_install_data/configs.bson differ diff --git a/mongodb_backup/leanote_install_data/note_contents.bson b/mongodb_backup/leanote_install_data/note_contents.bson index a9c8af2..70f7291 100644 Binary files a/mongodb_backup/leanote_install_data/note_contents.bson and b/mongodb_backup/leanote_install_data/note_contents.bson differ diff --git a/mongodb_backup/leanote_install_data/notebooks.bson b/mongodb_backup/leanote_install_data/notebooks.bson index cbd09ca..5ec5e34 100644 Binary files a/mongodb_backup/leanote_install_data/notebooks.bson and b/mongodb_backup/leanote_install_data/notebooks.bson differ diff --git a/mongodb_backup/leanote_install_data/notes.bson b/mongodb_backup/leanote_install_data/notes.bson index d94cac5..3857cd8 100644 Binary files a/mongodb_backup/leanote_install_data/notes.bson and b/mongodb_backup/leanote_install_data/notes.bson differ diff --git a/mongodb_backup/leanote_install_data/system.indexes.bson b/mongodb_backup/leanote_install_data/system.indexes.bson index 73c41e6..f8f7cfb 100644 Binary files a/mongodb_backup/leanote_install_data/system.indexes.bson and b/mongodb_backup/leanote_install_data/system.indexes.bson differ diff --git a/mongodb_backup/leanote_install_data/tag_count.bson b/mongodb_backup/leanote_install_data/tag_count.bson new file mode 100644 index 0000000..2e8b7e1 Binary files /dev/null and b/mongodb_backup/leanote_install_data/tag_count.bson differ diff --git a/mongodb_backup/leanote_install_data/tag_count.metadata.json b/mongodb_backup/leanote_install_data/tag_count.metadata.json new file mode 100644 index 0000000..ed646da --- /dev/null +++ b/mongodb_backup/leanote_install_data/tag_count.metadata.json @@ -0,0 +1 @@ +{ "indexes" : [ { "v" : 1, "key" : { "_id" : 1 }, "ns" : "leanote_beta2.tag_count", "name" : "_id_" } ] } \ No newline at end of file diff --git a/mongodb_backup/leanote_install_data/themes.bson b/mongodb_backup/leanote_install_data/themes.bson index 02d91c1..8d1ae63 100644 Binary files a/mongodb_backup/leanote_install_data/themes.bson and b/mongodb_backup/leanote_install_data/themes.bson differ diff --git a/mongodb_backup/leanote_install_data/user_blogs.bson b/mongodb_backup/leanote_install_data/user_blogs.bson index 907f1d3..31692a6 100644 Binary files a/mongodb_backup/leanote_install_data/user_blogs.bson and b/mongodb_backup/leanote_install_data/user_blogs.bson differ diff --git a/public/blog/themes/default/footer.html b/public/blog/themes/default/footer.html index 95f7b15..c89bc2e 100644 --- a/public/blog/themes/default/footer.html +++ b/public/blog/themes/default/footer.html @@ -7,9 +7,23 @@
  • 主页
  • {{range $.cates}}
  • - {{.Title}} + {{.Title}}
  • {{end}} + + {{range $.singles}} +
  • + {{.Title}} +
  • + {{end}} + + +
  • + 归档 +
  • +
  • + 标签 +
  • diff --git a/public/blog/themes/elegant/footer.html b/public/blog/themes/elegant/footer.html index 95f7b15..c89bc2e 100644 --- a/public/blog/themes/elegant/footer.html +++ b/public/blog/themes/elegant/footer.html @@ -7,9 +7,23 @@
  • 主页
  • {{range $.cates}}
  • - {{.Title}} + {{.Title}}
  • {{end}} + + {{range $.singles}} +
  • + {{.Title}} +
  • + {{end}} + + +
  • + 归档 +
  • +
  • + 标签 +
  • diff --git a/public/blog/themes/elegant/theme.json b/public/blog/themes/elegant/theme.json index 0b2bbe4..476f022 100644 --- a/public/blog/themes/elegant/theme.json +++ b/public/blog/themes/elegant/theme.json @@ -17,7 +17,7 @@ */ { - "Name": "leanote-elegant", + "Name": "leanote elegant", "Version": "1.0", "Author": "leanote.com", "AuthorUrl": "http://leanote.com", diff --git a/public/blog/themes/nav_fixed/footer.html b/public/blog/themes/nav_fixed/footer.html index 95f7b15..c89bc2e 100644 --- a/public/blog/themes/nav_fixed/footer.html +++ b/public/blog/themes/nav_fixed/footer.html @@ -7,9 +7,23 @@
  • 主页
  • {{range $.cates}}
  • - {{.Title}} + {{.Title}}
  • {{end}} + + {{range $.singles}} +
  • + {{.Title}} +
  • + {{end}} + + +
  • + 归档 +
  • +
  • + 标签 +
  • diff --git a/public/blog/themes/nav_fixed/theme.json b/public/blog/themes/nav_fixed/theme.json index 5fcf492..17b8c30 100644 --- a/public/blog/themes/nav_fixed/theme.json +++ b/public/blog/themes/nav_fixed/theme.json @@ -17,7 +17,7 @@ */ { - "Name": "leanote default theme", + "Name": "leanote nav fixed", "Version": "1.0", "Author": "leanote.com", "AuthorUrl": "http://leanote.com", diff --git a/public/blog/themes/nav_fixed/view.html b/public/blog/themes/nav_fixed/view.html deleted file mode 100644 index 491ddb3..0000000 --- a/public/blog/themes/nav_fixed/view.html +++ /dev/null @@ -1,142 +0,0 @@ -{{template "header.html" .}} - -
    -
    -
    -
    - {{.post.Title}} -
    -
    - - {{if .post.Tags}} - {{blogTags $ .post.Tags}} - {{else}} - {{msg . "noTag"}} - {{end}} - | - {{msg . "updatedTime"}} {{$.post.UpdatedTime | datetime}} - | - {{msg . "createdTime"}} {{$.post.CreatedTime | datetime}} -
    - - -
    - {{ if $.blogInfo.UserLogo}} - - {{else}} - - {{end}} - {{$.blogInfo.Username}} - - {{if .post.Tags}} -   - - {{blogTags $ $.post.Tags}} - {{end}} -
    - -
    - {{if $.post.IsMarkdown }} - -
    - -
    - {{else}} - {{$.post.Content | raw}} - {{end}} -
    - -
    -

    - 上一篇: {{if $.prePost}}{{$.prePost.Title}}{{else}}无{{end}} -

    -

    - 下一篇: {{if $.nextPost}}{{$.nextPost.Title}}{{else}}无{{end}} -

    -
    - - - {{template "comment.html" $}} -
    -
    -
    - -{{template "footer.html" .}} -{{template "highlight.html"}} - -
    -
    - - 文档导航 -
    -
    -
    -
    - - - - - - - - - - - - - - - - -{{if $.post.IsMarkdown }} - - - - - - - - - - - - - -{{else}} - -{{end}} - - - \ No newline at end of file