From 51fedfa6dc2b53d49740ce223e719765e93ce0e9 Mon Sep 17 00:00:00 2001 From: life Date: Wed, 12 Nov 2014 19:36:31 +0800 Subject: [PATCH] default themes and fix notebook to blog bug --- app/controllers/BlogController.go | 2 +- app/service/NotebookService.go | 6 +- app/views/member/blog/update_theme.html | 14 +- .../leanote_install_data/configs.bson | Bin 23959 -> 23959 bytes .../leanote_install_data/note_contents.bson | Bin 6734 -> 6743 bytes .../leanote_install_data/notebooks.bson | Bin 1415 -> 1424 bytes .../leanote_install_data/notes.bson | Bin 2345 -> 2403 bytes .../leanote_install_data/system.indexes.bson | Bin 2949 -> 3027 bytes .../leanote_install_data/tag_count.bson | Bin 0 -> 157 bytes .../tag_count.metadata.json | 1 + .../leanote_install_data/themes.bson | Bin 1659 -> 1922 bytes .../leanote_install_data/user_blogs.bson | Bin 943 -> 964 bytes public/blog/themes/default/footer.html | 16 +- public/blog/themes/elegant/footer.html | 16 +- public/blog/themes/elegant/theme.json | 2 +- public/blog/themes/nav_fixed/footer.html | 16 +- public/blog/themes/nav_fixed/theme.json | 2 +- public/blog/themes/nav_fixed/view.html | 142 ------------------ 18 files changed, 61 insertions(+), 156 deletions(-) create mode 100644 mongodb_backup/leanote_install_data/tag_count.bson create mode 100644 mongodb_backup/leanote_install_data/tag_count.metadata.json delete mode 100644 public/blog/themes/nav_fixed/view.html 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 888b2458a4c7f33c9a33d9f4761db42b8538148a..5c068d2349ad9c97b08523fafc76f6274329c0c3 100644 GIT binary patch delta 42 ncmbQfn{oPX#tk|l%v$ctCKm=vPEPRPog5m1!ry!;@9PA&|VoSfjnJ2^B2g}?by$WaaeTP_eK diff --git a/mongodb_backup/leanote_install_data/note_contents.bson b/mongodb_backup/leanote_install_data/note_contents.bson index a9c8af24a2bc159921c142f14390a491d2b6263e..70f729121addbf62f736fc21003d3ced050ca926 100644 GIT binary patch delta 25 hcmX?Sa@}OZ8cD|0lh;amvvYVBJLTl3PyQwu0RV||3LF3c delta 17 Zcmca^a?WJK8cD`Qlh;amPiB+~0{}*f2F?Hg diff --git a/mongodb_backup/leanote_install_data/notebooks.bson b/mongodb_backup/leanote_install_data/notebooks.bson index cbd09cae1354759bff1827fb9693f75172676880..5ec5e34dca148375ecff73827b6b17259b25a332 100644 GIT binary patch delta 23 ecmZqYp1{4~Ckyv<1_lNW&tj*X{PfAcS$Y6iqGx;`~6i>2R#*$tY{SuH#0K=X(cmMzZ delta 191 zcmaDXv{Gn;4in4FsNLq94VYdrGd`az&n`dNicM{@2&?eqeh%Krooqal``D#7A7Qg+ z)OBWLU|^5WOkoH~R?Aq@tD;}R02BxME>?3DcSyvYjea_lD*{1$sMGEBb4VaUh;0N*J#KmY&$ diff --git a/mongodb_backup/leanote_install_data/system.indexes.bson b/mongodb_backup/leanote_install_data/system.indexes.bson index 73c41e6c9c9dfa074d3f935d0f3d611aaccb1c65..f8f7cfb8b5091b367be3ab666b26ab4251df611a 100644 GIT binary patch delta 38 tcmZn_zbw9?m3y)*lZjMGVtRaXera9_15;jNZYl#S0|P^RW=cE*0|4)s3cdgU delta 7 OcmcaC-YUMKl^XyIa015w 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 0000000000000000000000000000000000000000..2e8b7e17287521fdbd92b5c05e2bc55f7e7b3ecf GIT binary patch literal 157 zcmeZgU|?X6&rD$mNp{xm>bSFa<~{ZK?4iY}MV=`P!5Ifv%{*MqG?#&aktrlGoq+?W zIwv(TFTW&}fy1-dDJMUjfllNeb`L{0R59M AVE_OC literal 0 HcmV?d00001 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 02d91c10d3d15529cde13382b8fe6f6ad2068490..8d1ae637912058bbdb161dcc7aaa58e04dbe05e1 100644 GIT binary patch delta 279 zcmey()5O1_iE*+9o5ynH<0-s>t%gsI5KuA#)Ok zZfZ_ydSYJ5nUu=q8%$|8^`3yUO+9qmdPyFjS U`2d?FSg8`b=;X&hd-_VjMUsz&lHA`WNX`*hpVT}Wnf_1oXF_M1OVba3z+}_ delta 15 WcmX@YzMh?N(niJv#?57neoO!主页 {{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