v1.0 beta init

This commit is contained in:
life committed 2014-10-22 16:20:45 +08:00
1 parent 8ae438272b
commit 593d2c2965
225 files changed
+27217 -3675

No files matched your search

+1 -3
View File
@@ -10,10 +10,8 @@
</div>
<div class="desc">
{{.userBlog.AboutMe | raw}}
</div>
<!-- comment -->
{{template "blog/comment.html" .}}
</div>
</div>
</div>
+187 -1
View File
@@ -1,4 +1,190 @@
{{if .userBlog.CanComment}}
<!-- 赞 -->
<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">
+18 -24
View File
@@ -4,57 +4,51 @@
<div class="col-md-4">
<h3>{{msg . "blogNavs"}}</h3>
<ul>
<li><a href="/blog/{{$userId}}">{{msg . "home"}}</a></li>
<li><a href="{{$.blogUrl}}/{{$.userInfo.Username}}">{{msg . "home"}}</a></li>
{{range .notebooks}}
<li>
<a href="/blog/{{$userId}}/{{.NotebookId.Hex}}">{{.Title}}</a>
<a href="{{$.cateUrl}}/{{.NotebookId.Hex}}">{{.Title}}</a>
</li>
{{end}}
<li><a href="/blog/aboutMe/{{$userId}}">{{msg . "aboutMe"}}</a></li>
<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="/blog/view/{{.NoteId.Hex}}/">{{.Title}}</a></li>
<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="/note">{{msg . "myNote"}}</a></li>
<li><a href="/login">{{msg . "login"}}</a></li>
<li><a href="http://leanote.com" target="_blank">leanote</a></li>
<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="/js/jquery-1.9.0.min.js"></script>
<script src="/js/bootstrap-min.js"></script>
<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() {
/*
$("#searchInput").click(function() {
$("#search").width("130px");
$("#searchInput").width("100px");
});
$("#searchInput").blur(function() {
$("#search").width(0);
$("#searchInput").width(0);
});
*/
});
// 搜索
function search(e) {
var key = $("#searchInput").val();
if(!key) {
location.href = "/blog/" + UserInfo.Username;
location.href = "{{$.searchUrl}}";
} else {
var tpl = '<form action="/blog/searchBlog/' + UserInfo.Username +'" method="get">';
var tpl = '<form action="{{$.searchUrl}}" method="get">';
tpl += '<input name="key" value="' + key + '" />';
tpl += "</form";
$(tpl).submit();
+29 -13
View File
@@ -10,10 +10,15 @@
<title>{{.title}}</title>
<!-- Bootstrap core CSS -->
<link href="/css/bootstrap.css" rel="stylesheet">
<link href="/css/font-awesome-4.0.3/css/font-awesome.css" rel="stylesheet">
<link id="styleLink" href="/css/blog/{{if .userBlog.Style}}{{.userBlog.Style}}{{else}}blog_default{{end}}.css" rel="stylesheet">
<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) {
}
@@ -30,7 +35,7 @@ function log(o) {
{{$userId := .userBlog.UserId.Hex}} <!-- 可不要了 -->
{{$username := .userInfo.Username}}
<h1>
<a href="/blog/{{$username}}" id="logo">
<a href="{{.indexUrl}}" id="logo">
{{if .userBlog.Logo}}
<img src="{{.userBlog.Logo}}" title="{{.userBlog.Title}}"/>
{{else}}
@@ -54,23 +59,29 @@ function log(o) {
<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="/blog/{{$username}}">{{msg . "home"}}</a></li>
<li class="{{if .index}}active{{end}}"><a href="{{.indexUrl}}">{{msg . "home"}}</a></li>
{{range .notebooks}}
{{$notebookId := .NotebookId.Hex}}
{{$notebookId := .NotebookId.Hex}}
<li class="{{if $navNotebookId}}{{if eq $navNotebookId $notebookId}}active{{else}}{{end}}{{end}}">
<a href="/blog/{{$username}}/{{$notebookId}}"
<a href="{{$.cateUrl}}/{{$notebookId}}"
>{{.Title}}</a>
</li>
{{end}}
<li class="{{if .aboutMe}}active{{end}}"><a href="/blog/aboutMe/{{$username}}">{{msg . "aboutMe"}}</a></li>
{{if .isMe}}
<li class="{{if .set}}active{{end}}"><a href="/blog/set">{{msg . "blogSet"}}</a></li>
<li><a href="/note" >{{msg . "myNote"}}</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">
@@ -85,4 +96,9 @@ function log(o) {
<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>
+14 -9
View File
@@ -3,7 +3,7 @@
<div id="postsContainer">
<div class="container">
{{if .notebookId}}
<h2>{{msg . "blogClass"}}: {{.notebook.Title}}</h2>
<h2>{{msg . "blogClass"}} - {{.notebook.Title}}</h2>
{{end}}
</div>
<div id="posts">
@@ -11,30 +11,35 @@
{{range .blogs}}
<div class="each-post">
<div class="title">
<a href="/blog/view/{{.NoteId.Hex}}" title="{{msg $G "fullBlog"}}">
<a href="{{$.viewUrl}}/{{.NoteId.Hex}}" title="{{msg $ "fullBlog"}}">
{{.Title}}
</a>
</div>
<div class="created-time">
<i class="fa fa-bookmark-o" style="color: #666"></i>
<i class="fa fa-bookmark-o"></i>
{{if .Tags}}
{{blogTags .Tags}}
{{blogTags $ .Tags}}
{{else}}
{{msg $G "noTag"}}
{{msg $ "noTag"}}
{{end}}
|
<i class="fa fa-calendar" style="color: #666"></i> {{msg $G "updatedTime"}} {{.UpdatedTime | datetime}} |
<i class="fa fa-calendar" style="color: #666"></i> {{msg $G "createdTime"}} {{.CreatedTime | datetime}}
<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="/blog/view/{{.NoteId.Hex}}" title="{{msg $G "fullBlog"}}">More...</a>
<a class="more" href="{{$.viewUrl}}/{{.NoteId.Hex}}" title="{{msg $ "fullBlog"}}">{{msg $ "more"}}.</a>
</div>
{{end}}
<!-- 分页 -->
<ul class="pager">
{{page .userInfo.Username .notebookId .page .pageSize .count}}
{{if .notebookId}}
{{set $ "pageUrl" (concatStr $.cateUrl "/" .notebookId)}}
{{else}}
{{set $ "pageUrl" $.indexUrl}}
{{end}}
{{page $.pageUrl .page .pageSize .count}}
</ul>
</div>
</div>
+9 -9
View File
@@ -2,38 +2,38 @@
<div id="postsContainer">
<div class="container">
<h2>搜索 {{.key}} </h2>
<h2>{{msg . "search"}} - {{.key}} </h2>
</div>
<div id="posts">
{{range .blogs}}
<div class="each-post">
<div class="title">
<a href="/blog/view/{{.NoteId.Hex}}" title="全文">
<a href="{{$.viewUrl}}/{{.NoteId.Hex}}" title="{{msg $ "fullBlog"}}">
{{.Title}}
</a>
</div>
<div class="created-time">
<i class="fa fa-bookmark-o" style="color: #666"></i>
<i class="fa fa-bookmark-o"></i>
{{if .Tags}}
{{blogTags .Tags}}
{{blogTags $ .Tags}}
{{else}}
无
{{msg $ "noTag"}}
{{end}}
|
<i class="fa fa-calendar" style="color: #666"></i> 更新 {{.UpdatedTime | datetime}} |
<i class="fa fa-calendar" style="color: #666"></i> 创建 {{.CreatedTime | datetime}}
<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="/blog/view/{{.NoteId.Hex}}" title="更多">More...</a>
<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>
+87 -62
View File
@@ -1,11 +1,12 @@
{{template "Blog/header.html" .}}
<!-- -->
<link rel="stylesheet" href="/tinymce/skins/custom/skin.min.css" type="text/css">
<!-- 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">
@@ -20,9 +21,18 @@
<div class="tab-pane" id="styleInfo">
<form class="form-horizontal" role="form">
<div class="form-group">
<label for="Style" class="col-sm-2 control-label">{{msg . "theme"}}</label>
<label class="col-sm-2 control-label"></label>
<div class="col-sm-10">
<label><input type="radio" name="Style"
<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"
@@ -31,53 +41,85 @@
checked="checked"
{{end}}
{{end}}>
{{msg . "default"}} </label>
<label><input type="radio" name="Style"
{{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><input type="radio" name="Style"
{{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>
{{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>
</div>
</form>
</div>
<div class="tab-pane" id="commentInfo">
<form class="form-horizontal" role="form">
<div class="form-group">
<label for="subTitle" class="col-sm-2 control-label">{{msg . "openComment"}}</label>
<label class="col-sm-2 control-label"></label>
<div class="col-sm-10">
<input type="checkbox" id="CanComment" name="CanComment"
{{if .userBlog.CanComment}}checked="checked"{{end}} >
<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 />
{{msg . "commentSys"}}
<div id="disqusSet">
<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 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 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 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">
@@ -101,7 +143,7 @@
<div class="col-sm-10">
<input type="hidden" name="Logo" id="Logo"
value="{{.userBlog.Logo}}" />
<form id="formLogo" action="/file/uploadBlogLogo" method="post"
<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"
@@ -126,7 +168,7 @@
<div class="col-sm-10">
<input type="text" class="form-control" id="SubTitle"
name="SubTitle" value="{{.userBlog.SubTitle}}"
placeholder="eg: leanote, {{msg $ "moto"}}">
placeholder="eg: leanote, Not Just A Notebook">
</div>
</div>
@@ -158,11 +200,11 @@
{{template "Blog/footer.html" .}}
<script src="/js/common-min.js"></script>
<script type="text/javascript" src="/tinymce/tinymce.min.js"></script>
<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",
@@ -197,12 +239,19 @@ $(function() {
$("#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();
}
});
$("#CanComment").trigger("click").trigger("click"); // 恶心的想法
// 基本设置
@@ -219,7 +268,7 @@ $(function() {
$("#blogDesc").html(data.SubTitle);
$("#logo").html(data.Title);
if(data.Logo) {
$("#logo").html(t('<img src="?" />', data.Logo));
$("#logo").html(t('<img src="?" />', urlPrefix + "/" + data.Logo));
}
}, this);
});
@@ -228,18 +277,20 @@ $(function() {
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);
@@ -256,7 +307,7 @@ function inProgress() {
function uploadFinish(ret) {
if (ret) {
if (ret.resultCode == '1') {
$("#logoImg img").attr("src", ret.filename).parent().show();
$("#logoImg img").attr("src", urlPrefix + "/" + ret.filename).parent().show();
$("#Logo").val(ret.filename);
return;
}
@@ -266,32 +317,6 @@ function uploadFinish(ret) {
// 上传出错
alert("上传出错");
}
function submit() {
var tpl = '<form action="/blog/setBlog" method="post"><input name="Title" value="?" />';
tpl += '<input name="SubTitle" value="?" />';
tpl += '<input name="Logo" value="?" />';
tpl += '<input name="CanComment" value="?" />';
tpl += '<input name="DisqusId" value="?" />';
tpl += '<input name="Style" value="?" />';
tpl += '<textarea name="AboutMe">?</textarea>';
tpl += "</form";
var data = {
Title : $("#Title").val(),
SubTitle : $("#SubTitle").val(),
Logo : $("#Logo").val(),
AboutMe : getEditorContent(),
CanComment : $("#CanComment").is(":checked"),
DisqusId : $("#DisqusId").val(),
Style : $("input[name='Style']:checked").val()
}
if (!data.DisqusId) {
data.DisqusId = "leanote";
}
$(t(tpl, data.Title, data.SubTitle, data.Logo,
data.CanComment, data.DisqusId, data.Style,
data.AboutMe)).submit();
}
</script>
</div>
</body>
+42 -56
View File
@@ -1,6 +1,5 @@
{{template "Blog/header.html" .}}
<!-- -->
<div id="postsContainer">
<div id="posts">
<div class="each-post">
@@ -8,15 +7,30 @@
{{.blog.Title}}
</div>
<div class="created-time">
<i class="fa fa-bookmark-o" style="color: #666"></i>
<i class="fa fa-bookmark-o"></i>
{{if .blog.Tags}}
{{blogTags .blog.Tags}}
{{blogTags $ .blog.Tags}}
{{else}}
{{msg . "noTag"}}
{{end}}
|
<i class="fa fa-calendar" style="color: #666"></i> {{msg . "updatedTime"}} {{.blog.UpdatedTime | datetime}} |
<i class="fa fa-calendar" style="color: #666"></i> {{msg . "createdTime"}} {{.blog.CreatedTime | datetime}}
<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">
@@ -33,75 +47,41 @@
{{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"}}
<!-- Nav -->
<style>
#blogNav {
display: none;
background-color: #fff;
opacity: 0.7;
position: fixed;
z-index: 10;
padding: 3px;
border-radius: 3px;
}
#blogNavContent {
overflow-y: auto;
max-height: 250px;
display: none;
}
#blogNavNav {
cursor: pointer;
}
#blogNav a {
color: #666;
}
#blogNav:hover {
opacity: 0.9;
}
#blogNav a:hover {
color: #0fb264;
}
#blogNav ul {
padding-left: 20px;
}
#blogNav ul .nav-h1 {
}
#blogNav ul .nav-h2 {
margin-left: 20px;
}
#blogNav ul .nav-h3 {
margin-left: 30px;
}
#blogNav ul .nav-h4 {
margin-left: 40px;
}
#blogNav ul .nav-h5 {
margin-left: 50px;
}
</style>
<div id="blogNav">
<div id="blogNavNav">
<i class="fa fa-align-justify" title="文档导航"></i>
<span>{{msg . "blogNav"}}</span>
</div>
<div id="blogNavContent" style="max-width: 200px">
<div id="blogNavContent">
</div>
</div>
<script src="/public/js/app/blog/nav.js"></script>
<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/google-code-prettify/prettify.js"></script>
<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>
@@ -127,13 +107,19 @@ 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>