remove unused codes and add site'url configuration on admin

This commit is contained in:
lealife
2016-05-25 16:05:47 +08:00
parent a007b89ebb
commit a07bb25128
21 changed files with 117 additions and 1047 deletions

View File

@ -113,8 +113,8 @@ func (c Blog) setPreviewUrl() {
themeId := c.Session["themeId"]
theme := themeService.GetTheme(userId, themeId)
siteUrl := configService.GetSiteUrl()
blogUrl := siteUrl + "/preview" // blog.leanote.com
// siteUrl := configService.GetSiteUrl()
blogUrl := "/preview" // blog.leanote.com
indexUrl = blogUrl + "/" + userIdOrEmail
cateUrl = blogUrl + "/cate/" + userIdOrEmail // /notebookId
@ -143,8 +143,8 @@ func (c Blog) setPreviewUrl() {
// 各种地址设置
func (c Blog) setUrl(userBlog info.UserBlog, userInfo info.User) {
// 主页 http://leanote.com/blog/life or http://blog.leanote.com/life or http:// xxxx.leanote.com or aa.com
host := c.Request.Request.Host
var staticUrl = configService.GetUserUrl(strings.Split(host, ":")[0])
// host := c.Request.Request.Host
// var staticUrl = configService.GetUserUrl(strings.Split(host, ":")[0])
// staticUrl == host, 为保证同源!!! 只有host, http://leanote.com, http://blog/leanote.com
// life.leanote.com, lealife.com
siteUrl := configService.GetSiteUrl()
@ -168,20 +168,20 @@ func (c Blog) setUrl(userBlog info.UserBlog, userInfo info.User) {
c.RenderArgs["themeBaseUrl"] = "/" + userBlog.ThemePath
// 其它static js
c.RenderArgs["jQueryUrl"] = siteUrl + "/js/jquery-1.9.0.min.js"
c.RenderArgs["jQueryUrl"] = "/js/jquery-1.9.0.min.js"
c.RenderArgs["prettifyJsUrl"] = siteUrl + "/js/google-code-prettify/prettify.js"
c.RenderArgs["prettifyCssUrl"] = siteUrl + "/js/google-code-prettify/prettify.css"
c.RenderArgs["prettifyJsUrl"] = "/js/google-code-prettify/prettify.js"
c.RenderArgs["prettifyCssUrl"] = "/js/google-code-prettify/prettify.css"
c.RenderArgs["blogCommonJsUrl"] = siteUrl + "/public/blog/js/common.js"
c.RenderArgs["blogCommonJsUrl"] = "/public/blog/js/common.js"
c.RenderArgs["shareCommentCssUrl"] = siteUrl + "/public/blog/css/share_comment.css"
c.RenderArgs["shareCommentJsUrl"] = siteUrl + "/public/blog/js/share_comment.js"
c.RenderArgs["shareCommentCssUrl"] = "/public/blog/css/share_comment.css"
c.RenderArgs["shareCommentJsUrl"] = "/public/blog/js/share_comment.js"
c.RenderArgs["fontAwesomeUrl"] = staticUrl + "/css/font-awesome-4.2.0/css/font-awesome.css"
c.RenderArgs["fontAwesomeUrl"] = "/css/font-awesome-4.2.0/css/font-awesome.css"
c.RenderArgs["bootstrapCssUrl"] = siteUrl + "/css/bootstrap.css"
c.RenderArgs["bootstrapJsUrl"] = siteUrl + "/js/bootstrap-min.js"
c.RenderArgs["bootstrapCssUrl"] = "/css/bootstrap.css"
c.RenderArgs["bootstrapJsUrl"] = "/js/bootstrap-min.js"
}
// 笔记本分类

View File

@ -79,6 +79,12 @@ func (c AdminSetting) ExportPdf(path string) revel.Result {
return c.RenderJson(re)
}
func (c AdminSetting) DoSiteUrl(siteUrl string) revel.Result {
re := info.NewRe()
re.Ok = configService.UpdateGlobalStringConfig(c.GetUserId(), "siteUrl", siteUrl)
return c.RenderJson(re)
}
// SubDomain
func (c AdminSetting) SubDomain() revel.Result {
c.RenderArgs["str"] = configService.GlobalStringConfigs

View File

@ -518,7 +518,7 @@ func (this *BlogService) fixUserBlog(userBlog *info.UserBlog) {
// Logo路径问题, 有些有http: 有些没有
if userBlog.Logo != "" && !strings.HasPrefix(userBlog.Logo, "http") {
userBlog.Logo = strings.Trim(userBlog.Logo, "/")
userBlog.Logo = configService.GetSiteUrl() + "/" + userBlog.Logo
userBlog.Logo = "/" + userBlog.Logo
}
if userBlog.SortField == "" {
@ -1108,6 +1108,7 @@ func (this *BlogService) SortSingles(userId string, singleIds []string) (ok bool
// 得到用户的博客url
func (this *BlogService) GetUserBlogUrl(userBlog *info.UserBlog, username string) string {
/*
if userBlog != nil {
if userBlog.Domain != "" && configService.AllowCustomDomain() {
return configService.GetUserUrl(userBlog.Domain)
@ -1118,12 +1119,15 @@ func (this *BlogService) GetUserBlogUrl(userBlog *info.UserBlog, username string
username = userBlog.UserId.Hex()
}
}
*/
return configService.GetBlogUrl() + "/" + username
}
// 得到所有url
func (this *BlogService) GetBlogUrls(userBlog *info.UserBlog, userInfo *info.User) info.BlogUrls {
var indexUrl, postUrl, searchUrl, cateUrl, singleUrl, tagsUrl, archiveUrl, tagPostsUrl string
/*
if userBlog.Domain != "" && configService.AllowCustomDomain() { // http://demo.com
// ok
indexUrl = configService.GetUserUrl(userBlog.Domain)
@ -1144,6 +1148,7 @@ func (this *BlogService) GetBlogUrls(userBlog *info.UserBlog, userInfo *info.Use
tagsUrl = indexUrl + "/tags"
tagPostsUrl = indexUrl + "/tag"
} else {
*/
// ok
blogUrl := configService.GetBlogUrl() // blog.leanote.com
userIdOrEmail := ""
@ -1162,7 +1167,7 @@ func (this *BlogService) GetBlogUrls(userBlog *info.UserBlog, userInfo *info.Use
archiveUrl = blogUrl + "/archives/" + userIdOrEmail // blog.leanote.com/archive/username
tagsUrl = blogUrl + "/tags/" + userIdOrEmail
tagPostsUrl = blogUrl + "/tag/" + userIdOrEmail // blog.leanote.com/archive/username
}
// }
return info.BlogUrls{
IndexUrl: indexUrl,

View File

@ -67,10 +67,20 @@ func (this *ConfigService) InitGlobalConfigs() bool {
}
}
// site URL
if s, ok := this.GlobalStringConfigs["siteUrl"]; !ok || s != "" {
this.GlobalStringConfigs["siteUrl"] = this.siteUrl
}
return true
}
func (this *ConfigService) GetSiteUrl() string {
s := this.GetGlobalStringConfig("siteUrl")
if s != "" {
return s
}
return this.siteUrl
}
func (this *ConfigService) GetAdminUsername() string {
@ -498,42 +508,25 @@ func (this *ConfigService) GetDefaultDomain() string {
return defaultDomain
}
// 包含http://
func (this *ConfigService) GetDefaultUrl() string {
return schema + defaultDomain
}
// note
func (this *ConfigService) GetNoteDomain() string {
subDomain := this.GetGlobalStringConfig("noteSubDomain")
if subDomain != "" {
return subDomain + port
}
return this.GetDefaultDomain() + "/note"
return "/note"
}
func (this *ConfigService) GetNoteUrl() string {
return schema + this.GetNoteDomain()
return this.GetNoteDomain()
}
// blog
func (this *ConfigService) GetBlogDomain() string {
subDomain := this.GetGlobalStringConfig("blogSubDomain")
if subDomain != "" {
return subDomain + port
}
return this.GetDefaultDomain() + "/blog"
return "/blog"
}
func (this *ConfigService) GetBlogUrl() string {
return schema + this.GetBlogDomain()
return this.GetBlogDomain()
}
// lea
func (this *ConfigService) GetLeaDomain() string {
subDomain := this.GetGlobalStringConfig("leaSubDomain")
if subDomain != "" {
return subDomain + port
}
return this.GetDefaultDomain() + "/lea"
return "/lea"
}
func (this *ConfigService) GetLeaUrl() string {
return schema + this.GetLeaDomain()

View File

@ -110,7 +110,7 @@ func (this *UserService) setUserLogo(user *info.User) {
}
if user.Logo != "" && !strings.HasPrefix(user.Logo, "http") {
user.Logo = strings.Trim(user.Logo, "/")
user.Logo = configService.GetSiteUrl() + "/" + user.Logo
user.Logo = "/" + user.Logo
}
}

View File

@ -131,6 +131,15 @@
</span>
</a>
<ul class="nav lt">
<li>
<a href="/admin/t?t=setting/site_url">
<span>
Site's URL
</span>
</a>
</li>
<li>
<a href="/admin/t?t=setting/home_page">
<span>

View File

@ -0,0 +1,51 @@
{{template "admin/top.html" .}}
<div class="m-b-md"> <h3 class="m-b-none">Site's URL</h3></div>
<div class="row">
<div class="col-sm-6">
<form id="add_user_form">
<section class="panel panel-default">
<div class="panel-body">
<div class="form-group">
<label>Site's URL</label>
<input type="text" class="form-control" name="siteUrl" value="{{.str.siteUrl}}" placeholder="http://localhost:9000">
Please note that if the value isn't blank, it will override the "siteUrl" configuration on app.conf.
<br>
Site's URL will be used to upload images, find password, and send email...
</div>
</div>
<footer class="panel-footer text-right bg-light lter">
<button type="submit" id="submit" class="btn btn-success btn-s-xs">Submit</button>
</footer>
</section>
</form>
</div>
</div>
{{template "admin/footer.html" .}}
<script src="/public/admin/js/jquery-validation-1.13.0/jquery.validate.js"></script>
<script>
$(function() {
init_validator("#add_user_form");
$("#submit").click(function(e){
e.preventDefault();
var t = this;
if($("#add_user_form").valid()) {
$(t).button('loading');
ajaxPost("/adminSetting/doSiteUrl", getFormJsonData("add_user_form"), function(ret){
$(t).button('reset');
if(!ret.Ok) {
art.alert(ret.Msg);
} else {
art.tips("Success");
}
});
}
});
});
</script>
{{template "admin/end.html" .}}

View File

@ -1,19 +0,0 @@
{{template "blog/header.html" .}}
<div id="postsContainer">
<div id="posts">
<div class="each-post">
<div class="title">
{{msg . "aboutMe"}}
</div>
<div class="created-time">
</div>
<div class="desc">
{{.userBlog.AboutMe | raw}}
</div>
</div>
</div>
</div>
{{template "blog/footer.html" .}}

View File

@ -1,204 +0,0 @@
<!---->
<div class="entry-controls clearfix">
<div class="vote-section-wrapper clearfix">
<button class="btn btn-default btn-zan" id="likeBtn"><i class="fa fa-thumbs-o-up"></i> <span id="likeNum">{{.blog.LikeNum}}</span> {{msg . "like"}}</button>
<span class="control-item read-counts"><i class="fa fa-eye"></i> {{if .blog.ReadNum}}{{.blog.ReadNum}}{{else}}1{{end}} {{msg . "viewers"}}</span>
</div>
<div class="right-section">
<div id="weixinQRCode"></div>
<!-- google+
<g:plusone size=”medium”></g:plusone>
-->
<button class="btn btn-share btn-default btn-weibo"><i class="fa fa-weibo"></i> {{msg . "sinaWeibo"}}</button>
<button class="btn btn-share btn-default btn-weixin"><i class="fa fa-wechat"></i> {{msg . "weixin"}}</button>
<div class="dropdown" style="display: inline-block; cursor: pointer; padding: 5px 10px;">
<!-- open -->
<div class="dropdown-toggle" data-hover="dropdown" data-toggle="dropdown">
<i class="fa fa-share-square-o"></i>
{{msg . "moreShare"}}
</div>
<ul class="dropdown-menu" role="menu">
<li><a href="#" class="btn-share tencent-weibo"><i class="fa fa-tencent-weibo"></i> {{msg . "tencentWeibo"}}</a></li>
<li><a href="#" class="btn-share qq"><i class="fa fa-qq"></i> {{msg . "qqZone"}}</a></li>
<li><a href="#" class="btn-share renren"><i class="fa fa-renren"></i> {{msg . "renren"}}</a></li>
</ul>
</div>
<!-- 举报 -->
{{if eq .locale "zh"}}
<div style="display: inline-block">
<a id="reportBtn"><i class="fa fa-flag-o"></i> {{msg . "report"}}</a>
</div>
{{end}}
</div>
<div class="voters clearfix" id="likers">
</div>
</div>
<script type="text/x-jsrender" id="tLikers">
[[for users]]
<a id="liker_[[:UserId]]" href="[[:~root.blogUrl]]/[[:Username]]" target="_blank" class="voter">
[[if Logo]]
<img alt="avatar" class="avatar-small" src="[[:Logo]]">
[[else]]
<img alt="avatar" class="avatar-small" src="/images/blog/default_avatar.png">
[[/if]]
</a>
[[/for]]
</script>
{{if and .userBlog.CanComment (not (eq .userBlog.CommentType "disqus"))}}
<script type="text/x-jsrender" id="tComments">
[[for comments]]
<li class="comment-item">
<!-- 头像 -->
<a ui-hovercard="" target="_blank" class="avatar-link" title="[[:UserInfo.Username]]" href="[[:~root.blogUrl]]/[[:UserInfo.Username]]">
<img class="avatar" src="[[:UserInfo.Logo]]">
</a>
<!-- 评论 -->
<div class="comment-body">
<div class="comment-hd">
<a href="[[:~root.blogUrl]]/[[:UserInfo.Username]]" target="_blank" >[[:UserInfo.Username]]</a>
[[if IsAuthorComment]]
<span>({{msg . "author"}})</span>
[[/if]]
<!-- 回复其它人 -->
[[if ToUserInfo]]
<span class="in-reply-to">
{{rawMsg . "reply"}}
<a href="[[:~root.blogUrl]]/[[:ToUserInfo.Username]]">[[:ToUserInfo.Username]]</a>
</span>
[[if ToUserIsAuthor]]
<span>({{msg . "author"}})</span>
[[/if]]
[[/if]]
</div>
<div class="comment-content ng-binding" ng-bind-html="comment.content">
[[html:Content]]
</div>
<div class="comment-ft clearfix" data-comment-id="[[:CommentId]]" >
<span title="" ui-time="" class="date">[[:PublishDate]] </span>
<span class="like-num [[if !LikeNum]]hide[[/if]]" title="[[:LikeNum]] {{rawMsg . "like"}}"><span class="like-num-i">[[:LikeNum]]</span> {{rawMsg . "like"}}</span></span>
[[if ~root.visitUserInfo.UserId]]
[[if IsMyNote && !IsMyComment]]
<a href="javascript:;" class="comment-trash op-link "><i class="fa fa-trash"></i> {{rawMsg . "delete"}}</a>
[[/if]]
[[if !IsMyComment]]
<a href="javascript:;" class="comment-reply op-link ">
<i class="fa fa-reply"></i>
{{rawMsg . "reply"}}
</a>
<a href="javascript:;" class="comment-like op-link"><i class="fa fa-thumbs-o-up"></i> <span class="like-text">[[if IsILikeIt]]{{rawMsg . "unlike"}}[[else]]{{rawMsg . "like"}}[[/if]]</span></a>
{{if eq .locale "zh"}}
<a href="javascript:;" class="comment-report op-link "><i class="fa fa-flag-o"></i> {{rawMsg . "report"}}</a>
{{end}}
[[else]]
<a href="javascript:;" class="comment-trash op-link "><i class="fa fa-trash"></i> {{rawMsg . "delete"}}</a>
[[/if]]
[[/if]]
</div>
<!-- 回复该评论 -->
[[if ~root.visitUserInfo.UserId]]
<form class="comment-form comment-box-ft">
<div class="clearfix">
<div class="avatar-wrap">
<img class="avatar" src="[[:~root.visitUserInfo.Logo]]">
</div>
<div class="editor-wrap">
<textarea class="editable" id="commentContent" name="commentContent" placeholder="{{rawMsg . "reply"}}"></textarea>
</div>
</div>
<div class="command clearfix" style="display: block;">
<button class="reply-comment-btn save btn btn-primary" data-comment-id="[[:CommentId]]">{{rawMsg . "comment"}}</button>
<a class="cancel reply-cancel btn-link">{{rawMsg . "cancel"}}</a>
</div>
</form>
[[/if]]
</div>
</li>
[[/for]]
</script>
<!-- 评论 -->
<div class="comment-box hide">
{{if .visitUserInfo.UserId}}
<form class="comment-form comment-box-ft" id="commentForm">
<div class="clearfix">
<div class="avatar-wrap">
<img class="avatar" src="{{.visitUserInfo.Logo}}">
</div>
<div class="editor-wrap">
<textarea class="editable" id="commentContent" name="commentContent" placeholder="{{msg . "comment"}}" style="height: 100px;"></textarea>
</div>
</div>
<div class="command clearfix" style="display: block;">
<button id="commentBtn" class="reply-comment-btn save btn btn-primary">{{msg . "comment"}}</button>
</div>
</form>
{{else}}
<div class="needLogin">
<a onclick="goLogin()">{{msg . "signIn"}}</a>, {{msg . "submitComment"}}.
<br />
没有帐号? <a onclick="goRegister()">{{msg . "signUp"}}</a>
</div>
{{end}}
<div class="box-header">
<span class="counter">
<i class="icon icon-comment"></i><span id="commentNum">{{.blog.CommentNum}}</span> {{msg . "comments"}}
</span>
</div>
<ul id="comments">
</ul>
</div>
<div id="moreComments">
<div class="hide comments-more">
<a>More...</a>
</div>
<div class="comments-loading">
<img src="/images/loading-32.gif" />
</div>
</div>
{{if eq .locale "zh"}}
<div id="reportMsg" class="hide">
<form class="report-form" name="reportForm">
<ul class="options clearfix">
<li><label><input required="" value="{{msg . "reportReason1"}}" name="reason" type="radio">{{msg . "reportReason1"}}</label></li>
<li><label><input required="" value="{{msg . "reportReason2"}}" name="reason" type="radio">{{msg . "reportReason2"}}</label></li>
<li><label><input required="" value="{{msg . "reportReason3"}}" name="reason" type="radio">{{msg . "reportReason3"}}</label></li>
<li><label><input required="" value="{{msg . "reportReason4"}}" name="reason" type="radio">{{msg . "reportReason4"}}</label></li>
<li><label><input required="" value="" name="reason" type="radio">{{msg . "other"}}</label></li>
</ul>
<p class="input-container" style="display: none">
<input placeholder="{{msg . "reportReason"}}" type="text" name="detail" class="form-control reason-text basic-input" />
</p>
<p class="footnote"></p>
</form>
</div>
{{end}}
{{end}}
{{if and .userBlog.CanComment (eq .userBlog.CommentType "disqus")}}
<div id="disqus_thread"></div>
<!-- comment -->
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
var disqus_shortname = '{{.userBlog.DisqusId}}'; // required: replace example with your forum shortname
var disqus_identifier = '{{.userBlog.UserId.Hex}}/{{.blog.NoteId.Hex}}/{{.blog.Title}}'; // 博客链接
/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
<a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
{{end}}

View File

@ -1,56 +0,0 @@
<div id="footerContainer">
{{$userId := .userBlog.UserId.Hex}}
<div class="container" id="footer">
<div class="col-md-4">
<h3>{{msg . "blogNavs"}}</h3>
<ul>
<li><a href="{{$.blogUrl}}/{{$.userInfo.Username}}">{{msg . "home"}}</a></li>
{{range .notebooks}}
<li>
<a href="{{$.cateUrl}}/{{.NotebookId.Hex}}">{{.Title}}</a>
</li>
{{end}}
<li><a href="{{$.aboutMeUrl}}">{{msg . "aboutMe"}}</a></li>
</ul>
</div>
<div class="col-md-4">
<h3>{{msg . "latestPosts"}}</h3>
<ul>
{{range .recentBlogs}}
<li title="{{.Title}}"><a href="{{$.blogUrl}}/view/{{.NoteId.Hex}}/">{{.Title}}</a></li>
{{end}}
</ul>
</div>
<div class="col-md-4">
<h3>{{msg . "quickLinks"}}</h3>
<ul>
<li><a href="{{$.noteUrl}}">{{msg . "myNote"}}</a></li>
<li><a href="{{$.siteUrl}}/login">leanote {{msg . "login"}}</a></li>
<li><a href="http://leanote.com" target="_blank">leanote {{msg . "home"}}</a></li>
<li><a href="http://lea.leanote.com" target="_blank">lea++</a></li>
<li><a href="http://bbs.leanote.com" target="_blank">leanote {{msg . "community"}}</a></li>
<li><a href="https://github.com/leanote/leanote" target="_blank">leanote github</a></li>
</ul>
</div>
</div>
</div>
<script src="{{$.siteUrl}}/js/jquery-1.9.0.min.js"></script>
<script src="{{$.siteUrl}}/js/bootstrap-min.js"></script>
<script src="{{$.siteUrl}}/js/bootstrap-hover-dropdown.js"></script>
<script src="{{$.siteUrl}}/js/i18n/blog.{{.locale}}.js"></script>
{{if not .isMe}}
<script src="{{$.siteUrl}}/blog/isMe.js?userId={{.userBlog.UserId.Hex}}"></script>
{{end}}
<script>
// 搜索
function search(e) {
var key = $("#searchInput").val();
if(!key) {
location.href = "{{$.searchUrl}}";
} else {
var tpl = '<form action="{{$.searchUrl}}" method="get">';
tpl += '<input name="key" value="' + key + '" />';
tpl += "</form";
$(tpl).submit();
}
}

View File

@ -1,104 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<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">
<meta name="description" content="leanote, {{msg $ "moto"}}">
<meta name="author" content="leanote">
<title>{{.title}}</title>
<!-- Bootstrap core CSS -->
<link href="{{.siteUrl}}/css/bootstrap.css" rel="stylesheet">
<!-- 字体必须同一域 -->
{{if .set}}
<link href="{{.siteUrl}}/css/font-awesome-4.2.0/css/font-awesome.css" rel="stylesheet">
{{else}}
<link href="{{$.staticUrl}}/css/font-awesome-4.2.0/css/font-awesome.css" rel="stylesheet">
{{end}}
<link id="styleLink" href="{{.siteUrl}}/css/blog/{{if .userBlog.Style}}{{.userBlog.Style}}{{else}}blog_default{{end}}.css" rel="stylesheet">
<link href="{{.siteUrl}}/css/blog/comment.css" rel="stylesheet">
<script>
function log(o) {
}
</script>
<style>
</style>
</head>
<body>
<div id="headerAndNav" >
<div id="headerContainer" class="container">
<!-- 头部可放博客名, 导航 -->
<div id="header">
{{$userId := .userBlog.UserId.Hex}} <!-- 可不要了 -->
{{$username := .userInfo.Username}}
<h1>
<a href="{{.indexUrl}}" id="logo">
{{if .userBlog.Logo}}
<img src="{{.userBlog.Logo}}" title="{{.userBlog.Title}}"/>
{{else}}
{{.userBlog.Title | raw}}
{{end}}
</a>
</h1>
<div id="blogDesc">
{{.userBlog.SubTitle | raw}}
</div>
</div>
</div>
<!-- Static navbar -->
<div class="navbar navbar-default">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="{{.indexUrl}}">
{{if .userBlog.Logo}}
<img src="{{.userBlog.Logo}}" title="{{.userBlog.Title}}"/>
{{else}}
{{.userBlog.Title | raw}}
{{end}}
</a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
{{$navNotebookId := .notebookId}}
<li class="{{if .index}}active{{end}}"><a href="{{.indexUrl}}">{{msg . "home"}}</a></li>
{{range .notebooks}}
{{$notebookId := .NotebookId.Hex}}
<li class="{{if $navNotebookId}}{{if eq $navNotebookId $notebookId}}active{{else}}{{end}}{{end}}">
<a href="{{$.cateUrl}}/{{$notebookId}}"
>{{.Title}}</a>
</li>
{{end}}
<li class="{{if .aboutMe}}active{{end}}"><a href="{{.aboutMeUrl}}">{{msg . "aboutMe"}}</a></li>
<!-- 同源上传logo -->
<li class="is-me {{if .set}}active{{end}} {{if not .isMe}}hide{{end}}" ><a href="{{$.siteUrl}}/blog/set/">{{msg . "blogSet"}}</a></li>
<li><a href="{{$.noteUrl}}" class="is-me {{if not .isMe}}hide{{end}}">{{msg . "myNote"}}</a></li>
</ul>
<form class="navbar-form navbar-right" id="search" onsubmit="search(event);return false;">
<div class="input-group">
<span class="input-group-addon" id="searchIcon" onclick="search(event);"><i class="fa fa-search"></i></span>
<input type="text" placeholder="search" id="searchInput" class="form-control" value="{{.key}}">
</div>
</form>
</div><!--/.nav-collapse -->
</div>
</div>
</div>
<script>
var UserInfo = {UserId: "{{$userId}}", Email: "{{.userInfo.Email}}", Username: "{{.userInfo.Username}}"};
var UserBlogInfo={CanComment: {{.userBlog.CanComment}}, CommentType: "{{.userBlog.CommentType}}"};
var indexUrl = "{{$.indexUrl}}";
var viewUrl = "{{$.viewUrl}}";
var blogUrl = "{{$.blogUrl}}";
var staticUrl = "{{$.staticUrl}}"; // blog.leanote.com, life.leanote.com, aaa.com
</script>

View File

@ -1,73 +0,0 @@
<!-- This file is Depreciated -->
<link href="/public/mdeditor/editor/google-code-prettify/prettify.css" type="text/css" rel="stylesheet">
<script src="/public/mdeditor/editor/google-code-prettify/prettify.js"></script>
<script>
$("pre").addClass("prettyprint linenums");
prettyPrint();
</script>
<!--
<script type="text/javascript" src="/js/syntaxhighlighter/scripts/shCore.js"></script>
<link href="/js/syntaxhighlighter/styles/shCore.css" rel="stylesheet" type="text/css" />
<link href="/js/syntaxhighlighter/styles/shThemeDefault.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
    $(function () {
var pathPrefix = "/js/syntaxhighlighter/scripts/";
        var map = {
"brush: jscript": "shBrushJScript.js",
         "brush: c#": "shBrushCSharp.js",
        "brush: css": "shBrushCss.js",
        "brush: cpp": "shBrushCpp.js",
        "brush: java": "shBrushJava.js",
        "brush: xml": "shBrushXml.js",
        "brush: php": "shBrushPhp.js",
        "brush: perl": "shBrushPerl.js",
        "brush: python": "shBrushPython.js",
        "brush: ruby": "shBrushRuby.js",
        "brush: sql": "shBrushSql.js"}
        var needLoadCount = 0;
        var alreadyLoadCount = 0;
$('pre[class]').each(function() {
var brush = $(this).attr("class");
var js = map[brush]
if (js) {
                needLoadCount++;
map[brush] = null; // 不要重复加载
loadJS(pathPrefix + js, function () {
                    alreadyLoadCount++;
                    if (alreadyLoadCount == needLoadCount) {
//setTimeout(function() {
                        SyntaxHighlighter.highlight();
//}, 500);
                    }
                });
}
});
    });
function loadJS(url, callback) {
$.getScript(url, function() {
callback();
});
}
 
/*
function loadJS(url, callback, charset) {
    var script = document.createElement('script');
    script.onload = script.onreadystatechange = function () {
        if (script && script.readyState && /^(?!(?:loaded|complete)$)/.test(script.readyState)) return;
        script.onload = script.onreadystatechange = null;
        script.src = '';
        script.parentNode.removeChild(script);
        script = null;
        if (callback) callback();
    };
    script.charset = charset || document.charset || document.characterSet;
    script.src = url;
    try { document.getElementsByTagName("head")[0].appendChild(script); } catch (e) { }
}
*/
</script>
-->

View File

@ -1,50 +0,0 @@
{{template "blog/header.html" .}}
<div id="postsContainer">
<div class="container">
{{if .notebookId}}
<h2>{{msg . "blogClass"}} - {{.notebook.Title}}</h2>
{{end}}
</div>
<div id="posts">
{{$G := .}}
{{range .blogs}}
<div class="each-post">
<div class="title">
<a href="{{$.viewUrl}}/{{.NoteId.Hex}}" title="{{msg $ "fullBlog"}}">
{{.Title}}
</a>
</div>
<div class="created-time">
<i class="fa fa-bookmark-o"></i>
{{if .Tags}}
{{blogTags $ .Tags}}
{{else}}
{{msg $ "noTag"}}
{{end}}
|
<i class="fa fa-calendar"></i> {{msg $ "updatedTime"}} {{.UpdatedTime | datetime}} |
<i class="fa fa-calendar"></i> {{msg $ "createdTime"}} {{.CreatedTime | datetime}}
</div>
<div class="desc">
{{.Content | raw}}
</div>
<a class="more" href="{{$.viewUrl}}/{{.NoteId.Hex}}" title="{{msg $ "fullBlog"}}">{{msg $ "more"}}.</a>
</div>
{{end}}
<!-- 分页 -->
<ul class="pager">
{{if .notebookId}}
{{set $ "pageUrl" (concatStr $.cateUrl "/" .notebookId)}}
{{else}}
{{set $ "pageUrl" $.indexUrl}}
{{end}}
{{page $.pageUrl .page .pageSize .count}}
</ul>
</div>
</div>
{{template "blog/footer.html" .}}
{{template "blog/highlight.html"}}
</body>
</html>

View File

@ -1,45 +0,0 @@
{{template "blog/header.html" .}}
<div id="postsContainer">
<div class="container">
<h2>{{msg . "search"}} - {{.key}} </h2>
</div>
<div id="posts">
{{range .blogs}}
<div class="each-post">
<div class="title">
<a href="{{$.viewUrl}}/{{.NoteId.Hex}}" title="{{msg $ "fullBlog"}}">
{{.Title}}
</a>
</div>
<div class="created-time">
<i class="fa fa-bookmark-o"></i>
{{if .Tags}}
{{blogTags $ .Tags}}
{{else}}
{{msg $ "noTag"}}
{{end}}
|
<i class="fa fa-calendar"></i> {{msg $ "updatedTime"}} {{.UpdatedTime | datetime}} |
<i class="fa fa-calendar"></i> {{msg $ "createdTime"}} {{.CreatedTime | datetime}}
</div>
<div class="desc">
{{.Content | raw}}
</div>
<a class="more" href="{{$.viewUrl}}/{{.NoteId.Hex}}" title="{{msg $ "fullBlog"}}">{{msg $ "more"}}</a>
</div>
{{end}}
{{if not .blogs }}
<div class="each-post">
{{msg . "none"}}
</div>
{{end}}
</div>
</div>
{{template "blog/footer.html" .}}
{{template "blog/highlight.html"}}
</body>
</html>

View File

@ -1,323 +0,0 @@
{{template "blog/header.html" .}}
<!-- set页面不是自定义域名和二级域名页 -->
<link rel="stylesheet" href="{{.siteUrl}}/tinymce/skins/custom/skin.min.css" type="text/css">
<style>
.tab-pane {
padding-top: 10px;
}
</style>
<div id="postsContainer">
<div id="posts">
<ul id="myTab" class="nav nav-tabs">
<li class="active"><a href="#baseInfo" data-toggle="tab">{{msg . "baseInfoSet"}}</a></li>
<li class=""><a href="#commentInfo" data-toggle="tab">{{msg . "commentSet"}}</a></li>
<li class=""><a href="#styleInfo" data-toggle="tab">{{msg . "themeSet"}}</a></li>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<div class="tab-pane" id="styleInfo">
<form class="form-horizontal" role="form">
<div class="form-group">
<label class="col-sm-2 control-label"></label>
<div class="col-sm-10">
<div class="alert alert-success" id="styleMsg" style="display: none; margin-bottom: 3px;"></div>
</div>
</div>
<div class="form-group">
<label for="Style" class="col-sm-2 control-label">{{msg . "theme"}}</label>
<div class="col-sm-10" style="margin-top: 6px;" id="themeList">
<label>
<img class="preview" src="{{$.siteUrl}}/images/blog/theme/default.png" />
<input type="radio" name="Style"
value="blog_default"
{{if not .userBlog.Style}}
checked="checked"
{{else}}
{{if eq .userBlog.Style "blog_default"}}
checked="checked"
{{end}}
{{end}}>
{{msg . "default"}}
</label>
<label>
<img class="preview" src="{{$.siteUrl}}/images/blog/theme/elegent.png" />
<input type="radio" name="Style"
value="blog_daqi"
{{if eq .userBlog.Style "blog_daqi"}}checked="checked"{{end}}>
{{msg . "elegant"}}
</label>
<label>
<img class="preview" src="{{$.siteUrl}}/images/blog/theme/left_nav_fix.png" />
<input type="radio" name="Style"
value="blog_left_fixed"
{{if eq .userBlog.Style "blog_left_fixed"}}checked="checked"{{end}}>
{{msg . "navFixed"}}
</label>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button class="btn btn-success">{{msg . "save"}}</button>
<span class="msg"></span>
</div>
</div>
</form>
</div>
<div class="tab-pane" id="commentInfo">
<form class="form-horizontal" role="form">
<div class="form-group">
<label class="col-sm-2 control-label"></label>
<div class="col-sm-10">
<div class="alert alert-success" id="commentMsg" style="display: none; margin-bottom: 3px;"></div>
</div>
</div>
<div class="form-group">
<label for="subTitle" class="col-sm-2 control-label">{{msg . "chooseComment"}}</label>
<div class="col-sm-10">
<label>
<input type="checkbox" id="CanComment" name="CanComment"
{{if .userBlog.CanComment}}checked="checked"{{end}} > {{msg . "openComment"}}
</label>
<br />
<div id="commentSet" {{if not .userBlog.CanComment}}style="display: none"{{end}}>
<label>
<input type="radio"
name="commentType"
value="default"
{{if or (not .userBlog.CommentType) (eq .userBlog.CommentType "default")}}checked="checked"{{end}} > Default
</label>
<label>
<input type="radio" name="commentType" id="disqus"
value="disqus"
{{if eq .userBlog.CommentType "disqus"}}checked="checked"{{end}} > Disqus
</label>
<div id="disqusSet" {{if not (eq .userBlog.CommentType "disqus")}}style="display: none"{{end}}>
<label for="DisqusId">Disqus Id</label> <input type="text"
class="form-control" style="display: inline; width: 50%"
id="DisqusId" name="DisqusId"
value="{{if .userBlog.DisqusId}}{{.userBlog.DisqusId}}{{else}}leanote{{end}}">
<br />
{{msg . "disqusHelp"}}
<a target="_blank" href="http://leanote.com/blog/view/52db8463e01c530ef8000001">{{msg . "needHelp"}}</a>
</div>
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button class="btn btn-success">{{msg . "save"}}</button>
<span class="msg"></span>
</div>
</div>
</form>
</div>
<div class="tab-pane active" id="baseInfo">
<div class="form-horizontal" role="form" id="userBlogForm">
<div class="form-group">
<label class="col-sm-2 control-label"></label>
<div class="col-sm-10">
<div class="alert alert-success" id="msg"
style="display: none; margin-bottom: 3px;"></div>
</div>
</div>
<div class="form-group">
<label for="title" class="col-sm-2 control-label">{{msg . "blogName"}}</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="Title" name="Title"
placeholder="eg: leanote's blog"
value="{{if .userBlog.Title}}{{.userBlog.Title}}{{else}}{{.userInfo.Email}} 's blog{{end}}">
</div>
</div>
<div class="form-group">
<label for="logo" class="col-sm-2 control-label">{{msg . "blogLogo"}}</label>
<div class="col-sm-10">
<input type="hidden" name="Logo" id="Logo"
value="{{.userBlog.Logo}}" />
<form id="formLogo" action="{{$.siteUrl}}/file/uploadBlogLogo" method="post"
enctype="multipart/form-data" target="logoTarget"
onsubmit="inProgress()">
<input type="file" class="form-control" id="logo2" name="file"
onChange='$("#formLogo").submit();' />
{{msg . "blogLogoTips"}}
<div id="logoImg"
{{if .userBlog.Logo }}
{{else}}
style="display: none"{{end}}
>
<img src="{{.userBlog.Logo}}" style="height: 40px" /> <a
href="#" id="deleteLogo">{{msg . "delete"}}</a>
</div>
</form>
<iframe id="logoTarget" name="logoTarget" src="#"
style="display: none"></iframe>
</div>
</div>
<div class="form-group">
<label for="subTitle" class="col-sm-2 control-label">{{msg . "blogDesc"}}</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="SubTitle"
name="SubTitle" value="{{.userBlog.SubTitle}}"
placeholder="eg: leanote, Not Just A Notebook">
</div>
</div>
<div class="form-group">
<label for="aboutMe" class="col-sm-2 control-label"></label>
<div class="col-sm-10">
<div id="popularToolbar"></div>
</div>
</div>
<div class="form-group">
<label for="aboutMe" class="col-sm-2 control-label">{{msg . "aboutMe"}}</label>
<div class="col-sm-10">
<textarea id="AboutMe" name="AboutMe">{{.userBlog.AboutMe}}</textarea>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button class="btn btn-success">{{msg . "save"}}</button>
<span class="msg"></span>
</div>
</div>
</div>
</div>
</div>
</div>
{{template "blog/footer.html" .}}
<script src="{{.siteUrl}}/js/common-min.js"></script>
<script type="text/javascript" src="{{.siteUrl}}/tinymce/tinymce.min.js"></script>
<script>
var urlPrefix = "{{.siteUrl}}";
$(function() {
tinymce.init({
selector : "#AboutMe",
content_css : [ "/css/bootstrap.css", "/css/editor/editor.css" ],
skin : "custom",
language : "{{.locale}}",
height : 300,
width : "100%",
skin : "custom",
plugins : [
"advlist autolink link leanote_image lists charmap hr ",
"searchreplace visualblocks visualchars leanote_code tabfocus",
"table contextmenu directionality textcolor paste fullpage textcolor"],
toolbar1 : "formatselect |fontselect fontsizeselect| forecolor backcolor | bold italic underline strikethrough | bullist numlist |",
menubar : false,
toolbar_items_size : 'small',
statusbar : false,
font_formats : "Arial=arial,helvetica,sans-serif;"
+ "Arial Black=arial black,avant garde;"
+ "Times New Roman=times new roman,times;"
+ "Courier New=courier new,courier;"
+ "Tahoma=tahoma,arial,helvetica,sans-serif;"
+ "Verdana=verdana,geneva;" + "宋体=SimSun;"
+ "新宋体=NSimSun;" + "黑体=SimHei;"
+ "微软雅黑=Microsoft YaHei",
block_formats : "Header 1=h1;Header 2=h2;Header 3=h3; Header 4=h4;Pre=pre;Paragraph=p"
});
$("#deleteLogo").click(function() {
$("#Logo").val("");
$("#logoImg").hide();
});
$("#CanComment").click(function() {
if ($(this).is(":checked")) {
$("#commentSet").show();
} else {
$("#commentSet").hide();
}
});
$("input[name='commentType']").click(function() {
if ($("input[name='commentType']:checked").val() == "disqus") {
$("#disqusSet").show();
} else {
$("#disqusSet").hide();
}
});
// 基本设置
$("#baseInfo .btn-success").click(function() {
var data = {
Title : $("#Title").val(),
SubTitle : $("#SubTitle").val(),
Logo : $("#Logo").val(),
AboutMe : getEditorContent()
}
post("/blog/setUserBlogBase", data, function(ret) {
showMsg2($("#baseInfo .msg"), "{{msg . "saveSuccess"}}", 2000);
$("#blogDesc").html(data.SubTitle);
$("#logo").html(data.Title);
if(data.Logo) {
$("#logo").html(t('<img src="?" />', urlPrefix + "/" + data.Logo));
}
}, this);
});
// 评论
$("#commentInfo .btn-success").click(function(e) {
e.preventDefault();
var data = {
CanComment : $("#CanComment").is(":checked"),
CommentType: $("input[name='commentType']:checked").val(),
DisqusId : $("#DisqusId").val(),
}
post("/blog/setUserBlogComment", data, function(ret) {
showMsg2($("#commentInfo .msg"), "{{msg . "saveSuccess"}}", 2000);
}, this);
});
// 主题
$("#styleInfo .btn-success").click(function(e) {
e.preventDefault();
var data = {
Style : $("input[name='Style']:checked").val()
}
post("/blog/setUserBlogStyle", data, function(ret) {
showMsg2($("#styleInfo .msg"), "{{msg . "saveSuccess"}}", 2000);
}, this);
});
$("input[name='Style']").click(function() {
$("#styleLink").attr("href", "/css/blog/" + $(this).val() + ".css");
});
});
function inProgress() {
}
// filename, result, resultCode
function uploadFinish(ret) {
if (ret) {
if (ret.resultCode == '1') {
$("#logoImg img").attr("src", urlPrefix + "/" + ret.filename).parent().show();
$("#Logo").val(ret.filename);
return;
}
alert(ret.result);
return;
}
// 上传出错
alert("上传出错");
}
</script>
</div>
</body>
</html>

View File

@ -1,125 +0,0 @@
{{template "blog/header.html" .}}
<div id="postsContainer">
<div id="posts">
<div class="each-post">
<div class="title">
{{.blog.Title}}
</div>
<div class="created-time">
<i class="fa fa-bookmark-o"></i>
{{if .blog.Tags}}
{{blogTags $ .blog.Tags}}
{{else}}
{{msg . "noTag"}}
{{end}}
|
<i class="fa fa-calendar"></i> {{msg . "updatedTime"}} {{.blog.UpdatedTime | datetime}} |
<i class="fa fa-calendar"></i> {{msg . "createdTime"}} {{.blog.CreatedTime | datetime}}
</div>
<div class="mobile-created-time">
{{ if .userInfo.Logo}}
<img src="{{.userInfo.Logo}}" id="userLogo">
{{else}}
<img src="{{$.siteUrl}}/images/blog/default_avatar.png" id="userLogo">
{{end}}
{{.userInfo.Username}}
{{if .blog.Tags}}
&nbsp;
<i class="fa fa-bookmark-o" style="color: #666"></i>
{{blogTags $ .blog.Tags}}
{{end}}
</div>
<div class="desc" id="content">
{{if .blog.IsMarkdown }}
<div id="markdownContent" style="display: none">
<!-- 用textarea装html, 防止得到的值失真 -->
<textarea>
{{.blog.Content | raw}}
</textarea>
</div>
<div style="padding: 20px; text-align: center">
<img src="/images/loading-32.gif" />
</div>
{{else}}
{{.blog.Content | raw}}
{{end}}
<div id="desc" class="hide">{{.blog.Desc}}</div>
</div>
<!-- comment -->
{{template "blog/comment.html" .}}
</div>
</div>
</div>
{{template "blog/footer.html" .}}
{{template "blog/highlight.html"}}
<div id="blogNav">
<div id="blogNavNav">
<i class="fa fa-align-justify" title="文档导航"></i>
<span>{{msg . "blogNav"}}</span>
</div>
<div id="blogNavContent">
</div>
</div>
<script>
var visitUserInfo = eval("(" + {{.visitUserInfoJson}} + ")");
var urlPrefix = "{{.siteUrl}}";
var noteId = "{{.blog.NoteId.Hex}}";
var preLikeNum = +"{{.blog.LikeNum}}";
var commentNum = +"{{.blog.CommentNum}}";
</script>
<script src="/js/app/blog/common.js"></script>
<script src="/js/jsrender.js"></script>
<script src="/js/jquery-cookie-min.js"></script>
<script src="/js/bootstrap-dialog.min.js"></script>
<script src="/js/jquery.qrcode.min.js"></script>
<script src="/js/app/blog/view.js"></script>
{{if .blog.IsMarkdown }}
<script src="/public/mdeditor/editor/pagedown/Markdown.Converter.js"></script>
<script src="/public/mdeditor/editor/pagedown/Markdown.Sanitizer.js"></script>
<script src="/public/mdeditor/editor/pagedown/Markdown.Editor.js"></script>
<script src="/public/mdeditor/editor/pagedown/local/Markdown.local.zh.js"></script>
<script src="/public/mdeditor/editor/Markdown.Extra.js"></script>
<!--mathjax-->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [['$','$'], ["\\(","\\)"]], processEscapes: true }, messageStyle: "none"});
</script>
<script src="/public/mdeditor/editor/mathJax.js"></script>
<script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script>
var content = $.trim($("#markdownContent textarea").val());
// $("#markdownContent").html("");
var converter = Markdown.getSanitizingConverter();
Markdown.Extra.init(converter, {extensions: ["tables", "fenced_code_gfm", "def_list"]});
var html = converter.makeHtml(content);
$("#content").html(html);
$("pre").addClass("prettyprint linenums");
prettyPrint();
MathJax.Hub.Queue(["Typeset",MathJax.Hub,"wmd-preview"]);
initNav();
weixin();
</script>
{{else}}
<script>
$(function() {
initNav();
weixin();
});
</script>
{{end}}
<!--google+
<script type="text/javascript" src="https://apis.google.com/js/plusone.js"> {lang: 'zh-CN'} </script>
-->
</body>
</html>

View File

@ -50,12 +50,12 @@ table tr:nth-child(2n) {
{{ if .userBlog.Logo}}
<img src="{{.userBlog.Logo}}" id="logo">
{{else}}
<img src="{{$.siteUrl}}/images/blog/default_avatar.png" id="logo">
<img src="/images/blog/default_avatar.png" id="logo">
{{end}}
{{.userInfo.Username}}
-->
{{if .blog.Tags}}
<img src="{{$.siteUrl}}/images/blog/tag.png" id="tag">
<img src="/images/blog/tag.png" id="tag">
{{blogTagsForExport $ .blog.Tags}}
{{end}}
</div>
@ -79,7 +79,7 @@ table tr:nth-child(2n) {
<!--
<div id="footer">
<p class="split"></p>
<a href="http://leanote.com"><img src="{{.siteUrl}}/images/logo/leanote_icon_blue.png" id="leanote_logo"/></a>
<a href="http://leanote.com"><img src="/images/logo/leanote_icon_blue.png" id="leanote_logo"/></a>
<p>
<a href="http://leanote.com">Leanote</a>
<br />
@ -88,10 +88,10 @@ table tr:nth-child(2n) {
</div>
-->
<script src="{{.siteUrl}}/js/jquery-1.9.0.min.js"></script>
<script src="/js/jquery-1.9.0.min.js"></script>
<link href="{{.siteUrl}}/public/js/google-code-prettify/prettify.css" type="text/css" rel="stylesheet">
<script src="{{.siteUrl}}/public/js/google-code-prettify/prettify.js"></script>
<link href="/public/js/google-code-prettify/prettify.css" type="text/css" rel="stylesheet">
<script src="/public/js/google-code-prettify/prettify.js"></script>
<script>
function ok() {

View File

@ -44,7 +44,7 @@
<a class="btn btn-default btn-sm btn-export"><span class="fa fa-download"></span> {{msg $ "export"}}</a>
<!-- 必须是自己的主题 -->
{{if .activeTheme.ThemeId}}
<a class="btn btn-default btn-sm" href="{{$.siteUrl}}/preview?themeId={{.activeTheme.ThemeId.Hex}}" target="_blank"><span class="fa fa-eye"></span> {{msg $ "preview"}}</a>
<a class="btn btn-default btn-sm" href="/preview?themeId={{.activeTheme.ThemeId.Hex}}" target="_blank"><span class="fa fa-eye"></span> {{msg $ "preview"}}</a>
{{end}}
<a class="btn btn-primary btn-sm" target="_blank" href="/member/blog/updateTheme?themeId={{if .activeTheme.ThemeId}}{{.activeTheme.ThemeId.Hex}}{{end}}"><span class="fa fa-pencil"></span> {{msg $ "edit"}}</a>
</div>
@ -84,7 +84,7 @@
<div class="btn-group" data-id="{{.ThemeId.Hex}}">
<a class="btn btn-default btn-sm btn-delete" data-loading-text="..."><span class="fa fa-remove"></span> {{msg $ "delete"}}</a>
<a class="btn btn-default btn-sm btn-export"><span class="fa fa-download"></span> {{msg $ "export"}}</a>
<a class="btn btn-default btn-sm" href="{{$.siteUrl}}/preview?themeId={{.ThemeId.Hex}}" target="_blank"><span class="fa fa-eye"></span> {{msg $ "preview"}}</a>
<a class="btn btn-default btn-sm" href="/preview?themeId={{.ThemeId.Hex}}" target="_blank"><span class="fa fa-eye"></span> {{msg $ "preview"}}</a>
<a class="btn btn-default btn-sm" target="_blank" href="/member/blog/updateTheme?themeId={{.ThemeId.Hex}}"><span class="fa fa-pencil"></span> {{msg $ "edit"}}</a>
<a class="btn btn-primary btn-sm btn-active" data-loading-text="..."><span class="fa fa-check"></span> {{msg $ "use"}}</a>
{{if $.isAdmin}}

View File

@ -8,7 +8,7 @@
-
{{.theme.Name}}
{{end}}
<a class="btn btn-default" href="{{$.siteUrl}}/preview?themeId={{.themeId}}" target="_blank"><span class="fa fa-eye"></span> {{msg . "preview"}}</a>
<a class="btn btn-default" href="/preview?themeId={{.themeId}}" target="_blank"><span class="fa fa-eye"></span> {{msg . "preview"}}</a>
<small>

View File

@ -86,6 +86,9 @@ h2,
h3 {
font-family: 'Open Sans', '微软雅黑', Arial, Tahoma, sans-serif;
}
.navbar-brand {
height: 45px;
}
.logo-ctn {
display: block;
}

View File

@ -56,7 +56,9 @@ html,body {
h1, h2, h3 {
font-family: @fontFamily;
}
.navbar-brand {
height: 45px;
}
.logo-ctn {
display: block;
#logo {