From 163215d547c231fa3943d9490b326b9fc48e0221 Mon Sep 17 00:00:00 2001 From: life Date: Wed, 12 Nov 2014 18:54:42 +0800 Subject: [PATCH] beta2 theme --- app/controllers/BlogController.go | 3 + app/service/ThemeService.go | 10 +-- app/service/UpgradeService.go | 2 - .../leanote_install_data/configs.bson | Bin 23959 -> 23959 bytes .../leanote_install_data/sessions.bson | Bin 2274 -> 2274 bytes .../leanote_install_data/themes.bson | Bin 1587 -> 1659 bytes .../leanote_install_data/users.bson | Bin 569 -> 569 bytes public/blog/themes/default/404.html | 58 +++++------------- public/blog/themes/default/archive.html | 12 +++- public/blog/themes/default/header.html | 4 +- public/blog/themes/default/index.html | 4 +- public/blog/themes/default/post.html | 4 +- public/blog/themes/default/search.html | 4 +- public/blog/themes/default/tag_posts.html | 4 +- public/blog/themes/default/theme.json | 6 +- public/blog/themes/elegant/404.html | 58 +++++------------- public/blog/themes/nav_fixed/404.html | 58 +++++------------- public/blog/themes/nav_fixed/archive.html | 12 +++- public/blog/themes/nav_fixed/header.html | 4 +- public/blog/themes/nav_fixed/index.html | 4 +- public/blog/themes/nav_fixed/post.html | 4 +- public/blog/themes/nav_fixed/search.html | 4 +- public/blog/themes/nav_fixed/tag_posts.html | 4 +- public/blog/themes/nav_fixed/theme.json | 6 +- 24 files changed, 104 insertions(+), 161 deletions(-) diff --git a/app/controllers/BlogController.go b/app/controllers/BlogController.go index 172b9d8..1ccf16f 100644 --- a/app/controllers/BlogController.go +++ b/app/controllers/BlogController.go @@ -297,6 +297,9 @@ func (c Blog) blogCommon(userId string, userBlog info.UserBlog, userInfo info.Us // 得到主题信息 themeInfo := themeService.GetThemeInfo(userBlog.ThemeId.Hex(), userBlog.Style) c.RenderArgs["themeInfo"] = themeInfo + Log(">>") + Log(userBlog.Style) + Log(userBlog.ThemeId.Hex()) return true, userBlog } diff --git a/app/service/ThemeService.go b/app/service/ThemeService.go index d1385ec..95577a7 100644 --- a/app/service/ThemeService.go +++ b/app/service/ThemeService.go @@ -438,14 +438,15 @@ func (this *ThemeService) ImportTheme(userId, path string) (ok bool, msg string) func (this *ThemeService) UpgradeThemeBeta2() (ok bool) { adminUserId := configService.GetAdminUserId() - this.upgradeThemeBeta2(adminUserId, this.GetDefaultThemePath(defaultStyle), true) - this.upgradeThemeBeta2(adminUserId, this.GetDefaultThemePath(elegantStyle), false) - this.upgradeThemeBeta2(adminUserId, this.GetDefaultThemePath(fixedStyle), false) + this.upgradeThemeBeta2(adminUserId, defaultStyle, true) + this.upgradeThemeBeta2(adminUserId, elegantStyle, false) + this.upgradeThemeBeta2(adminUserId, fixedStyle, false) return true } -func (this *ThemeService) upgradeThemeBeta2(userId, targetPath string, isActive bool) (ok bool) { +func (this *ThemeService) upgradeThemeBeta2(userId, style string, isActive bool) (ok bool) { // 解压成功, 那么新建之 // 保存到数据库中 + targetPath := this.GetDefaultThemePath(style) theme, _ := this.getThemeConfig(revel.BasePath + "/" + targetPath) if theme.Name == "" { ok = false @@ -459,6 +460,7 @@ func (this *ThemeService) upgradeThemeBeta2(userId, targetPath string, isActive theme.UserId = bson.ObjectIdHex(userId) theme.IsActive = isActive theme.IsDefault = true + theme.Style = style ok = db.Insert(db.Themes, theme) return ok } diff --git a/app/service/UpgradeService.go b/app/service/UpgradeService.go index 740a14d..a595dc2 100644 --- a/app/service/UpgradeService.go +++ b/app/service/UpgradeService.go @@ -49,7 +49,6 @@ func (this *UpgradeService) UpgradeBetaToBeta2(userId string) (ok bool, msg stri blogService.AddOrUpdateSingle(userBlog.UserId.Hex(), "", "About Me", userBlog.AboutMe) } - // 2. 默认主题, 给admin用户 themeService.UpgradeThemeBeta2() @@ -97,7 +96,6 @@ func (this *UpgradeService) UpgradeBetaToBeta2(userId string) (ok bool, msg stri // 删除索引 db.ShareNotes.DropIndex("UserId", "ToUserId", "NoteId") - ok = true msg = "success" configService.UpdateGlobalStringConfig(userId, "UpgradeBetaToBeta2", "1") diff --git a/mongodb_backup/leanote_install_data/configs.bson b/mongodb_backup/leanote_install_data/configs.bson index cf86d87cf9343f707b627d189489e8bdf801ab0a..1697dffb8a3f1e071214ff0d0d1072f40d68c1cd 100644 GIT binary patch delta 66 zcmbQfn{oPX#tk|l%uP?CCKm=vPEPRPog5m1!ry!;M1+xRcjo-Xo{S6(4Aqkz1C%HC Mh52qy2s38~09u9^G5`Po delta 66 zcmbQfn{oPX#tk|l%uiFoCl>}wPEPRPog5m1!ry!;M1+xR>eSH1o{S6(4Aqkz1C%HC Mh52qy2s38~07>2#t^fc4 diff --git a/mongodb_backup/leanote_install_data/sessions.bson b/mongodb_backup/leanote_install_data/sessions.bson index 803d6503844519e8cecc5b0f6097fb26875d4921..cfd9ba08c65d987bcf5fb4dbb277b4fa37339843 100644 GIT binary patch delta 53 zcmaDP_(*VrJqMTOubGFdTeKJ$m?nF2RLiCRj$Z7^$iToET9A@hlA02dnVZTW#vcO~ GWB>sAeGrBK delta 53 zcmaDP_(*VrJqMRs)y%`y4eJ;fcqV&tRLf2B^IPo6$iToET9A@hlA02dnVZTmB@`ma F008eB5VQaQ diff --git a/mongodb_backup/leanote_install_data/themes.bson b/mongodb_backup/leanote_install_data/themes.bson index d31da2fff9d62f7a4e60cfc7c6beebe33bc499ed..02d91c10d3d15529cde13382b8fe6f6ad2068490 100644 GIT binary patch delta 365 zcmdnY^P5NX5+efxdwgaJLrAiCm4TOmfgvd; zKRrGrH7&6;r-XsixhOTUBsC=@GdGoCTju=5oZNfzeJ!d0ub4}{E}4N)ST4x z#JrNp?^z{7p-$w2J29~^6V-jYu(=N=$Z#D?05F3BV4{BZWI@*NZcqzA_JhM9CpE1k MJ}t8%HH8#w03v^J0{{R3 delta 259 zcmey(vzbS97b61$dwgaJLrAjfvzdph8`d!}uuR^`(mHY0R|ih#qSVBa)Rd6S+*F38 zTt16EfvPz}3sNuy8TK+^n!`HzIpfO7#w?PPMVY)O{^gzgoar=wNM=b+Dgzq>14B+~ xqPF(r4a|y@A2A0^mSvMbwQnUh`(T0$d$72hZSzi+8b)mtSHm=*xEdzN007=)QKSF> diff --git a/mongodb_backup/leanote_install_data/users.bson b/mongodb_backup/leanote_install_data/users.bson index 53f0c452ced92925f4667e9f62fbafea76069094..f7dbf809eb0add68bf656f80fd518f2d2ec77644 100644 GIT binary patch delta 14 WcmdnVvXf=QM8=7Q8k2W2HUI!Cmj$!{ delta 44 zcmdnVvXf=QL`DS*lT>pf6GH>bq!eR=L`!2+3lp - - - - - - -404 +{{template "header.html" .}} - - - - - - -
-
-
-

life-404

+
+ +
+
+
+ 404 NOT FOUND +
+
+ Sorry, We can't find this page. +
-
-

- This page cann't found. -

- - -
-
-
-
-

- leanote © 2014 -

+
+{{template "footer.html" $}} + - + \ No newline at end of file diff --git a/public/blog/themes/default/archive.html b/public/blog/themes/default/archive.html index 4a9cb7c..2d19517 100644 --- a/public/blog/themes/default/archive.html +++ b/public/blog/themes/default/archive.html @@ -11,9 +11,17 @@ {{range $.archives}}
  • {{.Year}}
      - {{range .Posts}} + {{range .MonthAchives}}
    • - {{dateFormat .PublicTime "2006-01-02"}} {{.Title}} + {{.Month}} +
        + {{range .Posts}} +
      • + {{dateFormat .PublicTime "2006-01-02"}} {{.Title}} +
      • + {{end}} +
      +
    • {{end}}
    diff --git a/public/blog/themes/default/header.html b/public/blog/themes/default/header.html index f3144bd..839564a 100644 --- a/public/blog/themes/default/header.html +++ b/public/blog/themes/default/header.html @@ -90,14 +90,14 @@ function log(o) { {{range $.cates}}
  • - {{.Title}}
  • {{end}} {{range $.singles}}
  • - {{.Title}} + {{.Title}}
  • {{end}} diff --git a/public/blog/themes/default/index.html b/public/blog/themes/default/index.html index 0a9da13..991415e 100644 --- a/public/blog/themes/default/index.html +++ b/public/blog/themes/default/index.html @@ -6,7 +6,7 @@ {{range $.posts}}
    @@ -25,7 +25,7 @@
    {{.Abstract | raw}}
    - 查看 + 查看
    {{end}} diff --git a/public/blog/themes/default/post.html b/public/blog/themes/default/post.html index 24dcaf5..f9f0ca9 100644 --- a/public/blog/themes/default/post.html +++ b/public/blog/themes/default/post.html @@ -51,10 +51,10 @@

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

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

    diff --git a/public/blog/themes/default/search.html b/public/blog/themes/default/search.html index 7cfaea7..4e1900c 100644 --- a/public/blog/themes/default/search.html +++ b/public/blog/themes/default/search.html @@ -9,7 +9,7 @@ {{range .posts}}
    @@ -27,7 +27,7 @@
    {{.Abstract | raw}}
    - 查看 + 查看
    diff --git a/public/blog/themes/default/tag_posts.html b/public/blog/themes/default/tag_posts.html index eff18c7..dd53960 100644 --- a/public/blog/themes/default/tag_posts.html +++ b/public/blog/themes/default/tag_posts.html @@ -9,7 +9,7 @@ {{range .posts}}
    @@ -27,7 +27,7 @@
    {{.Abstract | raw}}
    - 查看 + 查看
    {{else}}
    diff --git a/public/blog/themes/default/theme.json b/public/blog/themes/default/theme.json index 27e971c..5fcf492 100644 --- a/public/blog/themes/default/theme.json +++ b/public/blog/themes/default/theme.json @@ -22,6 +22,10 @@ "Author": "leanote.com", "AuthorUrl": "http://leanote.com", "FriendLinks": [ - {"Title": "leanote", "Url": "http://leanote.com"} + {"Title": "我的笔记", "Url": "http://leanote.com/note"}, + {"Title": "leanote home", "Url": "http://leanote.com"}, + {"Title": "leanote 社区", "Url": "http://bbs.leanote.com"}, + {"Title": "lea++", "Url": "http://lea.leanote.com"}, + {"Title": "leanote github", "Url": "https://github.com/leanote/leanote"} ] } \ No newline at end of file diff --git a/public/blog/themes/elegant/404.html b/public/blog/themes/elegant/404.html index ff4728c..4a698af 100644 --- a/public/blog/themes/elegant/404.html +++ b/public/blog/themes/elegant/404.html @@ -1,47 +1,19 @@ - - - - - - - -404 +{{template "header.html" .}} - - - - - - -
    -
    -
    -

    life-404

    +
    + +
    +
    +
    + 404 NOT FOUND +
    +
    + Sorry, We can't find this page. +
    -
    -

    - This page cann't found. -

    - - -
    -
    -
    -
    -

    - leanote © 2014 -

    +
    +{{template "footer.html" $}} + - + \ No newline at end of file diff --git a/public/blog/themes/nav_fixed/404.html b/public/blog/themes/nav_fixed/404.html index ff4728c..4a698af 100644 --- a/public/blog/themes/nav_fixed/404.html +++ b/public/blog/themes/nav_fixed/404.html @@ -1,47 +1,19 @@ - - - - - - - -404 +{{template "header.html" .}} - - - - - - -
    -
    -
    -

    life-404

    +
    + +
    +
    +
    + 404 NOT FOUND +
    +
    + Sorry, We can't find this page. +
    -
    -

    - This page cann't found. -

    - - -
    -
    -
    -
    -

    - leanote © 2014 -

    +
    +{{template "footer.html" $}} + - + \ No newline at end of file diff --git a/public/blog/themes/nav_fixed/archive.html b/public/blog/themes/nav_fixed/archive.html index 4a9cb7c..2d19517 100644 --- a/public/blog/themes/nav_fixed/archive.html +++ b/public/blog/themes/nav_fixed/archive.html @@ -11,9 +11,17 @@ {{range $.archives}}
  • {{.Year}}
      - {{range .Posts}} + {{range .MonthAchives}}
    • - {{dateFormat .PublicTime "2006-01-02"}} {{.Title}} + {{.Month}} +
        + {{range .Posts}} +
      • + {{dateFormat .PublicTime "2006-01-02"}} {{.Title}} +
      • + {{end}} +
      +
    • {{end}}
    diff --git a/public/blog/themes/nav_fixed/header.html b/public/blog/themes/nav_fixed/header.html index f3144bd..839564a 100644 --- a/public/blog/themes/nav_fixed/header.html +++ b/public/blog/themes/nav_fixed/header.html @@ -90,14 +90,14 @@ function log(o) { {{range $.cates}}
  • - {{.Title}}
  • {{end}} {{range $.singles}}
  • - {{.Title}} + {{.Title}}
  • {{end}} diff --git a/public/blog/themes/nav_fixed/index.html b/public/blog/themes/nav_fixed/index.html index 0a9da13..991415e 100644 --- a/public/blog/themes/nav_fixed/index.html +++ b/public/blog/themes/nav_fixed/index.html @@ -6,7 +6,7 @@ {{range $.posts}}
    @@ -25,7 +25,7 @@
    {{.Abstract | raw}}
    - 查看 + 查看
    {{end}} diff --git a/public/blog/themes/nav_fixed/post.html b/public/blog/themes/nav_fixed/post.html index 24dcaf5..f9f0ca9 100644 --- a/public/blog/themes/nav_fixed/post.html +++ b/public/blog/themes/nav_fixed/post.html @@ -51,10 +51,10 @@

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

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

    diff --git a/public/blog/themes/nav_fixed/search.html b/public/blog/themes/nav_fixed/search.html index 7cfaea7..4e1900c 100644 --- a/public/blog/themes/nav_fixed/search.html +++ b/public/blog/themes/nav_fixed/search.html @@ -9,7 +9,7 @@ {{range .posts}}
    @@ -27,7 +27,7 @@
    {{.Abstract | raw}}
    - 查看 + 查看
    diff --git a/public/blog/themes/nav_fixed/tag_posts.html b/public/blog/themes/nav_fixed/tag_posts.html index eff18c7..dd53960 100644 --- a/public/blog/themes/nav_fixed/tag_posts.html +++ b/public/blog/themes/nav_fixed/tag_posts.html @@ -9,7 +9,7 @@ {{range .posts}}
    @@ -27,7 +27,7 @@
    {{.Abstract | raw}}
    - 查看 + 查看
    {{else}}
    diff --git a/public/blog/themes/nav_fixed/theme.json b/public/blog/themes/nav_fixed/theme.json index 27e971c..5fcf492 100644 --- a/public/blog/themes/nav_fixed/theme.json +++ b/public/blog/themes/nav_fixed/theme.json @@ -22,6 +22,10 @@ "Author": "leanote.com", "AuthorUrl": "http://leanote.com", "FriendLinks": [ - {"Title": "leanote", "Url": "http://leanote.com"} + {"Title": "我的笔记", "Url": "http://leanote.com/note"}, + {"Title": "leanote home", "Url": "http://leanote.com"}, + {"Title": "leanote 社区", "Url": "http://bbs.leanote.com"}, + {"Title": "lea++", "Url": "http://lea.leanote.com"}, + {"Title": "leanote github", "Url": "https://github.com/leanote/leanote"} ] } \ No newline at end of file