beta2 theme
This commit is contained in:
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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")
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,47 +1,19 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="keywords" content="leanote,leanote.com">
|
||||
<title>404</title>
|
||||
{{template "header.html" .}}
|
||||
|
||||
<link href="/css/bootstrap.css" rel="stylesheet">
|
||||
<link href="/css/font-awesome-4.2.0/css/font-awesome.css" rel="stylesheet">
|
||||
<link href="/css/index.css" rel="stylesheet">
|
||||
<style>
|
||||
html, body {
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body id="boxBody">
|
||||
<section id="box">
|
||||
<div>
|
||||
<div>
|
||||
<h1 class="h text-white animated fadeInDownBig">life-404</h1>
|
||||
<div id="postsContainer">
|
||||
|
||||
<div id="posts">
|
||||
<div class="each-post">
|
||||
<div class="title">
|
||||
404 NOT FOUND
|
||||
</div>
|
||||
<div class="desc">
|
||||
Sorry, We can't find this page.
|
||||
</div>
|
||||
</div>
|
||||
<div id="errorBox">
|
||||
<p class="error-info">
|
||||
This page cann't found.
|
||||
</p>
|
||||
|
||||
<div class="list-group m-b-sm bg-white m-b-lg">
|
||||
<a href="javascript:history.go(-1);" class="list-group-item"><!-- <i class="fa fa-chevron-right icon-muted"> --></i> <i class="fa fa-fw fa-arrow-left icon-muted"></i> Back </a>
|
||||
<a href="/index" class="list-group-item"><!-- <i class="fa fa-chevron-right icon-muted"> --></i> <i class="fa fa-fw fa-home icon-muted"></i> Goto homepage </a>
|
||||
<a href="/note" class="list-group-item"><!-- <i class="fa fa-chevron-right icon-muted"> --></i> <i class="fa fa-fw fa-file-o icon-muted"></i> My note</a>
|
||||
<a class="list-group-item" href="mailto:leanote@leanote.com">
|
||||
<span class="badge">leanote@leanote.com</span>
|
||||
<i class="fa fa-fw fa-envelope-o icon-muted"></i> Contact Us </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<div id="boxFooter">
|
||||
<p>
|
||||
<a href="/index">leanote</a> © 2014
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{{template "footer.html" $}}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
@ -11,9 +11,17 @@
|
||||
{{range $.archives}}
|
||||
<li><span class="archive-year">{{.Year}}</span>
|
||||
<ul>
|
||||
{{range .Posts}}
|
||||
{{range .MonthAchives}}
|
||||
<li>
|
||||
{{dateFormat .PublicTime "2006-01-02"}} <a href="{{$.postUrl}}/{{.NoteId}}">{{.Title}}</a>
|
||||
<span class="archive-month">{{.Month}}</span>
|
||||
<ul>
|
||||
{{range .Posts}}
|
||||
<li>
|
||||
{{dateFormat .PublicTime "2006-01-02"}} <a href="{{$.postUrl}}/{{.UrlTitle}}">{{.Title}}</a>
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
|
@ -90,14 +90,14 @@ function log(o) {
|
||||
<!-- 分类页 -->
|
||||
{{range $.cates}}
|
||||
<li class="{{if eq .CateId $.curCateId}}active{{end}}">
|
||||
<a href="{{$.cateUrl}}/{{.CateId}}"
|
||||
<a href="{{$.cateUrl}}/{{.UrlTitle}}"
|
||||
>{{.Title}}</a>
|
||||
</li>
|
||||
{{end}}
|
||||
<!-- 单页 -->
|
||||
{{range $.singles}}
|
||||
<li class="{{if eq $.curSingleId .SingleId}}active{{end}}">
|
||||
<a href="{{$.singleUrl}}/{{.SingleId}}">{{.Title}}</a>
|
||||
<a href="{{$.singleUrl}}/{{.UrlTitle}}">{{.Title}}</a>
|
||||
</li>
|
||||
{{end}}
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
{{range $.posts}}
|
||||
<div class="each-post">
|
||||
<div class="title">
|
||||
<a href="{{$.postUrl}}/{{.NoteId}}" title="全文">
|
||||
<a href="{{$.postUrl}}/{{.UrlTitle}}" title="全文">
|
||||
{{.Title}}
|
||||
</a>
|
||||
</div>
|
||||
@ -25,7 +25,7 @@
|
||||
<div class="desc">
|
||||
{{.Abstract | raw}}
|
||||
</div>
|
||||
<a class="more" href="{{$.postUrl}}/{{.NoteId}}" title="全文">查看</a>
|
||||
<a class="more" href="{{$.postUrl}}/{{.UrlTitle}}" title="全文">查看</a>
|
||||
</div>
|
||||
{{end}}
|
||||
<!-- 分页 -->
|
||||
|
@ -51,10 +51,10 @@
|
||||
|
||||
<div class="pre-next-post">
|
||||
<p>
|
||||
上一篇: {{if $.prePost}}<a href="{{$.postUrl}}/{{$.prePost.NoteId}}">{{$.prePost.Title}}</a>{{else}}无{{end}}
|
||||
上一篇: {{if $.prePost}}<a href="{{$.postUrl}}/{{$.prePost.UrlTitle}}">{{$.prePost.Title}}</a>{{else}}无{{end}}
|
||||
</p>
|
||||
<p>
|
||||
下一篇: {{if $.nextPost}}<a href="{{$.postUrl}}/{{$.nextPost.NoteId}}">{{$.nextPost.Title}}</a>{{else}}无{{end}}
|
||||
下一篇: {{if $.nextPost}}<a href="{{$.postUrl}}/{{$.nextPost.UrlTitle}}">{{$.nextPost.Title}}</a>{{else}}无{{end}}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
{{range .posts}}
|
||||
<div class="each-post">
|
||||
<div class="title">
|
||||
<a href="{{$.postUrl}}/{{.NoteId}}" title="全文">
|
||||
<a href="{{$.postUrl}}/{{.UrlTitle}}" title="全文">
|
||||
{{.Title}}
|
||||
</a>
|
||||
</div>
|
||||
@ -27,7 +27,7 @@
|
||||
<div class="desc">
|
||||
{{.Abstract | raw}}
|
||||
</div>
|
||||
<a class="more" href="{{$.postUrl}}/{{.NoteId}}" title="全文">查看</a>
|
||||
<a class="more" href="{{$.postUrl}}/{{.UrlTitle}}" title="全文">查看</a>
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
{{range .posts}}
|
||||
<div class="each-post">
|
||||
<div class="title">
|
||||
<a href="{{$.postUrl}}/{{.NoteId}}" title="全文">
|
||||
<a href="{{$.postUrl}}/{{.UrlTitle}}" title="全文">
|
||||
{{.Title}}
|
||||
</a>
|
||||
</div>
|
||||
@ -27,7 +27,7 @@
|
||||
<div class="desc">
|
||||
{{.Abstract | raw}}
|
||||
</div>
|
||||
<a class="more" href="{{$.postUrl}}/{{.NoteId}}" title="全文">查看</a>
|
||||
<a class="more" href="{{$.postUrl}}/{{.UrlTitle}}" title="全文">查看</a>
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="each-post">
|
||||
|
@ -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"}
|
||||
]
|
||||
}
|
@ -1,47 +1,19 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="keywords" content="leanote,leanote.com">
|
||||
<title>404</title>
|
||||
{{template "header.html" .}}
|
||||
|
||||
<link href="/css/bootstrap.css" rel="stylesheet">
|
||||
<link href="/css/font-awesome-4.2.0/css/font-awesome.css" rel="stylesheet">
|
||||
<link href="/css/index.css" rel="stylesheet">
|
||||
<style>
|
||||
html, body {
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body id="boxBody">
|
||||
<section id="box">
|
||||
<div>
|
||||
<div>
|
||||
<h1 class="h text-white animated fadeInDownBig">life-404</h1>
|
||||
<div id="postsContainer">
|
||||
|
||||
<div id="posts">
|
||||
<div class="each-post">
|
||||
<div class="title">
|
||||
404 NOT FOUND
|
||||
</div>
|
||||
<div class="desc">
|
||||
Sorry, We can't find this page.
|
||||
</div>
|
||||
</div>
|
||||
<div id="errorBox">
|
||||
<p class="error-info">
|
||||
This page cann't found.
|
||||
</p>
|
||||
|
||||
<div class="list-group m-b-sm bg-white m-b-lg">
|
||||
<a href="javascript:history.go(-1);" class="list-group-item"><!-- <i class="fa fa-chevron-right icon-muted"> --></i> <i class="fa fa-fw fa-arrow-left icon-muted"></i> Back </a>
|
||||
<a href="/index" class="list-group-item"><!-- <i class="fa fa-chevron-right icon-muted"> --></i> <i class="fa fa-fw fa-home icon-muted"></i> Goto homepage </a>
|
||||
<a href="/note" class="list-group-item"><!-- <i class="fa fa-chevron-right icon-muted"> --></i> <i class="fa fa-fw fa-file-o icon-muted"></i> My note</a>
|
||||
<a class="list-group-item" href="mailto:leanote@leanote.com">
|
||||
<span class="badge">leanote@leanote.com</span>
|
||||
<i class="fa fa-fw fa-envelope-o icon-muted"></i> Contact Us </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<div id="boxFooter">
|
||||
<p>
|
||||
<a href="/index">leanote</a> © 2014
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{{template "footer.html" $}}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
@ -1,47 +1,19 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="keywords" content="leanote,leanote.com">
|
||||
<title>404</title>
|
||||
{{template "header.html" .}}
|
||||
|
||||
<link href="/css/bootstrap.css" rel="stylesheet">
|
||||
<link href="/css/font-awesome-4.2.0/css/font-awesome.css" rel="stylesheet">
|
||||
<link href="/css/index.css" rel="stylesheet">
|
||||
<style>
|
||||
html, body {
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body id="boxBody">
|
||||
<section id="box">
|
||||
<div>
|
||||
<div>
|
||||
<h1 class="h text-white animated fadeInDownBig">life-404</h1>
|
||||
<div id="postsContainer">
|
||||
|
||||
<div id="posts">
|
||||
<div class="each-post">
|
||||
<div class="title">
|
||||
404 NOT FOUND
|
||||
</div>
|
||||
<div class="desc">
|
||||
Sorry, We can't find this page.
|
||||
</div>
|
||||
</div>
|
||||
<div id="errorBox">
|
||||
<p class="error-info">
|
||||
This page cann't found.
|
||||
</p>
|
||||
|
||||
<div class="list-group m-b-sm bg-white m-b-lg">
|
||||
<a href="javascript:history.go(-1);" class="list-group-item"><!-- <i class="fa fa-chevron-right icon-muted"> --></i> <i class="fa fa-fw fa-arrow-left icon-muted"></i> Back </a>
|
||||
<a href="/index" class="list-group-item"><!-- <i class="fa fa-chevron-right icon-muted"> --></i> <i class="fa fa-fw fa-home icon-muted"></i> Goto homepage </a>
|
||||
<a href="/note" class="list-group-item"><!-- <i class="fa fa-chevron-right icon-muted"> --></i> <i class="fa fa-fw fa-file-o icon-muted"></i> My note</a>
|
||||
<a class="list-group-item" href="mailto:leanote@leanote.com">
|
||||
<span class="badge">leanote@leanote.com</span>
|
||||
<i class="fa fa-fw fa-envelope-o icon-muted"></i> Contact Us </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<div id="boxFooter">
|
||||
<p>
|
||||
<a href="/index">leanote</a> © 2014
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{{template "footer.html" $}}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
@ -11,9 +11,17 @@
|
||||
{{range $.archives}}
|
||||
<li><span class="archive-year">{{.Year}}</span>
|
||||
<ul>
|
||||
{{range .Posts}}
|
||||
{{range .MonthAchives}}
|
||||
<li>
|
||||
{{dateFormat .PublicTime "2006-01-02"}} <a href="{{$.postUrl}}/{{.NoteId}}">{{.Title}}</a>
|
||||
<span class="archive-month">{{.Month}}</span>
|
||||
<ul>
|
||||
{{range .Posts}}
|
||||
<li>
|
||||
{{dateFormat .PublicTime "2006-01-02"}} <a href="{{$.postUrl}}/{{.UrlTitle}}">{{.Title}}</a>
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
|
@ -90,14 +90,14 @@ function log(o) {
|
||||
<!-- 分类页 -->
|
||||
{{range $.cates}}
|
||||
<li class="{{if eq .CateId $.curCateId}}active{{end}}">
|
||||
<a href="{{$.cateUrl}}/{{.CateId}}"
|
||||
<a href="{{$.cateUrl}}/{{.UrlTitle}}"
|
||||
>{{.Title}}</a>
|
||||
</li>
|
||||
{{end}}
|
||||
<!-- 单页 -->
|
||||
{{range $.singles}}
|
||||
<li class="{{if eq $.curSingleId .SingleId}}active{{end}}">
|
||||
<a href="{{$.singleUrl}}/{{.SingleId}}">{{.Title}}</a>
|
||||
<a href="{{$.singleUrl}}/{{.UrlTitle}}">{{.Title}}</a>
|
||||
</li>
|
||||
{{end}}
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
{{range $.posts}}
|
||||
<div class="each-post">
|
||||
<div class="title">
|
||||
<a href="{{$.postUrl}}/{{.NoteId}}" title="全文">
|
||||
<a href="{{$.postUrl}}/{{.UrlTitle}}" title="全文">
|
||||
{{.Title}}
|
||||
</a>
|
||||
</div>
|
||||
@ -25,7 +25,7 @@
|
||||
<div class="desc">
|
||||
{{.Abstract | raw}}
|
||||
</div>
|
||||
<a class="more" href="{{$.postUrl}}/{{.NoteId}}" title="全文">查看</a>
|
||||
<a class="more" href="{{$.postUrl}}/{{.UrlTitle}}" title="全文">查看</a>
|
||||
</div>
|
||||
{{end}}
|
||||
<!-- 分页 -->
|
||||
|
@ -51,10 +51,10 @@
|
||||
|
||||
<div class="pre-next-post">
|
||||
<p>
|
||||
上一篇: {{if $.prePost}}<a href="{{$.postUrl}}/{{$.prePost.NoteId}}">{{$.prePost.Title}}</a>{{else}}无{{end}}
|
||||
上一篇: {{if $.prePost}}<a href="{{$.postUrl}}/{{$.prePost.UrlTitle}}">{{$.prePost.Title}}</a>{{else}}无{{end}}
|
||||
</p>
|
||||
<p>
|
||||
下一篇: {{if $.nextPost}}<a href="{{$.postUrl}}/{{$.nextPost.NoteId}}">{{$.nextPost.Title}}</a>{{else}}无{{end}}
|
||||
下一篇: {{if $.nextPost}}<a href="{{$.postUrl}}/{{$.nextPost.UrlTitle}}">{{$.nextPost.Title}}</a>{{else}}无{{end}}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
{{range .posts}}
|
||||
<div class="each-post">
|
||||
<div class="title">
|
||||
<a href="{{$.postUrl}}/{{.NoteId}}" title="全文">
|
||||
<a href="{{$.postUrl}}/{{.UrlTitle}}" title="全文">
|
||||
{{.Title}}
|
||||
</a>
|
||||
</div>
|
||||
@ -27,7 +27,7 @@
|
||||
<div class="desc">
|
||||
{{.Abstract | raw}}
|
||||
</div>
|
||||
<a class="more" href="{{$.postUrl}}/{{.NoteId}}" title="全文">查看</a>
|
||||
<a class="more" href="{{$.postUrl}}/{{.UrlTitle}}" title="全文">查看</a>
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
{{range .posts}}
|
||||
<div class="each-post">
|
||||
<div class="title">
|
||||
<a href="{{$.postUrl}}/{{.NoteId}}" title="全文">
|
||||
<a href="{{$.postUrl}}/{{.UrlTitle}}" title="全文">
|
||||
{{.Title}}
|
||||
</a>
|
||||
</div>
|
||||
@ -27,7 +27,7 @@
|
||||
<div class="desc">
|
||||
{{.Abstract | raw}}
|
||||
</div>
|
||||
<a class="more" href="{{$.postUrl}}/{{.NoteId}}" title="全文">查看</a>
|
||||
<a class="more" href="{{$.postUrl}}/{{.UrlTitle}}" title="全文">查看</a>
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="each-post">
|
||||
|
@ -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"}
|
||||
]
|
||||
}
|
Reference in New Issue
Block a user